archive_acl_clear:
  131|   352k|{
  132|   352k|	struct archive_acl_entry *ap;
  133|       |
  134|   352k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (134:9): [True: 0, False: 352k]
  ------------------
  135|      0|		ap = acl->acl_head->next;
  136|      0|		archive_mstring_clean(&acl->acl_head->name);
  137|      0|		free(acl->acl_head);
  138|      0|		acl->acl_head = ap;
  139|      0|	}
  140|   352k|	free(acl->acl_text_w);
  141|   352k|	acl->acl_text_w = NULL;
  142|   352k|	free(acl->acl_text);
  143|   352k|	acl->acl_text = NULL;
  144|   352k|	acl->acl_p = NULL;
  145|   352k|	acl->acl_types = 0;
  146|   352k|	acl->acl_state = 0; /* Not counting. */
  147|   352k|}

archive_blake2sp_ref.c:store32:
   93|   112k|{
   94|       |#if defined(NATIVE_LITTLE_ENDIAN)
   95|       |  memcpy(dst, &w, sizeof w);
   96|       |#else
   97|   112k|  uint8_t *p = ( uint8_t * )dst;
   98|   112k|  p[0] = (uint8_t)(w >>  0);
   99|   112k|  p[1] = (uint8_t)(w >>  8);
  100|   112k|  p[2] = (uint8_t)(w >> 16);
  101|   112k|  p[3] = (uint8_t)(w >> 24);
  102|   112k|#endif
  103|   112k|}
archive_blake2sp_ref.c:store16:
   82|  56.1k|{
   83|       |#if defined(NATIVE_LITTLE_ENDIAN)
   84|       |  memcpy(dst, &w, sizeof w);
   85|       |#else
   86|  56.1k|  uint8_t *p = ( uint8_t * )dst;
   87|  56.1k|  *p++ = ( uint8_t )w; w >>= 8;
   88|  56.1k|  *p++ = ( uint8_t )w;
   89|  56.1k|#endif
   90|  56.1k|}
archive_blake2s_ref.c:load32:
   35|   449k|{
   36|       |#if defined(NATIVE_LITTLE_ENDIAN)
   37|       |  uint32_t w;
   38|       |  memcpy(&w, src, sizeof w);
   39|       |  return w;
   40|       |#else
   41|   449k|  const uint8_t *p = ( const uint8_t * )src;
   42|   449k|  return (( uint32_t )( p[0] ) <<  0) |
   43|   449k|         (( uint32_t )( p[1] ) <<  8) |
   44|   449k|         (( uint32_t )( p[2] ) << 16) |
   45|   449k|         (( uint32_t )( p[3] ) << 24) ;
   46|   449k|#endif
   47|   449k|}

blake2s_init_param:
   79|  56.1k|{
   80|  56.1k|  const unsigned char *p = ( const unsigned char * )( P );
   81|  56.1k|  size_t i;
   82|       |
   83|  56.1k|  blake2s_init0( S );
   84|       |
   85|       |  /* IV XOR ParamBlock */
   86|   505k|  for( i = 0; i < 8; ++i )
  ------------------
  |  Branch (86:15): [True: 449k, False: 56.1k]
  ------------------
   87|   449k|    S->h[i] ^= load32( &p[i * 4] );
   88|       |
   89|  56.1k|  S->outlen = P->digest_length;
   90|  56.1k|  return 0;
   91|  56.1k|}
archive_blake2s_ref.c:blake2s_init0:
   70|  56.1k|{
   71|  56.1k|  size_t i;
   72|  56.1k|  memset( S, 0, sizeof( blake2s_state ) );
   73|       |
   74|   505k|  for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
  ------------------
  |  Branch (74:15): [True: 449k, False: 56.1k]
  ------------------
   75|  56.1k|}

blake2sp_init:
   81|  6.23k|{
   82|  6.23k|  size_t i;
   83|       |
   84|  6.23k|  if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1;
  ------------------
  |  Branch (84:7): [True: 0, False: 6.23k]
  |  Branch (84:18): [True: 0, False: 6.23k]
  ------------------
   85|       |
   86|  6.23k|  memset( S->buf, 0, sizeof( S->buf ) );
   87|  6.23k|  S->buflen = 0;
   88|  6.23k|  S->outlen = outlen;
   89|       |
   90|  6.23k|  if( blake2sp_init_root( S->R, outlen, 0 ) < 0 )
  ------------------
  |  Branch (90:7): [True: 0, False: 6.23k]
  ------------------
   91|      0|    return -1;
   92|       |
   93|  56.1k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  56.1k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (93:15): [True: 49.9k, False: 6.23k]
  ------------------
   94|  49.9k|    if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;
  ------------------
  |  Branch (94:9): [True: 0, False: 49.9k]
  ------------------
   95|       |
   96|  6.23k|  S->R->last_node = 1;
   97|  6.23k|  S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
  ------------------
  |  |   29|  6.23k|#define PARALLELISM_DEGREE 8
  ------------------
   98|  6.23k|  return 0;
   99|  6.23k|}
archive_blake2sp_ref.c:blake2sp_init_root:
   63|  6.23k|{
   64|  6.23k|  blake2s_param P[1];
   65|  6.23k|  P->digest_length = (uint8_t)outlen;
   66|  6.23k|  P->key_length = (uint8_t)keylen;
   67|  6.23k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|  6.23k|#define PARALLELISM_DEGREE 8
  ------------------
   68|  6.23k|  P->depth = 2;
   69|  6.23k|  store32( &P->leaf_length, 0 );
   70|  6.23k|  store32( &P->node_offset, 0 );
   71|  6.23k|  store16( &P->xof_length, 0 );
   72|  6.23k|  P->node_depth = 1;
   73|  6.23k|  P->inner_length = BLAKE2S_OUTBYTES;
   74|  6.23k|  memset( P->salt, 0, sizeof( P->salt ) );
   75|  6.23k|  memset( P->personal, 0, sizeof( P->personal ) );
   76|  6.23k|  return blake2s_init_param( S, P );
   77|  6.23k|}
archive_blake2sp_ref.c:blake2sp_init_leaf:
   46|  49.9k|{
   47|  49.9k|  blake2s_param P[1];
   48|  49.9k|  P->digest_length = (uint8_t)outlen;
   49|  49.9k|  P->key_length = (uint8_t)keylen;
   50|  49.9k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|  49.9k|#define PARALLELISM_DEGREE 8
  ------------------
   51|  49.9k|  P->depth = 2;
   52|  49.9k|  store32( &P->leaf_length, 0 );
   53|  49.9k|  store32( &P->node_offset, offset );
   54|  49.9k|  store16( &P->xof_length, 0 );
   55|  49.9k|  P->node_depth = 0;
   56|  49.9k|  P->inner_length = BLAKE2S_OUTBYTES;
   57|  49.9k|  memset( P->salt, 0, sizeof( P->salt ) );
   58|  49.9k|  memset( P->personal, 0, sizeof( P->personal ) );
   59|  49.9k|  return blake2sp_init_leaf_param( S, P );
   60|  49.9k|}
archive_blake2sp_ref.c:blake2sp_init_leaf_param:
   39|  49.9k|{
   40|  49.9k|  int err = blake2s_init_param(S, P);
   41|  49.9k|  S->outlen = P->inner_length;
   42|  49.9k|  return err;
   43|  49.9k|}

__archive_check_magic:
  129|   435k|{
  130|   435k|	char states1[64];
  131|   435k|	char states2[64];
  132|   435k|	const char *handle_type;
  133|       |
  134|       |	/*
  135|       |	 * If this isn't some form of archive handle,
  136|       |	 * then the library user has screwed up so bad that
  137|       |	 * we don't even have a reliable way to report an error.
  138|       |	 */
  139|   435k|	handle_type = archive_handle_type_name(a->magic);
  140|       |
  141|   435k|	if (!handle_type) {
  ------------------
  |  Branch (141:6): [True: 0, False: 435k]
  ------------------
  142|      0|		errmsg("PROGRAMMER ERROR: Function ");
  143|      0|		errmsg(function);
  144|      0|		errmsg(" invoked with invalid archive handle.\n");
  145|      0|		diediedie();
  146|      0|	}
  147|       |
  148|   435k|	if (a->magic != magic) {
  ------------------
  |  Branch (148:6): [True: 0, False: 435k]
  ------------------
  149|      0|		archive_set_error(a, -1,
  150|      0|		    "PROGRAMMER ERROR: Function '%s' invoked"
  151|      0|		    " on '%s' archive object, which is not supported.",
  152|      0|		    function,
  153|      0|		    handle_type);
  154|      0|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  155|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  156|      0|	}
  157|       |
  158|   435k|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (158:6): [True: 176, False: 434k]
  ------------------
  159|       |		/* If we're already FATAL, don't overwrite the error. */
  160|    176|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   69|    176|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (160:7): [True: 41, False: 135]
  ------------------
  161|     41|			write_all_states(states1, a->state);
  162|     41|			write_all_states(states2, state);
  163|     41|			archive_set_error(a, -1,
  164|     41|			    "INTERNAL ERROR: Function '%s' invoked with"
  165|     41|			    " archive structure in state '%s',"
  166|     41|			    " should be in state '%s'",
  167|     41|			    function,
  168|     41|			    states1,
  169|     41|			    states2);
  170|     41|		}
  171|    176|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    176|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  172|    176|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|    176|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  173|    176|	}
  174|   434k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|   434k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  175|   435k|}
archive_check_magic.c:archive_handle_type_name:
   90|   435k|{
   91|   435k|	switch (m) {
   92|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (92:2): [True: 0, False: 435k]
  ------------------
   93|   435k|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|   435k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (93:2): [True: 435k, False: 0]
  ------------------
   94|      0|	case ARCHIVE_WRITE_DISK_MAGIC:	return ("archive_write_disk");
  ------------------
  |  |   60|      0|#define	ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
  ------------------
  |  Branch (94:2): [True: 0, False: 435k]
  ------------------
   95|      0|	case ARCHIVE_READ_DISK_MAGIC:	return ("archive_read_disk");
  ------------------
  |  |   61|      0|#define	ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
  ------------------
  |  Branch (95:2): [True: 0, False: 435k]
  ------------------
   96|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (96:2): [True: 0, False: 435k]
  ------------------
   97|      0|	default:			return NULL;
  ------------------
  |  Branch (97:2): [True: 0, False: 435k]
  ------------------
   98|   435k|	}
   99|   435k|}
archive_check_magic.c:write_all_states:
  103|     82|{
  104|     82|	unsigned int lowbit;
  105|       |
  106|     82|	*buff = '\0';
  107|       |
  108|       |	/* A trick for computing the lowest set bit. */
  109|    164|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (109:9): [True: 82, False: 82]
  ------------------
  110|     82|		states &= ~lowbit;		/* Clear the low bit. */
  111|     82|		strcat(buff, state_name(lowbit));
  112|     82|		if (states != 0)
  ------------------
  |  Branch (112:7): [True: 0, False: 82]
  ------------------
  113|      0|			strcat(buff, "/");
  114|     82|	}
  115|     82|}
archive_check_magic.c:state_name:
   76|     82|{
   77|     82|	switch (s) {
   78|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   64|      0|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  |  Branch (78:2): [True: 0, False: 82]
  ------------------
   79|      0|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   65|      0|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  |  Branch (79:2): [True: 0, False: 82]
  ------------------
   80|     41|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   66|     41|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (80:2): [True: 41, False: 41]
  ------------------
   81|     41|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   67|     41|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  |  Branch (81:2): [True: 41, False: 41]
  ------------------
   82|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   68|      0|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (82:2): [True: 0, False: 82]
  ------------------
   83|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (83:2): [True: 0, False: 82]
  ------------------
   84|      0|	default:			return ("??");
  ------------------
  |  Branch (84:2): [True: 0, False: 82]
  ------------------
   85|     82|	}
   86|     82|}

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

archive_digest.c:__archive_md5init:
  283|      1|{
  284|      1|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (284:7): [True: 0, False: 1]
  ------------------
  285|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  286|      1|  if (!EVP_DigestInit(*ctx, EVP_md5()))
  ------------------
  |  Branch (286:7): [True: 0, False: 1]
  ------------------
  287|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  288|      1|  return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  289|      1|}
archive_digest.c:__archive_md5update:
  294|    694|{
  295|    694|  EVP_DigestUpdate(*ctx, indata, insize);
  296|    694|  return (ARCHIVE_OK);
  ------------------
  |  |  192|    694|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  297|    694|}
archive_digest.c:__archive_md5final:
  301|      1|{
  302|       |  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
  303|       |   * this is meant to cope with that. Real fix is probably to fix
  304|       |   * archive_write_set_format_xar.c
  305|       |   */
  306|      1|  if (*ctx) {
  ------------------
  |  Branch (306:7): [True: 1, False: 0]
  ------------------
  307|      1|    EVP_DigestFinal(*ctx, md, NULL);
  308|      1|    EVP_MD_CTX_free(*ctx);
  309|      1|    *ctx = NULL;
  310|      1|  }
  311|      1|  return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  312|      1|}

archive_read_support_filter_gzip.c:archive_le32dec:
  113|      4|{
  114|      4|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|      4|	unsigned int p3 = p[3];
  120|      4|	unsigned int p2 = p[2];
  121|      4|	unsigned int p1 = p[1];
  122|      4|	unsigned int p0 = p[0];
  123|       |
  124|      4|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|      4|}
archive_read_support_filter_lz4.c:archive_le32dec:
  113|    271|{
  114|    271|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|    271|	unsigned int p3 = p[3];
  120|    271|	unsigned int p2 = p[2];
  121|    271|	unsigned int p1 = p[1];
  122|    271|	unsigned int p0 = p[0];
  123|       |
  124|    271|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|    271|}
archive_read_support_filter_rpm.c:archive_be32dec:
   75|     10|{
   76|     10|	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|     10|	unsigned int p3 = p[3];
   82|     10|	unsigned int p2 = p[2];
   83|     10|	unsigned int p1 = p[1];
   84|     10|	unsigned int p0 = p[0];
   85|       |
   86|     10|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|     10|}
archive_read_support_filter_xz.c:archive_le32dec:
  113|    774|{
  114|    774|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|    774|	unsigned int p3 = p[3];
  120|    774|	unsigned int p2 = p[2];
  121|    774|	unsigned int p1 = p[1];
  122|    774|	unsigned int p0 = p[0];
  123|       |
  124|    774|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|    774|}
archive_read_support_filter_xz.c:archive_le64dec:
  129|    258|{
  130|    258|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|    258|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|    258|}
archive_read_support_filter_zstd.c:archive_le32dec:
  113|    271|{
  114|    271|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|    271|	unsigned int p3 = p[3];
  120|    271|	unsigned int p2 = p[2];
  121|    271|	unsigned int p1 = p[1];
  122|    271|	unsigned int p0 = p[0];
  123|       |
  124|    271|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|    271|}
archive_read_support_format_cab.c:archive_le32dec:
  113|     19|{
  114|     19|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|     19|	unsigned int p3 = p[3];
  120|     19|	unsigned int p2 = p[2];
  121|     19|	unsigned int p1 = p[1];
  122|     19|	unsigned int p0 = p[0];
  123|       |
  124|     19|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|     19|}
archive_read_support_format_cab.c:archive_le16dec:
   99|     46|{
  100|     46|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|     46|	unsigned int p1 = p[1];
  106|     46|	unsigned int p0 = p[0];
  107|       |
  108|     46|	return ((p1 << 8) | p0);
  109|     46|}
archive_read_support_format_iso9660.c:archive_le32dec:
  113|    304|{
  114|    304|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|    304|	unsigned int p3 = p[3];
  120|    304|	unsigned int p2 = p[2];
  121|    304|	unsigned int p1 = p[1];
  122|    304|	unsigned int p0 = p[0];
  123|       |
  124|    304|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|    304|}
archive_read_support_format_iso9660.c:archive_le16dec:
   99|     59|{
  100|     59|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|     59|	unsigned int p1 = p[1];
  106|     59|	unsigned int p0 = p[0];
  107|       |
  108|     59|	return ((p1 << 8) | p0);
  109|     59|}
archive_read_support_format_iso9660.c:archive_be32dec:
   75|     59|{
   76|     59|	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|     59|	unsigned int p3 = p[3];
   82|     59|	unsigned int p2 = p[2];
   83|     59|	unsigned int p1 = p[1];
   84|     59|	unsigned int p0 = p[0];
   85|       |
   86|     59|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|     59|}
archive_read_support_format_lha.c:archive_le32dec:
  113|     50|{
  114|     50|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|     50|	unsigned int p3 = p[3];
  120|     50|	unsigned int p2 = p[2];
  121|     50|	unsigned int p1 = p[1];
  122|     50|	unsigned int p0 = p[0];
  123|       |
  124|     50|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|     50|}
archive_read_support_format_lha.c:archive_le16dec:
   99|    450|{
  100|    450|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|    450|	unsigned int p1 = p[1];
  106|    450|	unsigned int p0 = p[0];
  107|       |
  108|    450|	return ((p1 << 8) | p0);
  109|    450|}
archive_read_support_format_rar.c:archive_le16dec:
   99|    105|{
  100|    105|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|    105|	unsigned int p1 = p[1];
  106|    105|	unsigned int p0 = p[0];
  107|       |
  108|    105|	return ((p1 << 8) | p0);
  109|    105|}
archive_read_support_format_rar.c:archive_le64dec:
  129|      2|{
  130|      2|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|      2|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|      2|}
archive_read_support_format_rar.c:archive_le32dec:
  113|  4.12k|{
  114|  4.12k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  4.12k|	unsigned int p3 = p[3];
  120|  4.12k|	unsigned int p2 = p[2];
  121|  4.12k|	unsigned int p1 = p[1];
  122|  4.12k|	unsigned int p0 = p[0];
  123|       |
  124|  4.12k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  4.12k|}
archive_read_support_format_rar.c:archive_le32enc:
  175|  2.93k|{
  176|  2.93k|	unsigned char *p = (unsigned char *)pp;
  177|       |
  178|  2.93k|	p[0] = u & 0xff;
  179|  2.93k|	p[1] = (u >> 8) & 0xff;
  180|  2.93k|	p[2] = (u >> 16) & 0xff;
  181|  2.93k|	p[3] = (u >> 24) & 0xff;
  182|  2.93k|}
archive_read_support_format_rar5.c:archive_le32dec:
  113|  26.0k|{
  114|  26.0k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|  26.0k|	unsigned int p3 = p[3];
  120|  26.0k|	unsigned int p2 = p[2];
  121|  26.0k|	unsigned int p1 = p[1];
  122|  26.0k|	unsigned int p0 = p[0];
  123|       |
  124|  26.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|  26.0k|}
archive_read_support_format_rar5.c:archive_le16dec:
   99|     35|{
  100|     35|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|     35|	unsigned int p1 = p[1];
  106|     35|	unsigned int p0 = p[0];
  107|       |
  108|     35|	return ((p1 << 8) | p0);
  109|     35|}
archive_read_support_format_xar.c:archive_be32dec:
   75|    238|{
   76|    238|	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|    238|	unsigned int p3 = p[3];
   82|    238|	unsigned int p2 = p[2];
   83|    238|	unsigned int p1 = p[1];
   84|    238|	unsigned int p0 = p[0];
   85|       |
   86|    238|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
   87|    238|}
archive_read_support_format_xar.c:archive_be16dec:
   61|      3|{
   62|      3|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|      3|	unsigned int p1 = p[1];
   68|      3|	unsigned int p0 = p[0];
   69|       |
   70|      3|	return ((p0 << 8) | p1);
   71|      3|}
archive_read_support_format_xar.c:archive_be64dec:
   91|      2|{
   92|      2|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|      2|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
   95|      2|}
archive_read_support_format_zip.c:archive_le16dec:
   99|   147k|{
  100|   147k|	unsigned char const *p = (unsigned char const *)pp;
  101|       |
  102|       |	/* Store into unsigned temporaries before left shifting, to avoid
  103|       |	promotion to signed int and then left shifting into the sign bit,
  104|       |	which is undefined behaviour. */
  105|   147k|	unsigned int p1 = p[1];
  106|   147k|	unsigned int p0 = p[0];
  107|       |
  108|   147k|	return ((p1 << 8) | p0);
  109|   147k|}
archive_read_support_format_zip.c:archive_le32dec:
  113|   124k|{
  114|   124k|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|   124k|	unsigned int p3 = p[3];
  120|   124k|	unsigned int p2 = p[2];
  121|   124k|	unsigned int p1 = p[1];
  122|   124k|	unsigned int p0 = p[0];
  123|       |
  124|   124k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|   124k|}
archive_read_support_format_zip.c:archive_le64dec:
  129|  8.95k|{
  130|  8.95k|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|  8.95k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|  8.95k|}
archive_string.c:archive_be16dec:
   61|     42|{
   62|     42|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|     42|	unsigned int p1 = p[1];
   68|     42|	unsigned int p0 = p[0];
   69|       |
   70|     42|	return ((p0 << 8) | p1);
   71|     42|}
archive_read_support_format_7zip.c:archive_le32dec:
  113|     83|{
  114|     83|	unsigned char const *p = (unsigned char const *)pp;
  115|       |
  116|       |	/* Store into unsigned temporaries before left shifting, to avoid
  117|       |	promotion to signed int and then left shifting into the sign bit,
  118|       |	which is undefined behaviour. */
  119|     83|	unsigned int p3 = p[3];
  120|     83|	unsigned int p2 = p[2];
  121|     83|	unsigned int p1 = p[1];
  122|     83|	unsigned int p0 = p[0];
  123|       |
  124|     83|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  125|     83|}
archive_read_support_format_7zip.c:archive_le64dec:
  129|     15|{
  130|     15|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|     15|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  133|     15|}

archive_entry_clear:
  155|   352k|{
  156|   352k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 352k]
  ------------------
  157|      0|		return (NULL);
  158|   352k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   352k|	archive_mstring_clean(&entry->ae_gname);
  160|   352k|	archive_mstring_clean(&entry->ae_linkname);
  161|   352k|	archive_mstring_clean(&entry->ae_pathname);
  162|   352k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   352k|	archive_mstring_clean(&entry->ae_uname);
  164|   352k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   352k|	archive_acl_clear(&entry->acl);
  166|   352k|	archive_entry_xattr_clear(entry);
  167|   352k|	archive_entry_sparse_clear(entry);
  168|   352k|	free(entry->stat);
  169|   352k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  196|   352k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   352k|	memset(entry, 0, sizeof(*entry));
  171|   352k|	return entry;
  172|   352k|}
archive_entry_free:
  250|  15.9k|{
  251|  15.9k|	archive_entry_clear(entry);
  252|  15.9k|	free(entry);
  253|  15.9k|}
archive_entry_new:
  257|  15.7k|{
  258|  15.7k|	return archive_entry_new2(NULL);
  259|  15.7k|}
archive_entry_new2:
  263|  15.9k|{
  264|  15.9k|	struct archive_entry *entry;
  265|       |
  266|  15.9k|	entry = (struct archive_entry *)calloc(1, sizeof(*entry));
  267|  15.9k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 15.9k]
  ------------------
  268|      0|		return (NULL);
  269|  15.9k|	entry->archive = a;
  270|  15.9k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  196|  15.9k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  15.9k|	return (entry);
  272|  15.9k|}
archive_entry_atime:
  280|  38.2k|{
  281|  38.2k|	return (entry->ae_stat.aest_atime);
  282|  38.2k|}
archive_entry_atime_is_set:
  292|      1|{
  293|      1|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|      1|#define	AE_SET_ATIME	4
  ------------------
  294|      1|}
archive_entry_birthtime:
  298|  38.2k|{
  299|  38.2k|	return (entry->ae_stat.aest_birthtime);
  300|  38.2k|}
archive_entry_ctime:
  316|  38.2k|{
  317|  38.2k|	return (entry->ae_stat.aest_ctime);
  318|  38.2k|}
archive_entry_ctime_is_set:
  322|      1|{
  323|      1|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|      1|#define	AE_SET_CTIME	8
  ------------------
  324|      1|}
archive_entry_dev:
  334|  39.5k|{
  335|  39.5k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 4.42k, False: 35.1k]
  ------------------
  336|  4.42k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  4.42k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|  35.1k|		    entry->ae_stat.aest_devminor);
  338|  35.1k|	else
  339|  35.1k|		return (entry->ae_stat.aest_dev);
  340|  39.5k|}
archive_entry_filetype:
  368|  44.3k|{
  369|  44.3k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  184|  44.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|  44.3k|}
archive_entry_gid:
  427|  38.2k|{
  428|  38.2k|	return (entry->ae_stat.aest_gid);
  429|  38.2k|}
archive_entry_gid_is_set:
  433|      5|{
  434|      5|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|      5|#define	AE_SET_GID	4096
  ------------------
  435|      5|}
archive_entry_gname:
  439|      1|{
  440|      1|	const char *p;
  441|      1|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 1, False: 0]
  ------------------
  442|      1|		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_ino64:
  561|  1.31k|{
  562|  1.31k|	return (entry->ae_stat.aest_ino);
  563|  1.31k|}
archive_entry_mode:
  567|  38.2k|{
  568|  38.2k|	return (entry->acl.mode);
  569|  38.2k|}
archive_entry_mtime:
  573|  38.2k|{
  574|  38.2k|	return (entry->ae_stat.aest_mtime);
  575|  38.2k|}
archive_entry_mtime_is_set:
  585|      5|{
  586|      5|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|      5|#define	AE_SET_MTIME	16
  ------------------
  587|      5|}
archive_entry_nlink:
  591|  3.73k|{
  592|  3.73k|	return (entry->ae_stat.aest_nlink);
  593|  3.73k|}
archive_entry_pathname:
  604|  46.3k|{
  605|  46.3k|	const char *p;
  606|  46.3k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 44.5k, False: 1.84k]
  ------------------
  607|  46.3k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|  44.5k|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|  1.84k|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 1.84k, False: 0]
  ------------------
  611|  1.84k|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 1.84k, False: 0]
  ------------------
  612|  1.84k|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|  1.84k|		    return (p);
  614|  1.84k|    }
  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|  42.3k|{
  624|  42.3k|	const char *p;
  625|  42.3k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 40.2k, False: 2.05k]
  ------------------
  626|  42.3k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|  40.2k|		return (p);
  628|  2.05k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 2.05k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  2.05k|	return (NULL);
  631|  2.05k|}
archive_entry_pathname_w:
  635|  87.3k|{
  636|  87.3k|	const wchar_t *p;
  637|  87.3k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 82.1k, False: 5.15k]
  ------------------
  638|  87.3k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|  82.1k|		return (p);
  640|  5.15k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 5.15k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  5.15k|	return (NULL);
  643|  5.15k|}
archive_entry_perm_is_set:
  660|      5|{
  661|      5|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|      5|#define	AE_SET_PERM	512
  ------------------
  662|      5|}
archive_entry_size:
  712|  41.0k|{
  713|  41.0k|	return (entry->ae_stat.aest_size);
  714|  41.0k|}
archive_entry_symlink:
  746|      2|{
  747|      2|	const char *p;
  748|      2|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|      2|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (748:6): [True: 2, False: 0]
  ------------------
  749|      2|		return (NULL);
  750|      0|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (750:6): [True: 0, False: 0]
  ------------------
  751|      0|	    entry->archive, &entry->ae_linkname, &p) == 0)
  752|      0|		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_uid:
  815|  38.2k|{
  816|  38.2k|	return (entry->ae_stat.aest_uid);
  817|  38.2k|}
archive_entry_uid_is_set:
  821|      5|{
  822|      5|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|      5|#define	AE_SET_UID	2048
  ------------------
  823|      5|}
archive_entry_uname:
  827|      1|{
  828|      1|	const char *p;
  829|      1|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 1, False: 0]
  ------------------
  830|      1|		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|  38.2k|{
  868|  38.2k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  38.2k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  38.2k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|  38.2k|}
archive_entry_is_metadata_encrypted:
  873|  38.2k|{
  874|  38.2k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  38.2k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  38.2k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|  38.2k|}
archive_entry_is_encrypted:
  879|  38.2k|{
  880|  38.2k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|  38.2k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|  38.2k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|  38.2k|}
archive_entry_set_filetype:
  889|  2.83k|{
  890|  2.83k|	entry->stat_valid = 0;
  891|  2.83k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  184|  2.83k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|  2.83k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  184|  2.83k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|  2.83k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|  2.83k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|  2.83k|}
archive_entry_copy_fflags_text:
  908|  5.26k|{
  909|  5.26k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  5.26k|}
archive_entry_copy_fflags_text_len:
  915|  5.26k|{
  916|  5.26k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  5.26k|	return (ae_strtofflags(flags, flags_length,
  918|  5.26k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  5.26k|}
archive_entry_set_gid:
  932|  32.0k|{
  933|  32.0k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 0, False: 32.0k]
  ------------------
  934|      0|		g = 0;
  935|      0|	}
  936|  32.0k|	entry->stat_valid = 0;
  937|  32.0k|	entry->ae_stat.aest_gid = g;
  938|  32.0k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|  32.0k|#define	AE_SET_GID	4096
  ------------------
  939|  32.0k|}
_archive_entry_copy_gname_l:
  979|      1|{
  980|      1|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|      1|}
archive_entry_set_ino:
  985|   294k|{
  986|   294k|	if (ino < 0) {
  ------------------
  |  Branch (986:6): [True: 0, False: 294k]
  ------------------
  987|      0|		ino = 0;
  988|      0|	}
  989|   294k|	entry->stat_valid = 0;
  990|   294k|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|   294k|#define	AE_SET_INO	128
  ------------------
  991|   294k|	entry->ae_stat.aest_ino = ino;
  992|   294k|}
archive_entry_set_hardlink:
 1007|      5|{
 1008|      5|	if (target == NULL) {
  ------------------
  |  Branch (1008:6): [True: 0, False: 5]
  ------------------
 1009|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1010|      0|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1010:7): [True: 0, False: 0]
  ------------------
 1011|      0|			return;
 1012|      0|		}
 1013|      5|	} else {
 1014|      5|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|      5|#define	AE_SET_HARDLINK	1
  ------------------
 1015|      5|	}
 1016|      5|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      5|#define	AE_SET_SYMLINK	2
  ------------------
 1017|      5|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1018|      5|}
archive_entry_copy_hardlink:
 1034|    872|{
 1035|    872|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1035:6): [True: 0, False: 872]
  |  Branch (1035:24): [True: 0, False: 0]
  ------------------
 1036|      0|		return;
 1037|    872|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1038|    872|	if (target != NULL)
  ------------------
  |  Branch (1038:6): [True: 872, False: 0]
  ------------------
 1039|    872|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    872|#define	AE_SET_HARDLINK	1
  ------------------
 1040|      0|	else
 1041|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1042|    872|}
archive_entry_set_atime:
 1092|  27.6k|{
 1093|  27.6k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  27.6k|	do {	\
  |  |  113|  27.6k|		t += ns / 1000000000; \
  |  |  114|  27.6k|		ns %= 1000000000; \
  |  |  115|  27.6k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 27.6k]
  |  |  ------------------
  |  |  116|  27.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1094|  27.6k|	entry->stat_valid = 0;
 1095|  27.6k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  27.6k|#define	AE_SET_ATIME	4
  ------------------
 1096|  27.6k|	entry->ae_stat.aest_atime = t;
 1097|  27.6k|	entry->ae_stat.aest_atime_nsec = ns;
 1098|  27.6k|}
archive_entry_unset_atime:
 1102|      2|{
 1103|      2|	archive_entry_set_atime(entry, 0, 0);
 1104|      2|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|      2|#define	AE_SET_ATIME	4
  ------------------
 1105|      2|}
archive_entry_set_birthtime:
 1109|     80|{
 1110|     80|	FIX_NS(t, ns);
  ------------------
  |  |  112|     80|	do {	\
  |  |  113|     80|		t += ns / 1000000000; \
  |  |  114|     80|		ns %= 1000000000; \
  |  |  115|     80|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 80]
  |  |  ------------------
  |  |  116|     80|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1111|     80|	entry->stat_valid = 0;
 1112|     80|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|     80|#define	AE_SET_BIRTHTIME 32
  ------------------
 1113|     80|	entry->ae_stat.aest_birthtime = t;
 1114|     80|	entry->ae_stat.aest_birthtime_nsec = ns;
 1115|     80|}
archive_entry_unset_birthtime:
 1119|     80|{
 1120|     80|	archive_entry_set_birthtime(entry, 0, 0);
 1121|     80|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|     80|#define	AE_SET_BIRTHTIME 32
  ------------------
 1122|     80|}
archive_entry_set_ctime:
 1126|  27.6k|{
 1127|  27.6k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  27.6k|	do {	\
  |  |  113|  27.6k|		t += ns / 1000000000; \
  |  |  114|  27.6k|		ns %= 1000000000; \
  |  |  115|  27.6k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 27.6k]
  |  |  ------------------
  |  |  116|  27.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1128|  27.6k|	entry->stat_valid = 0;
 1129|  27.6k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  27.6k|#define	AE_SET_CTIME	8
  ------------------
 1130|  27.6k|	entry->ae_stat.aest_ctime = t;
 1131|  27.6k|	entry->ae_stat.aest_ctime_nsec = ns;
 1132|  27.6k|}
archive_entry_unset_ctime:
 1136|      2|{
 1137|      2|	archive_entry_set_ctime(entry, 0, 0);
 1138|      2|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|      2|#define	AE_SET_CTIME	8
  ------------------
 1139|      2|}
archive_entry_set_dev:
 1143|   291k|{
 1144|   291k|	entry->stat_valid = 0;
 1145|   291k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|   291k|#define	AE_SET_DEV	256
  ------------------
 1146|   291k|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1147|   291k|	entry->ae_stat.aest_dev = d;
 1148|   291k|}
archive_entry_set_devmajor:
 1152|  3.11k|{
 1153|  3.11k|	entry->stat_valid = 0;
 1154|  3.11k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  3.11k|#define	AE_SET_DEV	256
  ------------------
 1155|  3.11k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1156|  3.11k|	entry->ae_stat.aest_devmajor = m;
 1157|  3.11k|}
archive_entry_set_devminor:
 1161|  3.11k|{
 1162|  3.11k|	entry->stat_valid = 0;
 1163|  3.11k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  3.11k|#define	AE_SET_DEV	256
  ------------------
 1164|  3.11k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1165|  3.11k|	entry->ae_stat.aest_devminor = m;
 1166|  3.11k|}
archive_entry_set_mode:
 1239|  38.6k|{
 1240|  38.6k|	entry->stat_valid = 0;
 1241|  38.6k|	entry->acl.mode = m;
 1242|  38.6k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  38.6k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  38.6k|#define	AE_SET_FILETYPE	1024
  ------------------
 1243|  38.6k|}
archive_entry_set_mtime:
 1247|  35.3k|{
 1248|  35.3k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  35.3k|	do {	\
  |  |  113|  35.3k|		t += ns / 1000000000; \
  |  |  114|  35.3k|		ns %= 1000000000; \
  |  |  115|  35.3k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 35.3k]
  |  |  ------------------
  |  |  116|  35.3k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1249|  35.3k|	entry->stat_valid = 0;
 1250|  35.3k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|  35.3k|#define	AE_SET_MTIME	16
  ------------------
 1251|  35.3k|	entry->ae_stat.aest_mtime = t;
 1252|  35.3k|	entry->ae_stat.aest_mtime_nsec = ns;
 1253|  35.3k|}
archive_entry_set_nlink:
 1264|  3.40k|{
 1265|  3.40k|	entry->stat_valid = 0;
 1266|  3.40k|	entry->ae_stat.aest_nlink = nlink;
 1267|  3.40k|}
archive_entry_set_pathname:
 1271|     94|{
 1272|     94|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1273|     94|}
archive_entry_copy_pathname:
 1283|  2.78k|{
 1284|  2.78k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1285|  2.78k|}
archive_entry_copy_pathname_w:
 1289|      4|{
 1290|      4|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1291|      4|}
archive_entry_update_pathname_utf8:
 1295|  11.6k|{
 1296|  11.6k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1296:6): [True: 5.21k, False: 6.48k]
  ------------------
 1297|  11.6k|	    &entry->ae_pathname, name) == 0)
 1298|  5.21k|		return (1);
 1299|  6.48k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1299:6): [True: 0, False: 6.48k]
  ------------------
 1300|      0|		__archive_errx(1, "No memory");
 1301|  6.48k|	return (0);
 1302|  6.48k|}
_archive_entry_copy_pathname_l:
 1307|  30.9k|{
 1308|  30.9k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1309|  30.9k|	    name, len, sc));
 1310|  30.9k|}
archive_entry_set_perm:
 1314|     19|{
 1315|     19|	entry->stat_valid = 0;
 1316|     19|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  184|     19|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1317|     19|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  184|     19|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1318|     19|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|     19|#define	AE_SET_PERM	512
  ------------------
 1319|     19|}
archive_entry_set_rdev:
 1323|    261|{
 1324|    261|	entry->stat_valid = 0;
 1325|    261|	entry->ae_stat.aest_rdev = m;
 1326|    261|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1327|    261|	entry->ae_stat.aest_rdevmajor = 0;
 1328|    261|	entry->ae_stat.aest_rdevminor = 0;
 1329|    261|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|    261|#define	AE_SET_RDEV	8192
  ------------------
 1330|    261|}
archive_entry_set_rdevmajor:
 1334|  3.11k|{
 1335|  3.11k|	entry->stat_valid = 0;
 1336|  3.11k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1337|  3.11k|	entry->ae_stat.aest_rdev = 0;
 1338|  3.11k|	entry->ae_stat.aest_rdevmajor = m;
 1339|  3.11k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  3.11k|#define	AE_SET_RDEV	8192
  ------------------
 1340|  3.11k|}
archive_entry_set_rdevminor:
 1344|  3.11k|{
 1345|  3.11k|	entry->stat_valid = 0;
 1346|  3.11k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1347|  3.11k|	entry->ae_stat.aest_rdev = 0;
 1348|  3.11k|	entry->ae_stat.aest_rdevminor = m;
 1349|  3.11k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  3.11k|#define	AE_SET_RDEV	8192
  ------------------
 1350|  3.11k|}
archive_entry_set_size:
 1354|  35.5k|{
 1355|  35.5k|	if (s < 0) {
  ------------------
  |  Branch (1355:6): [True: 0, False: 35.5k]
  ------------------
 1356|      0|		s = 0;
 1357|      0|	}
 1358|  35.5k|	entry->stat_valid = 0;
 1359|  35.5k|	entry->ae_stat.aest_size = s;
 1360|  35.5k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|  35.5k|#define	AE_SET_SIZE	64
  ------------------
 1361|  35.5k|}
archive_entry_unset_size:
 1365|      5|{
 1366|      5|	archive_entry_set_size(entry, 0);
 1367|      5|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|      5|#define	AE_SET_SIZE	64
  ------------------
 1368|      5|}
archive_entry_set_symlink:
 1384|      2|{
 1385|      2|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      2|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1385:6): [True: 2, False: 0]
  |  Branch (1385:26): [True: 0, False: 2]
  ------------------
 1386|      0|		return;
 1387|      2|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1388|      2|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      2|#define	AE_SET_HARDLINK	1
  ------------------
 1389|      2|	if (linkname == NULL)
  ------------------
  |  Branch (1389:6): [True: 2, False: 0]
  ------------------
 1390|      2|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      2|#define	AE_SET_SYMLINK	2
  ------------------
 1391|      0|	else
 1392|      0|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1393|      2|}
archive_entry_set_uid:
 1478|  31.0k|{
 1479|  31.0k|	if (u < 0) {
  ------------------
  |  Branch (1479:6): [True: 0, False: 31.0k]
  ------------------
 1480|      0|		u = 0;
 1481|      0|	}
 1482|  31.0k|	entry->stat_valid = 0;
 1483|  31.0k|	entry->ae_stat.aest_uid = u;
 1484|  31.0k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|  31.0k|#define	AE_SET_UID	2048
  ------------------
 1485|  31.0k|}
archive_entry_set_is_data_encrypted:
 1524|  5.56k|{
 1525|  5.56k|	if (is_encrypted) {
  ------------------
  |  Branch (1525:6): [True: 5.56k, False: 0]
  ------------------
 1526|  5.56k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  5.56k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1527|  5.56k|	} else {
 1528|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1529|      0|	}
 1530|  5.56k|}
_archive_entry_copy_uname_l:
 1545|      1|{
 1546|      1|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1547|      1|	    name, len, sc));
 1548|      1|}
archive_entry_copy_mac_metadata:
 1560|   352k|{
 1561|   352k|  free(entry->mac_metadata);
 1562|   352k|  if (p == NULL || s == 0) {
  ------------------
  |  Branch (1562:7): [True: 352k, False: 0]
  |  Branch (1562:20): [True: 0, False: 0]
  ------------------
 1563|   352k|    entry->mac_metadata = NULL;
 1564|   352k|    entry->mac_metadata_size = 0;
 1565|   352k|  } else {
 1566|      0|    entry->mac_metadata_size = s;
 1567|      0|    entry->mac_metadata = malloc(s);
 1568|      0|    if (entry->mac_metadata == NULL)
  ------------------
  |  Branch (1568:9): [True: 0, False: 0]
  ------------------
 1569|      0|      abort();
 1570|      0|    memcpy(entry->mac_metadata, p, s);
 1571|      0|  }
 1572|   352k|}
archive_entry_digest:
 1577|  38.2k|{
 1578|  38.2k|	switch (type) {
 1579|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  413|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1579:2): [True: 0, False: 38.2k]
  ------------------
 1580|      0|		return entry->digest.md5;
 1581|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  414|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1581:2): [True: 0, False: 38.2k]
  ------------------
 1582|      0|		return entry->digest.rmd160;
 1583|  38.2k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  415|  38.2k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1583:2): [True: 38.2k, False: 0]
  ------------------
 1584|  38.2k|		return entry->digest.sha1;
 1585|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  416|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1585:2): [True: 0, False: 38.2k]
  ------------------
 1586|      0|		return entry->digest.sha256;
 1587|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  417|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1587:2): [True: 0, False: 38.2k]
  ------------------
 1588|      0|		return entry->digest.sha384;
 1589|      0|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  418|      0|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1589:2): [True: 0, False: 38.2k]
  ------------------
 1590|      0|		return entry->digest.sha512;
 1591|      0|	default:
  ------------------
  |  Branch (1591:2): [True: 0, False: 38.2k]
  ------------------
 1592|      0|		return NULL;
 1593|  38.2k|	}
 1594|  38.2k|}
archive_entry.c:ae_strtofflags:
 2135|  5.26k|{
 2136|  5.26k|	const char *start, *end;
 2137|  5.26k|	const struct flag *flag;
 2138|  5.26k|	unsigned long set, clear;
 2139|  5.26k|	const char *failed;
 2140|       |
 2141|  5.26k|	set = clear = 0;
 2142|  5.26k|	start = s;
 2143|  5.26k|	failed = NULL;
 2144|       |	/* Find start of first token. */
 2145|  5.26k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2145:9): [True: 5.26k, False: 0]
  |  Branch (2145:19): [True: 0, False: 5.26k]
  |  Branch (2145:39): [True: 0, False: 5.26k]
  |  Branch (2145:58): [True: 0, False: 5.26k]
  ------------------
 2146|      0|		start++;
 2147|      0|		l--;
 2148|      0|	}
 2149|  12.5k|	while (l > 0) {
  ------------------
  |  Branch (2149:9): [True: 7.27k, False: 5.26k]
  ------------------
 2150|  7.27k|		size_t length;
 2151|       |		/* Locate end of token. */
 2152|  7.27k|		end = start;
 2153|  50.9k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2153:10): [True: 45.6k, False: 5.26k]
  |  Branch (2153:19): [True: 45.6k, False: 0]
  ------------------
 2154|  50.9k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2154:7): [True: 45.6k, False: 0]
  |  Branch (2154:24): [True: 43.6k, False: 2.01k]
  ------------------
 2155|  43.6k|			end++;
 2156|  43.6k|			l--;
 2157|  43.6k|		}
 2158|  7.27k|		length = end - start;
 2159|   145k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2159:26): [True: 138k, False: 7.27k]
  ------------------
 2160|   138k|			size_t flag_length = strlen(flag->name);
 2161|   138k|			if (length == flag_length
  ------------------
  |  Branch (2161:8): [True: 29.1k, False: 109k]
  ------------------
 2162|   138k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2162:11): [True: 0, False: 29.1k]
  ------------------
 2163|       |				/* Matched "noXXXX", so reverse the sense. */
 2164|      0|				clear |= flag->set;
 2165|      0|				set |= flag->clear;
 2166|      0|				break;
 2167|   138k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2167:15): [True: 21.8k, False: 116k]
  ------------------
 2168|   138k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2168:11): [True: 0, False: 21.8k]
  ------------------
 2169|       |				/* Matched "XXXX", so don't reverse. */
 2170|      0|				set |= flag->set;
 2171|      0|				clear |= flag->clear;
 2172|      0|				break;
 2173|      0|			}
 2174|   138k|		}
 2175|       |		/* Ignore unknown flag names. */
 2176|  7.27k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2176:7): [True: 7.27k, False: 0]
  |  Branch (2176:31): [True: 5.26k, False: 2.01k]
  ------------------
 2177|  5.26k|			failed = start;
 2178|       |
 2179|       |		/* Find start of next token. */
 2180|  7.27k|		start = end;
 2181|  9.28k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2181:10): [True: 4.02k, False: 5.26k]
  |  Branch (2181:20): [True: 0, False: 4.02k]
  |  Branch (2181:40): [True: 0, False: 4.02k]
  |  Branch (2181:59): [True: 2.01k, False: 2.01k]
  ------------------
 2182|  2.01k|			start++;
 2183|  2.01k|			l--;
 2184|  2.01k|		}
 2185|       |
 2186|  7.27k|	}
 2187|       |
 2188|  5.26k|	if (setp)
  ------------------
  |  Branch (2188:6): [True: 5.26k, False: 0]
  ------------------
 2189|  5.26k|		*setp = set;
 2190|  5.26k|	if (clrp)
  ------------------
  |  Branch (2190:6): [True: 5.26k, False: 0]
  ------------------
 2191|  5.26k|		*clrp = clear;
 2192|       |
 2193|       |	/* Return location of first failure. */
 2194|  5.26k|	return (failed);
 2195|  5.26k|}

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

archive_entry_sparse_clear:
   40|   352k|{
   41|   352k|	struct ae_sparse *sp;
   42|       |
   43|   352k|	while (entry->sparse_head != NULL) {
  ------------------
  |  Branch (43:9): [True: 0, False: 352k]
  ------------------
   44|      0|		sp = entry->sparse_head->next;
   45|      0|		free(entry->sparse_head);
   46|      0|		entry->sparse_head = sp;
   47|      0|	}
   48|   352k|	entry->sparse_tail = NULL;
   49|   352k|}

archive_entry_xattr_clear:
   73|   352k|{
   74|   352k|	struct ae_xattr	*xp;
   75|       |
   76|   352k|	while (entry->xattr_head != NULL) {
  ------------------
  |  Branch (76:9): [True: 0, False: 352k]
  ------------------
   77|      0|		xp = entry->xattr_head->next;
   78|      0|		free(entry->xattr_head->name);
   79|      0|		free(entry->xattr_head->value);
   80|      0|		free(entry->xattr_head);
   81|      0|		entry->xattr_head = xp;
   82|      0|	}
   83|       |
   84|   352k|	entry->xattr_head = NULL;
   85|   352k|}

archive_hmac.c:__hmac_sha1_init:
  232|    841|{
  233|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  234|       |	EVP_MAC *mac;
  235|       |
  236|       |	char sha1[] = "SHA1";
  237|       |	OSSL_PARAM params[] = {
  238|       |		OSSL_PARAM_utf8_string("digest", sha1, sizeof(sha1) - 1),
  239|       |		OSSL_PARAM_END
  240|       |	};
  241|       |
  242|       |	mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
  243|       |	*ctx = EVP_MAC_CTX_new(mac);
  244|       |	EVP_MAC_free(mac);
  245|       |	if (*ctx == NULL)
  246|       |		return -1;
  247|       |
  248|       |	EVP_MAC_init(*ctx, key, key_len, params);
  249|       |#else
  250|    841|	*ctx = HMAC_CTX_new();
  251|    841|	if (*ctx == NULL)
  ------------------
  |  Branch (251:6): [True: 0, False: 841]
  ------------------
  252|      0|		return -1;
  253|    841|	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
  254|    841|#endif
  255|    841|	return 0;
  256|    841|}
archive_hmac.c:__hmac_sha1_update:
  261|    842|{
  262|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  263|       |	EVP_MAC_update(*ctx, data, data_len);
  264|       |#else
  265|    842|	HMAC_Update(*ctx, data, data_len);
  266|    842|#endif
  267|    842|}
archive_hmac.c:__hmac_sha1_final:
  271|    840|{
  272|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  273|       |	size_t len = *out_len;
  274|       |#else
  275|    840|	unsigned int len = (unsigned int)*out_len;
  276|    840|#endif
  277|       |
  278|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  279|       |	EVP_MAC_final(*ctx, out, &len, *out_len);
  280|       |#else
  281|    840|	HMAC_Final(*ctx, out, &len);
  282|    840|#endif
  283|    840|	*out_len = len;
  284|    840|}
archive_hmac.c:__hmac_sha1_cleanup:
  288|    841|{
  289|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  290|       |	EVP_MAC_CTX_free(*ctx);
  291|       |#else
  292|    841|	HMAC_CTX_free(*ctx);
  293|    841|#endif
  294|    841|	*ctx = NULL;
  295|    841|}

_archive_set_either_option:
   77|    714|{
   78|    714|	int r1, r2;
   79|       |
   80|    714|	if (o == NULL && v == NULL)
  ------------------
  |  Branch (80:6): [True: 0, False: 714]
  |  Branch (80:19): [True: 0, False: 0]
  ------------------
   81|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   82|    714|	if (o == NULL)
  ------------------
  |  Branch (82:6): [True: 0, False: 714]
  ------------------
   83|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   84|       |
   85|    714|	r1 = use_format_option(a, m, o, v);
   86|    714|	if (r1 == ARCHIVE_FATAL)
  ------------------
  |  |  198|    714|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (86:6): [True: 0, False: 714]
  ------------------
   87|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   88|       |
   89|    714|	r2 = use_filter_option(a, m, o, v);
   90|    714|	if (r2 == ARCHIVE_FATAL)
  ------------------
  |  |  198|    714|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (90:6): [True: 0, False: 714]
  ------------------
   91|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   92|       |
   93|    714|	if (r2 == ARCHIVE_WARN - 1)
  ------------------
  |  |  194|    714|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (93:6): [True: 714, False: 0]
  ------------------
   94|    714|		return r1;
   95|      0|	return r1 > r2 ? r1 : r2;
  ------------------
  |  Branch (95:9): [True: 0, False: 0]
  ------------------
   96|    714|}
_archive_set_options:
  101|    238|{
  102|    238|	int allok = 1, anyok = 0, ignore_mod_err = 0, r;
  103|    238|	char *data;
  104|    238|	const char *s, *mod, *opt, *val;
  105|       |
  106|    238|	archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  107|       |
  108|    238|	if (options == NULL || options[0] == '\0')
  ------------------
  |  Branch (108:6): [True: 0, False: 238]
  |  Branch (108:25): [True: 0, False: 238]
  ------------------
  109|      0|		return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  110|       |
  111|    238|	if ((data = strdup(options)) == NULL) {
  ------------------
  |  Branch (111:6): [True: 0, False: 238]
  ------------------
  112|      0|		archive_set_error(a,
  113|      0|		    ENOMEM, "Out of memory adding file to list");
  114|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  115|      0|	}
  116|    238|	s = (const char *)data;
  117|       |
  118|    714|	do {
  119|    714|		mod = opt = val = NULL;
  120|       |
  121|    714|		parse_option(&s, &mod, &opt, &val);
  122|    714|		if (mod == NULL && opt != NULL &&
  ------------------
  |  Branch (122:7): [True: 0, False: 714]
  |  Branch (122:22): [True: 0, False: 0]
  ------------------
  123|    714|		    strcmp("__ignore_wrong_module_name__", opt) == 0) {
  ------------------
  |  Branch (123:7): [True: 0, False: 0]
  ------------------
  124|       |			/* Ignore module name error */
  125|      0|			if (val != NULL) {
  ------------------
  |  Branch (125:8): [True: 0, False: 0]
  ------------------
  126|      0|				ignore_mod_err = 1;
  127|      0|				anyok = 1;
  128|      0|			}
  129|      0|			continue;
  130|      0|		}
  131|       |
  132|    714|		r = use_option(a, mod, opt, val);
  133|    714|		if (r == ARCHIVE_FATAL) {
  ------------------
  |  |  198|    714|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (133:7): [True: 0, False: 714]
  ------------------
  134|      0|			free(data);
  135|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  136|      0|		}
  137|    714|		if (r == ARCHIVE_FAILED && mod != NULL) {
  ------------------
  |  |  196|  1.42k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (137:7): [True: 0, False: 714]
  |  Branch (137:30): [True: 0, False: 0]
  ------------------
  138|      0|			free(data);
  139|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  140|      0|		}
  141|    714|		if (r == ARCHIVE_WARN - 1) {
  ------------------
  |  |  194|    714|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (141:7): [True: 0, False: 714]
  ------------------
  142|      0|			if (ignore_mod_err)
  ------------------
  |  Branch (142:8): [True: 0, False: 0]
  ------------------
  143|      0|				continue;
  144|       |			/* The module name is wrong. */
  145|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  146|      0|			    "Unknown module name: `%s'", mod);
  147|      0|			free(data);
  148|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  149|      0|		}
  150|    714|		if (r == ARCHIVE_WARN) {
  ------------------
  |  |  194|    714|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (150:7): [True: 0, False: 714]
  ------------------
  151|       |			/* The option name is wrong. No-one used this. */
  152|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  153|      0|			    "Undefined option: `%s%s%s'",
  154|      0|			    mod?mod:"", mod?":":"", opt);
  ------------------
  |  Branch (154:8): [True: 0, False: 0]
  |  Branch (154:20): [True: 0, False: 0]
  ------------------
  155|      0|			free(data);
  156|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  157|      0|		}
  158|    714|		if (r == ARCHIVE_OK)
  ------------------
  |  |  192|    714|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (158:7): [True: 714, False: 0]
  ------------------
  159|    714|			anyok = 1;
  160|      0|		else
  161|      0|			allok = 0;
  162|    714|	} while (s != NULL);
  ------------------
  |  Branch (162:11): [True: 476, False: 238]
  ------------------
  163|       |
  164|    238|	free(data);
  165|    238|	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (165:9): [True: 238, False: 0]
  |  Branch (165:30): [True: 0, False: 0]
  ------------------
  166|    238|}
archive_options.c:parse_option:
  170|    714|{
  171|    714|	const char *end, *mod, *opt, *val;
  172|    714|	char *p;
  173|       |
  174|    714|	end = NULL;
  175|    714|	mod = NULL;
  176|    714|	opt = *s;
  177|    714|	val = "1";
  178|       |
  179|    714|	p = strchr(opt, ',');
  180|       |
  181|    714|	if (p != NULL) {
  ------------------
  |  Branch (181:6): [True: 476, False: 238]
  ------------------
  182|    476|		*p = '\0';
  183|    476|		end = ((const char *)p) + 1;
  184|    476|	}
  185|       |
  186|    714|	if (0 == strlen(opt)) {
  ------------------
  |  Branch (186:6): [True: 0, False: 714]
  ------------------
  187|      0|		*s = end;
  188|      0|		*m = NULL;
  189|      0|		*o = NULL;
  190|      0|		*v = NULL;
  191|      0|		return end;
  192|      0|	}
  193|       |
  194|    714|	p = strchr(opt, ':');
  195|    714|	if (p != NULL) {
  ------------------
  |  Branch (195:6): [True: 714, False: 0]
  ------------------
  196|    714|		*p = '\0';
  197|    714|		mod = opt;
  198|    714|		opt = ++p;
  199|    714|	}
  200|       |
  201|    714|	p = strchr(opt, '=');
  202|    714|	if (p != NULL) {
  ------------------
  |  Branch (202:6): [True: 0, False: 714]
  ------------------
  203|      0|		*p = '\0';
  204|      0|		val = ++p;
  205|    714|	} else if (opt[0] == '!') {
  ------------------
  |  Branch (205:13): [True: 0, False: 714]
  ------------------
  206|      0|		++opt;
  207|      0|		val = NULL;
  208|      0|	}
  209|       |
  210|    714|	*s = end;
  211|    714|	*m = mod;
  212|    714|	*o = opt;
  213|    714|	*v = val;
  214|       |
  215|    714|	return end;
  216|    714|}

pack_find:
  321|    887|{
  322|    887|	struct format	*format;
  323|       |
  324|    887|	format = bsearch(name, formats,
  325|    887|	    sizeof(formats)/sizeof(formats[0]),
  326|    887|	    sizeof(formats[0]), compare_format);
  327|    887|	if (format == 0)
  ------------------
  |  Branch (327:6): [True: 0, False: 887]
  ------------------
  328|      0|		return (NULL);
  329|    887|	return (format->pack);
  330|    887|}
archive_pack_dev.c:pack_8_8:
  168|    519|{
  169|    519|	dev_t dev = 0;
  170|       |
  171|    519|	if (n == 2) {
  ------------------
  |  Branch (171:6): [True: 324, False: 195]
  ------------------
  172|    324|		dev = makedev_8_8(numbers[0], numbers[1]);
  ------------------
  |  |  163|    324|#define	makedev_8_8(x,y)	((dev_t)((((x) << 8) & 0x0000ff00) | \
  |  |  164|    324|					 (((y) << 0) & 0x000000ff)))
  ------------------
  173|    324|		if ((unsigned long)major_8_8(dev) != numbers[0])
  ------------------
  |  |  161|    324|#define	major_8_8(x)		((int32_t)(((x) & 0x0000ff00) >> 8))
  ------------------
  |  Branch (173:7): [True: 103, False: 221]
  ------------------
  174|    103|			*error = iMajorError;
  175|    324|		if ((unsigned long)minor_8_8(dev) != numbers[1])
  ------------------
  |  |  162|    324|#define	minor_8_8(x)		((int32_t)(((x) & 0x000000ff) >> 0))
  ------------------
  |  Branch (175:7): [True: 0, False: 324]
  ------------------
  176|      0|			*error = iMinorError;
  177|    324|	} else
  178|    195|		*error = tooManyFields;
  179|    519|	return (dev);
  180|    519|}
archive_pack_dev.c:pack_8_24:
  234|     32|{
  235|     32|	dev_t dev = 0;
  236|       |
  237|     32|	if (n == 2) {
  ------------------
  |  Branch (237:6): [True: 32, False: 0]
  ------------------
  238|     32|		dev = makedev_8_24(numbers[0], numbers[1]);
  ------------------
  |  |  229|     32|#define	makedev_8_24(x,y)	((dev_t)((((x) << 24) & 0xff000000) | \
  |  |  230|     32|					 (((y) <<  0) & 0x00ffffff)))
  ------------------
  239|     32|		if ((unsigned long)major_8_24(dev) != numbers[0])
  ------------------
  |  |  227|     32|#define	major_8_24(x)		((int32_t)(((x) & 0xff000000) >> 24))
  ------------------
  |  Branch (239:7): [True: 32, False: 0]
  ------------------
  240|     32|			*error = iMajorError;
  241|     32|		if ((unsigned long)minor_8_24(dev) != numbers[1])
  ------------------
  |  |  228|     32|#define	minor_8_24(x)		((int32_t)(((x) & 0x00ffffff) >>  0))
  ------------------
  |  Branch (241:7): [True: 0, False: 32]
  ------------------
  242|      0|			*error = iMinorError;
  243|     32|	} else
  244|      0|		*error = tooManyFields;
  245|     32|	return (dev);
  246|     32|}
archive_pack_dev.c:compare_format:
  308|  3.47k|{
  309|  3.47k|	const char		*name;
  310|  3.47k|	const struct format	*format;
  311|       |
  312|  3.47k|	name = key;
  313|  3.47k|	format = element;
  314|       |
  315|  3.47k|	return (strcmp(name, format->name));
  316|  3.47k|}

archive_ppmd7.c:Ppmd7_Construct:
   88|      2|{
   89|      2|  unsigned i, k, m;
   90|       |
   91|      2|  p->Base = 0;
   92|       |
   93|     78|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|     78|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|     78|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|     78|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|     78|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|     78|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     78|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     78|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     78|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (93:22): [True: 76, False: 2]
  ------------------
   94|     76|  {
   95|     76|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (95:22): [True: 52, False: 24]
  ------------------
   96|    256|    do { p->Units2Indx[k++] = (Byte)i; } while(--step);
  ------------------
  |  Branch (96:48): [True: 180, False: 76]
  ------------------
   97|     76|    p->Indx2Units[i] = (Byte)k;
   98|     76|  }
   99|       |
  100|      2|  p->NS2BSIndx[0] = (0 << 1);
  101|      2|  p->NS2BSIndx[1] = (1 << 1);
  102|      2|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
  103|      2|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
  104|       |
  105|      8|  for (i = 0; i < 3; i++)
  ------------------
  |  Branch (105:15): [True: 6, False: 2]
  ------------------
  106|      6|    p->NS2Indx[i] = (Byte)i;
  107|    508|  for (m = i, k = 1; i < 256; i++)
  ------------------
  |  Branch (107:22): [True: 506, False: 2]
  ------------------
  108|    506|  {
  109|    506|    p->NS2Indx[i] = (Byte)m;
  110|    506|    if (--k == 0)
  ------------------
  |  Branch (110:9): [True: 44, False: 462]
  ------------------
  111|     44|      k = (++m) - 2;
  112|    506|  }
  113|       |
  114|      2|  memset(p->HB2Flag, 0, 0x40);
  115|      2|  memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);
  116|      2|}
archive_ppmd7.c:Ppmd7_Alloc:
  126|      2|{
  127|      2|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (127:7): [True: 2, False: 0]
  |  Branch (127:23): [True: 0, False: 0]
  ------------------
  128|      2|  {
  129|       |    /* RestartModel() below assumes that p->Size >= UNIT_SIZE
  130|       |       (see the calculation of m->MinContext). */
  131|      2|    if (size < UNIT_SIZE) {
  ------------------
  |  |   30|      2|#define UNIT_SIZE 12
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  133|      0|    }
  134|      2|    Ppmd7_Free(p);
  135|      2|    p->AlignOffset =
  136|       |      #ifdef PPMD_32BIT
  137|       |        (4 - size) & 3;
  138|       |      #else
  139|      2|        4 - (size & 3);
  140|      2|      #endif
  141|      2|    if ((p->Base = (Byte *)malloc(p->AlignOffset + size
  ------------------
  |  Branch (141:9): [True: 0, False: 2]
  ------------------
  142|      2|        #ifndef PPMD_32BIT
  143|      2|        + UNIT_SIZE
  ------------------
  |  |   30|      2|#define UNIT_SIZE 12
  ------------------
  144|      2|        #endif
  145|      2|        )) == 0)
  146|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  147|      2|    p->Size = size;
  148|      2|  }
  149|      2|  return True;
  ------------------
  |  |   55|      2|#define True 1
  ------------------
  150|      2|}
archive_ppmd7.c:Ppmd7_Free:
  119|    276|{
  120|    276|  free(p->Base);
  121|    276|  p->Size = 0;
  122|    276|  p->Base = 0;
  123|    276|}
archive_ppmd7.c:Ppmd7_Init:
  367|      1|{
  368|      1|  p->MaxOrder = maxOrder;
  369|      1|  RestartModel(p);
  370|      1|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|      1|#define PPMD_PERIOD_BITS 7
  ------------------
  371|      1|  p->DummySee.Summ = 0; /* unused */
  372|      1|  p->DummySee.Count = 64; /* unused */
  373|      1|}
archive_ppmd7.c:RestartModel:
  320|      1|{
  321|      1|  unsigned i, k, m;
  322|       |
  323|      1|  memset(p->FreeList, 0, sizeof(p->FreeList));
  324|      1|  p->Text = p->Base + p->AlignOffset;
  325|      1|  p->HiUnit = p->Text + p->Size;
  326|      1|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|      1|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|      1|#define UNIT_SIZE 12
  ------------------
  327|      1|  p->GlueCount = 0;
  328|       |
  329|      1|  p->OrderFall = p->MaxOrder;
  330|      1|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (330:39): [True: 0, False: 1]
  ------------------
  331|      1|  p->PrevSuccess = 0;
  332|       |
  333|      1|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   30|      1|#define UNIT_SIZE 12
  ------------------
  334|      1|  p->MinContext->Suffix = 0;
  335|      1|  p->MinContext->NumStats = 256;
  336|      1|  p->MinContext->SummFreq = 256 + 1;
  337|      1|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  338|      1|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   32|      1|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|      1|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  339|      1|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   39|      1|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  340|    257|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (340:15): [True: 256, False: 1]
  ------------------
  341|    256|  {
  342|    256|    CPpmd_State *s = &p->FoundState[i];
  343|    256|    s->Symbol = (Byte)i;
  344|    256|    s->Freq = 1;
  345|    256|    SetSuccessor(s, 0);
  346|    256|  }
  347|       |
  348|    129|  for (i = 0; i < 128; i++)
  ------------------
  |  Branch (348:15): [True: 128, False: 1]
  ------------------
  349|  1.15k|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (349:17): [True: 1.02k, False: 128]
  ------------------
  350|  1.02k|    {
  351|  1.02k|      UInt16 *dest = p->BinSumm[i] + k;
  352|  1.02k|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));
  ------------------
  |  |   91|  1.02k|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  1.02k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  1.02k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  353|  9.21k|      for (m = 0; m < 64; m += 8)
  ------------------
  |  Branch (353:19): [True: 8.19k, False: 1.02k]
  ------------------
  354|  8.19k|        dest[m] = val;
  355|  1.02k|    }
  356|       |  
  357|     26|  for (i = 0; i < 25; i++)
  ------------------
  |  Branch (357:15): [True: 25, False: 1]
  ------------------
  358|    425|    for (k = 0; k < 16; k++)
  ------------------
  |  Branch (358:17): [True: 400, False: 25]
  ------------------
  359|    400|    {
  360|    400|      CPpmd_See *s = &p->See[i][k];
  361|    400|      s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|    400|#define PPMD_PERIOD_BITS 7
  ------------------
  362|    400|      s->Count = 4;
  363|    400|    }
  364|      1|}
archive_ppmd7.c:SetSuccessor:
  314|    529|{
  315|    529|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  316|    529|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  317|    529|}
archive_ppmd7.c:Range_GetThreshold:
  771|  6.01k|{
  772|  6.01k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  773|  6.01k|  return (p->Code - p->Low) / (p->Range /= total);
  774|  6.01k|}
archive_ppmd7.c:Range_Normalize:
  777|  6.01k|{
  778|  6.02k|  while (1)
  ------------------
  |  Branch (778:10): [Folded - Ignored]
  ------------------
  779|  6.02k|  {
  780|  6.02k|    if((p->Low ^ (p->Low + p->Range)) >= kTopValue)
  ------------------
  |  |   28|  6.02k|#define kTopValue (1 << 24)
  ------------------
  |  Branch (780:8): [True: 6.01k, False: 5]
  ------------------
  781|  6.01k|    {
  782|  6.01k|      if(p->Range >= p->Bottom)
  ------------------
  |  Branch (782:10): [True: 6.01k, False: 0]
  ------------------
  783|  6.01k|        break;
  784|      0|      else
  785|      0|        p->Range = ((uint32_t)(-(int32_t)p->Low)) & (p->Bottom - 1);
  786|  6.01k|    }
  787|      5|    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
  788|      5|    p->Range <<= 8;
  789|      5|    p->Low <<= 8;
  790|      5|  }
  791|  6.01k|}
archive_ppmd7.c:PpmdRAR_RangeDec_CreateVTable:
  854|      2|{
  855|      2|  p->p.GetThreshold = Range_GetThreshold;
  856|      2|  p->p.Decode = Range_Decode_RAR;
  857|      2|  p->p.DecodeBit = Range_DecodeBit_RAR;
  858|      2|}
archive_ppmd7.c:Range_Decode_RAR:
  802|  6.01k|{
  803|  6.01k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  804|  6.01k|  p->Low += start * p->Range;
  805|  6.01k|  p->Range *= size;
  806|  6.01k|  Range_Normalize(p);
  807|  6.01k|}
archive_ppmd7.c:Range_DecodeBit_RAR:
  830|  6.00k|{
  831|  6.00k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  832|  6.00k|  UInt32 bit, value = p->p.GetThreshold(p, PPMD_BIN_SCALE);
  ------------------
  |  |   91|  6.00k|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  6.00k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  6.00k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  833|  6.00k|  if(value < size0)
  ------------------
  |  Branch (833:6): [True: 6.00k, False: 1]
  ------------------
  834|  6.00k|  {
  835|  6.00k|    bit = 0;
  836|  6.00k|    p->p.Decode(p, 0, size0);
  837|  6.00k|  }
  838|      1|  else
  839|      1|  {
  840|      1|    bit = 1;
  841|      1|    p->p.Decode(p, size0, PPMD_BIN_SCALE - size0);
  ------------------
  |  |   91|      1|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|      1|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|      1|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  842|      1|  }
  843|  6.00k|  return bit;
  844|  6.00k|}
archive_ppmd7.c:Ppmd_RangeDec_Init:
  746|  1.02k|{
  747|  1.02k|  unsigned i;
  748|  1.02k|  p->Low = p->Bottom = 0;
  749|  1.02k|  p->Range = 0xFFFFFFFF;
  750|  5.13k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (750:15): [True: 4.10k, False: 1.02k]
  ------------------
  751|  4.10k|    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
  752|  1.02k|  return (p->Code < 0xFFFFFFFF);
  753|  1.02k|}
archive_ppmd7.c:PpmdRAR_RangeDec_Init:
  763|  1.02k|{
  764|  1.02k|  if (!Ppmd_RangeDec_Init(p))
  ------------------
  |  Branch (764:7): [True: 1, False: 1.02k]
  ------------------
  765|      1|    return False;
  ------------------
  |  |   56|      1|#define False 0
  ------------------
  766|  1.02k|  p->Bottom = 0x8000;
  767|  1.02k|  return True;
  ------------------
  |  |   55|  1.02k|#define True 1
  ------------------
  768|  1.02k|}
archive_ppmd7.c:Ppmd7_DecodeSymbol:
  863|  6.01k|{
  864|  6.01k|  size_t charMask[256 / sizeof(size_t)];
  865|  6.01k|  if (p->MinContext->NumStats != 1)
  ------------------
  |  Branch (865:7): [True: 6, False: 6.00k]
  ------------------
  866|      6|  {
  867|      6|    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|      6|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|      6|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  868|      6|    unsigned i;
  869|      6|    UInt32 count, hiCnt;
  870|      6|    if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (870:9): [True: 5, False: 1]
  ------------------
  871|      5|    {
  872|      5|      Byte symbol;
  873|      5|      rc->Decode(rc, 0, s->Freq);
  874|      5|      p->FoundState = s;
  875|      5|      symbol = s->Symbol;
  876|      5|      Ppmd7_Update1_0(p);
  877|      5|      return symbol;
  878|      5|    }
  879|      1|    p->PrevSuccess = 0;
  880|      1|    i = p->MinContext->NumStats - 1;
  881|      1|    do
  882|      1|    {
  883|      1|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (883:11): [True: 1, False: 0]
  ------------------
  884|      1|      {
  885|      1|        Byte symbol;
  886|      1|        rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  887|      1|        p->FoundState = s;
  888|      1|        symbol = s->Symbol;
  889|      1|        Ppmd7_Update1(p);
  890|      1|        return symbol;
  891|      1|      }
  892|      1|    }
  893|      1|    while (--i);
  ------------------
  |  Branch (893:12): [True: 0, False: 0]
  ------------------
  894|      0|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (894:9): [True: 0, False: 0]
  ------------------
  895|      0|      return -2;
  896|      0|    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
  897|      0|    rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);
  898|      0|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  148|      0|  { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  149|      0|  p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }}
  ------------------
  899|      0|    MASK(s->Symbol) = 0;
  ------------------
  |  |  860|      0|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  900|      0|    i = p->MinContext->NumStats - 1;
  901|      0|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  |  860|      0|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (901:44): [True: 0, False: 0]
  ------------------
  902|      0|  }
  903|  6.00k|  else
  904|  6.00k|  {
  905|  6.00k|    UInt16 *prob = Ppmd7_GetBinSumm(p);
  ------------------
  |  |   22|  6.00k|    &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \
  |  |  ------------------
  |  |  |  |   42|  6.00k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   23|  6.00k|    p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \
  |  |  ------------------
  |  |  |  |   17|  6.00k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  6.00k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|  6.00k|    (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \
  |  |   25|  6.00k|    2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \
  |  |  ------------------
  |  |  |  |   42|  6.00k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   26|  6.00k|    ((p->RunLength >> 26) & 0x20)]
  ------------------
  906|  6.00k|    if (rc->DecodeBit(rc, *prob) == 0)
  ------------------
  |  Branch (906:9): [True: 6.00k, False: 1]
  ------------------
  907|  6.00k|    {
  908|  6.00k|      Byte symbol;
  909|  6.00k|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  6.00k|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  6.00k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  6.00k|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.00k|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  910|  6.00k|      symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   42|  6.00k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
  911|  6.00k|      Ppmd7_UpdateBin(p);
  912|  6.00k|      return symbol;
  913|  6.00k|    }
  914|      1|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|      1|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|      1|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      1|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  915|      1|    p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
  916|      1|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  148|      5|  { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 4, False: 1]
  |  |  ------------------
  |  |  149|      4|  p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }}
  ------------------
  917|      1|    MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  |  860|      1|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  918|      1|    p->PrevSuccess = 0;
  919|      1|  }
  920|      1|  for (;;)
  921|      1|  {
  922|      1|    CPpmd_State *ps[256], *s;
  923|      1|    UInt32 freqSum, count, hiCnt;
  924|      1|    CPpmd_See *see;
  925|      1|    unsigned i, num, numMasked = p->MinContext->NumStats;
  926|      1|    do
  927|     34|    {
  928|     34|      p->OrderFall++;
  929|     34|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (929:11): [True: 0, False: 34]
  ------------------
  930|      0|        return -1;
  931|     34|      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   17|     34|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   16|     34|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  932|     34|    }
  933|     34|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (933:12): [True: 33, False: 1]
  ------------------
  934|      1|    hiCnt = 0;
  935|      1|    s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|      1|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|      1|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  936|      1|    i = 0;
  937|      1|    num = p->MinContext->NumStats - numMasked;
  938|      1|    do
  939|    256|    {
  940|    256|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  |  860|    256|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  941|    256|      hiCnt += (s->Freq & k);
  942|    256|      ps[i] = s++;
  943|    256|      i -= k;
  944|    256|    }
  945|    256|    while (i != num);
  ------------------
  |  Branch (945:12): [True: 255, False: 1]
  ------------------
  946|       |
  947|      1|    see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);
  948|      1|    freqSum += hiCnt;
  949|      1|    count = rc->GetThreshold(rc, freqSum);
  950|       |
  951|      1|    if (count < hiCnt)
  ------------------
  |  Branch (951:9): [True: 1, False: 0]
  ------------------
  952|      1|    {
  953|      1|      Byte symbol;
  954|      1|      CPpmd_State **pps = ps;
  955|      2|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (955:23): [True: 1, False: 1]
  ------------------
  956|      1|      s = *pps;
  957|      1|      rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  958|      1|      Ppmd_See_Update(see);
  ------------------
  |  |  112|      1|#define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
  |  |  ------------------
  |  |  |  |   90|      2|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (112:33): [True: 0, False: 1]
  |  |  |  Branch (112:66): [True: 0, False: 0]
  |  |  ------------------
  |  |  113|      1|    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
  ------------------
  959|      1|      p->FoundState = s;
  960|      1|      symbol = s->Symbol;
  961|      1|      Ppmd7_Update2(p);
  962|      1|      return symbol;
  963|      1|    }
  964|      0|    if (count >= freqSum)
  ------------------
  |  Branch (964:9): [True: 0, False: 0]
  ------------------
  965|      0|      return -2;
  966|      0|    rc->Decode(rc, hiCnt, freqSum - hiCnt);
  967|      0|    see->Summ = (UInt16)(see->Summ + freqSum);
  968|      0|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  |  860|      0|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (968:46): [True: 0, False: 0]
  ------------------
  969|      0|  }
  970|      1|}
archive_ppmd7.c:Ppmd7_Update1_0:
  717|      5|{
  718|      5|  p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);
  719|      5|  p->RunLength += p->PrevSuccess;
  720|      5|  p->MinContext->SummFreq += 4;
  721|      5|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|      5|#define MAX_FREQ 124
  ------------------
  |  Branch (721:7): [True: 0, False: 5]
  ------------------
  722|      0|    Rescale(p);
  723|      5|  NextContext(p);
  724|      5|}
archive_ppmd7.c:NextContext:
  693|  6.01k|{
  694|  6.01k|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   44|  6.01k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|  6.01k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  6.01k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  6.01k|  if (p->OrderFall == 0 && (Byte *)c > p->Text)
  ------------------
  |  Branch (695:7): [True: 5.94k, False: 69]
  |  Branch (695:28): [True: 5.94k, False: 5]
  ------------------
  696|  5.94k|    p->MinContext = p->MaxContext = c;
  697|     74|  else
  698|     74|    UpdateModel(p);
  699|  6.01k|}
archive_ppmd7.c:UpdateModel:
  455|     75|{
  456|     75|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  311|     75|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  457|     75|  CTX_PTR c;
  458|     75|  unsigned s0, ns;
  459|       |  
  460|     75|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   29|     75|#define MAX_FREQ 124
  ------------------
  |  Branch (460:7): [True: 61, False: 14]
  |  Branch (460:45): [True: 57, False: 4]
  ------------------
  461|     57|  {
  462|     57|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   47|     57|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|     57|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|     57|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|     57|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|       |    
  464|     57|    if (c->NumStats == 1)
  ------------------
  |  Branch (464:9): [True: 53, False: 4]
  ------------------
  465|     53|    {
  466|     53|      CPpmd_State *s = ONE_STATE(c);
  ------------------
  |  |   46|     53|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|     53|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  467|     53|      if (s->Freq < 32)
  ------------------
  |  Branch (467:11): [True: 53, False: 0]
  ------------------
  468|     53|        s->Freq++;
  469|     53|    }
  470|      4|    else
  471|      4|    {
  472|      4|      CPpmd_State *s = STATS(c);
  ------------------
  |  |   45|      4|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|      4|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|      4|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|      4|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (473:11): [True: 1, False: 3]
  ------------------
  474|      1|      {
  475|      1|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (475:28): [True: 0, False: 1]
  ------------------
  476|      1|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (476:13): [True: 0, False: 1]
  ------------------
  477|      0|        {
  478|      0|          SwapStates(&s[0], &s[-1]);
  479|      0|          s--;
  480|      0|        }
  481|      1|      }
  482|      4|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   29|      4|#define MAX_FREQ 124
  ------------------
  |  Branch (482:11): [True: 4, False: 0]
  ------------------
  483|      4|      {
  484|      4|        s->Freq += 2;
  485|      4|        c->SummFreq += 2;
  486|      4|      }
  487|      4|    }
  488|     57|  }
  489|       |
  490|     75|  if (p->OrderFall == 0)
  ------------------
  |  Branch (490:7): [True: 5, False: 70]
  ------------------
  491|      5|  {
  492|      5|    p->MinContext = p->MaxContext = CreateSuccessors(p, True);
  ------------------
  |  |   55|      5|#define True 1
  ------------------
  493|      5|    if (p->MinContext == 0)
  ------------------
  |  Branch (493:9): [True: 0, False: 5]
  ------------------
  494|      0|    {
  495|      0|      RestartModel(p);
  496|      0|      return;
  497|      0|    }
  498|      5|    SetSuccessor(p->FoundState, REF(p->MinContext));
  ------------------
  |  |   39|      5|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  499|      5|    return;
  500|      5|  }
  501|       |  
  502|     70|  *p->Text++ = p->FoundState->Symbol;
  503|     70|  successor = REF(p->Text);
  ------------------
  |  |   39|     70|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  504|     70|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (504:7): [True: 0, False: 70]
  ------------------
  505|      0|  {
  506|      0|    RestartModel(p);
  507|      0|    return;
  508|      0|  }
  509|       |  
  510|     70|  if (fSuccessor)
  ------------------
  |  Branch (510:7): [True: 68, False: 2]
  ------------------
  511|     68|  {
  512|     68|    if (fSuccessor <= successor)
  ------------------
  |  Branch (512:9): [True: 65, False: 3]
  ------------------
  513|     65|    {
  514|     65|      CTX_PTR cs = CreateSuccessors(p, False);
  ------------------
  |  |   56|     65|#define False 0
  ------------------
  515|     65|      if (cs == NULL)
  ------------------
  |  Branch (515:11): [True: 0, False: 65]
  ------------------
  516|      0|      {
  517|      0|        RestartModel(p);
  518|      0|        return;
  519|      0|      }
  520|     65|      fSuccessor = REF(cs);
  ------------------
  |  |   39|     65|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  521|     65|    }
  522|     68|    if (--p->OrderFall == 0)
  ------------------
  |  Branch (522:9): [True: 2, False: 66]
  ------------------
  523|      2|    {
  524|      2|      successor = fSuccessor;
  525|      2|      p->Text -= (p->MaxContext != p->MinContext);
  526|      2|    }
  527|     68|  }
  528|      2|  else
  529|      2|  {
  530|      2|    SetSuccessor(p->FoundState, successor);
  531|      2|    fSuccessor = REF(p->MinContext);
  ------------------
  |  |   39|      2|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  532|      2|  }
  533|       |  
  534|     70|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);
  535|       |  
  536|    104|  for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   47|     34|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|     34|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|     34|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|     34|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (536:27): [True: 34, False: 70]
  ------------------
  537|     34|  {
  538|     34|    unsigned ns1;
  539|     34|    UInt32 cf, sf;
  540|     34|    if ((ns1 = c->NumStats) != 1)
  ------------------
  |  Branch (540:9): [True: 0, False: 34]
  ------------------
  541|      0|    {
  542|      0|      if ((ns1 & 1) == 0)
  ------------------
  |  Branch (542:11): [True: 0, False: 0]
  ------------------
  543|      0|      {
  544|       |        /* Expand for one UNIT */
  545|      0|        unsigned oldNU = ns1 >> 1;
  546|      0|        unsigned i = U2I(oldNU);
  ------------------
  |  |   33|      0|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  547|      0|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   33|      0|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  ------------------
  548|      0|        {
  549|      0|          void *ptr = AllocUnits(p, i + 1);
  550|      0|          void *oldPtr;
  551|      0|          if (!ptr)
  ------------------
  |  Branch (551:15): [True: 0, False: 0]
  ------------------
  552|      0|          {
  553|      0|            RestartModel(p);
  554|      0|            return;
  555|      0|          }
  556|      0|          oldPtr = STATS(c);
  ------------------
  |  |   45|      0|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|      0|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|      0|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  557|      0|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  291|      0|  { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
  |  |  292|      0|    do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
  |  |  ------------------
  |  |  |  Branch (292:73): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  558|      0|          InsertNode(p, oldPtr, i);
  559|      0|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   42|      0|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   39|      0|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  560|      0|        }
  561|      0|      }
  562|      0|      c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));
  563|      0|    }
  564|     34|    else
  565|     34|    {
  566|     34|      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
  567|     34|      if (!s)
  ------------------
  |  Branch (567:11): [True: 0, False: 34]
  ------------------
  568|      0|      {
  569|      0|        RestartModel(p);
  570|      0|        return;
  571|      0|      }
  572|     34|      *s = *ONE_STATE(c);
  ------------------
  |  |   46|     34|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|     34|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  573|     34|      c->Stats = REF(s);
  ------------------
  |  |   39|     34|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  574|     34|      if (s->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   29|     34|#define MAX_FREQ 124
  ------------------
  |  Branch (574:11): [True: 18, False: 16]
  ------------------
  575|     18|        s->Freq <<= 1;
  576|     16|      else
  577|     16|        s->Freq = MAX_FREQ - 4;
  ------------------
  |  |   29|     16|#define MAX_FREQ 124
  ------------------
  578|     34|      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));
  579|     34|    }
  580|     34|    cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);
  581|     34|    sf = (UInt32)s0 + c->SummFreq;
  582|     34|    if (cf < 6 * sf)
  ------------------
  |  Branch (582:9): [True: 0, False: 34]
  ------------------
  583|      0|    {
  584|      0|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  585|      0|      c->SummFreq += 3;
  586|      0|    }
  587|     34|    else
  588|     34|    {
  589|     34|      cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);
  590|     34|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  591|     34|    }
  592|     34|    {
  593|     34|      CPpmd_State *s = STATS(c) + ns1;
  ------------------
  |  |   45|     34|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|     34|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|     34|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|     34|      SetSuccessor(s, successor);
  595|     34|      s->Symbol = p->FoundState->Symbol;
  596|     34|      s->Freq = (Byte)cf;
  597|     34|      c->NumStats = (UInt16)(ns1 + 1);
  598|     34|    }
  599|     34|  }
  600|     70|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   44|     70|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|     70|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|     70|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|     70|}
archive_ppmd7.c:CreateSuccessors:
  376|     70|{
  377|     70|  CPpmd_State upState;
  378|     70|  CTX_PTR c = p->MinContext;
  379|     70|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  311|     70|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  380|     70|  CPpmd_State *ps[PPMD7_MAX_ORDER];
  381|     70|  unsigned numPs = 0;
  382|       |  
  383|     70|  if (!skip)
  ------------------
  |  Branch (383:7): [True: 65, False: 5]
  ------------------
  384|     65|    ps[numPs++] = p->FoundState;
  385|       |  
  386|    169|  while (c->Suffix)
  ------------------
  |  Branch (386:10): [True: 167, False: 2]
  ------------------
  387|    167|  {
  388|    167|    CPpmd_Void_Ref successor;
  389|    167|    CPpmd_State *s;
  390|    167|    c = SUFFIX(c);
  ------------------
  |  |   47|    167|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|    167|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|    167|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|    167|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  391|    167|    if (c->NumStats != 1)
  ------------------
  |  Branch (391:9): [True: 8, False: 159]
  ------------------
  392|      8|    {
  393|     13|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   45|      8|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|      8|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|      8|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (393:26): [True: 5, False: 8]
  ------------------
  394|      8|    }
  395|    159|    else
  396|    159|      s = ONE_STATE(c);
  ------------------
  |  |   46|    159|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|    159|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  397|    167|    successor = SUCCESSOR(s);
  ------------------
  |  |  311|    167|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  398|    167|    if (successor != upBranch)
  ------------------
  |  Branch (398:9): [True: 68, False: 99]
  ------------------
  399|     68|    {
  400|     68|      c = CTX(successor);
  ------------------
  |  |   44|     68|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|     68|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|     68|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|     68|      if (numPs == 0)
  ------------------
  |  Branch (401:11): [True: 2, False: 66]
  ------------------
  402|      2|        return c;
  403|     66|      break;
  404|     68|    }
  405|     99|    ps[numPs++] = s;
  406|     99|  }
  407|       |  
  408|     68|  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
  ------------------
  |  |   16|     68|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  409|     68|  SetSuccessor(&upState, upBranch + 1);
  410|       |  
  411|     68|  if (c->NumStats == 1)
  ------------------
  |  Branch (411:7): [True: 63, False: 5]
  ------------------
  412|     63|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   46|     63|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|     63|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  413|      5|  else
  414|      5|  {
  415|      5|    UInt32 cf, s0;
  416|      5|    CPpmd_State *s;
  417|      6|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   45|      5|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|      5|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|      5|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (417:24): [True: 1, False: 5]
  ------------------
  418|      5|    cf = s->Freq - 1;
  419|      5|    s0 = c->SummFreq - c->NumStats - cf;
  420|      5|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
  ------------------
  |  Branch (420:32): [True: 1, False: 4]
  ------------------
  421|      5|  }
  422|       |
  423|    232|  while (numPs != 0)
  ------------------
  |  Branch (423:10): [True: 164, False: 68]
  ------------------
  424|    164|  {
  425|       |    /* Create Child */
  426|    164|    CTX_PTR c1; /* = AllocContext(p); */
  427|    164|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (427:9): [True: 164, False: 0]
  ------------------
  428|    164|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   30|    164|#define UNIT_SIZE 12
  ------------------
  429|      0|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (429:14): [True: 0, False: 0]
  ------------------
  430|      0|      c1 = (CTX_PTR)RemoveNode(p, 0);
  431|      0|    else
  432|      0|    {
  433|      0|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  434|      0|      if (!c1)
  ------------------
  |  Branch (434:11): [True: 0, False: 0]
  ------------------
  435|      0|        return NULL;
  436|      0|    }
  437|    164|    c1->NumStats = 1;
  438|    164|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   46|    164|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|    164|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  439|    164|    c1->Suffix = REF(c);
  ------------------
  |  |   39|    164|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  440|    164|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   39|    164|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  441|    164|    c = c1;
  442|    164|  }
  443|       |  
  444|     68|  return c;
  445|     68|}
archive_ppmd7.c:AllocUnits:
  276|     34|{
  277|     34|  UInt32 numBytes;
  278|     34|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (278:7): [True: 0, False: 34]
  ------------------
  279|      0|    return RemoveNode(p, indx);
  280|     34|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   32|     34|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|     34|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  281|     34|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (281:7): [True: 34, False: 0]
  ------------------
  282|     34|  {
  283|     34|    void *retVal = p->LoUnit;
  284|     34|    p->LoUnit += numBytes;
  285|     34|    return retVal;
  286|     34|  }
  287|      0|  return AllocUnitsRare(p, indx);
  288|     34|}
archive_ppmd7.c:Ppmd7_Update1:
  702|      1|{
  703|      1|  CPpmd_State *s = p->FoundState;
  704|      1|  s->Freq += 4;
  705|      1|  p->MinContext->SummFreq += 4;
  706|      1|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (706:7): [True: 0, False: 1]
  ------------------
  707|      0|  {
  708|      0|    SwapStates(&s[0], &s[-1]);
  709|      0|    p->FoundState = --s;
  710|      0|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   29|      0|#define MAX_FREQ 124
  ------------------
  |  Branch (710:9): [True: 0, False: 0]
  ------------------
  711|      0|      Rescale(p);
  712|      0|  }
  713|      1|  NextContext(p);
  714|      1|}
archive_ppmd7.c:Ppmd7_UpdateBin:
  727|  6.00k|{
  728|  6.00k|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
  ------------------
  |  Branch (728:55): [True: 610, False: 5.39k]
  ------------------
  729|  6.00k|  p->PrevSuccess = 1;
  730|  6.00k|  p->RunLength++;
  731|  6.00k|  NextContext(p);
  732|  6.00k|}
archive_ppmd7.c:Ppmd7_MakeEscFreq:
  668|      1|{
  669|      1|  CPpmd_See *see;
  670|      1|  unsigned nonMasked = p->MinContext->NumStats - numMasked;
  671|      1|  if (p->MinContext->NumStats != 256)
  ------------------
  |  Branch (671:7): [True: 0, False: 1]
  ------------------
  672|      0|  {
  673|      0|    see = p->See[p->NS2Indx[nonMasked - 1]] +
  674|      0|        (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +
  ------------------
  |  |   47|      0|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|      0|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|      0|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|      0|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  675|      0|        2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +
  676|      0|        4 * (numMasked > nonMasked) +
  677|      0|        p->HiBitsFlag;
  678|      0|    {
  679|      0|      unsigned r = (see->Summ >> see->Shift);
  680|      0|      see->Summ = (UInt16)(see->Summ - r);
  681|      0|      *escFreq = r + (r == 0);
  682|      0|    }
  683|      0|  }
  684|      1|  else
  685|      1|  {
  686|      1|    see = &p->DummySee;
  687|      1|    *escFreq = 1;
  688|      1|  }
  689|      1|  return see;
  690|      1|}
archive_ppmd7.c:Ppmd7_Update2:
  735|      1|{
  736|      1|  p->MinContext->SummFreq += 4;
  737|      1|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|      1|#define MAX_FREQ 124
  ------------------
  |  Branch (737:7): [True: 0, False: 1]
  ------------------
  738|      0|    Rescale(p);
  739|      1|  p->RunLength = p->InitRL;
  740|      1|  UpdateModel(p);
  741|      1|}

Ppmd8_Construct:
   65|  16.0k|{
   66|  16.0k|  unsigned i, k, m;
   67|       |
   68|  16.0k|  p->Base = 0;
   69|       |
   70|   624k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   624k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   624k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   624k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   624k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   624k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   624k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   624k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   624k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 608k, False: 16.0k]
  ------------------
   71|   608k|  {
   72|   608k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 416k, False: 192k]
  ------------------
   73|  2.04M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.44M, False: 608k]
  ------------------
   74|   608k|    p->Indx2Units[i] = (Byte)k;
   75|   608k|  }
   76|       |
   77|  16.0k|  p->NS2BSIndx[0] = (0 << 1);
   78|  16.0k|  p->NS2BSIndx[1] = (1 << 1);
   79|  16.0k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  16.0k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  96.0k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 80.0k, False: 16.0k]
  ------------------
   83|  80.0k|    p->NS2Indx[i] = (Byte)i;
   84|  4.09M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 4.08M, False: 16.0k]
  ------------------
   85|  4.08M|  {
   86|  4.08M|    p->NS2Indx[i] = (Byte)m;
   87|  4.08M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 352k, False: 3.73M]
  ------------------
   88|   352k|      k = (++m) - 4;
   89|  4.08M|  }
   90|  16.0k|}
Ppmd8_Free:
   93|  22.1k|{
   94|  22.1k|  free(p->Base);
   95|  22.1k|  p->Size = 0;
   96|  22.1k|  p->Base = 0;
   97|  22.1k|}
Ppmd8_Alloc:
  100|  11.0k|{
  101|  11.0k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 11.0k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  11.0k|  {
  103|  11.0k|    Ppmd8_Free(p);
  104|  11.0k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  11.0k|        4 - (size & 3);
  109|  11.0k|      #endif
  110|  11.0k|    if ((p->Base = (Byte *)malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 11.0k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  11.0k|    p->Size = size;
  113|  11.0k|  }
  114|  11.0k|  return True;
  ------------------
  |  |   55|  11.0k|#define True 1
  ------------------
  115|  11.0k|}
Ppmd8_Init:
  404|  11.0k|{
  405|  11.0k|  p->MaxOrder = maxOrder;
  406|  11.0k|  p->RestoreMethod = restoreMethod;
  407|  11.0k|  RestartModel(p);
  408|  11.0k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  11.0k|#define PPMD_PERIOD_BITS 7
  ------------------
  409|  11.0k|  p->DummySee.Summ = 0; /* unused */
  410|  11.0k|  p->DummySee.Count = 64; /* unused */
  411|  11.0k|}
Ppmd8_MakeEscFreq:
 1039|  14.1M|{
 1040|  14.1M|  CPpmd_See *see;
 1041|  14.1M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1041:7): [True: 10.5M, False: 3.58M]
  ------------------
 1042|  10.5M|  {
 1043|  10.5M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1044|  10.5M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1045|  10.5M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1046|  10.5M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  10.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  10.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  10.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  10.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1047|  10.5M|        p->MinContext->Flags;
 1048|  10.5M|    {
 1049|  10.5M|      unsigned r = (see->Summ >> see->Shift);
 1050|  10.5M|      see->Summ = (UInt16)(see->Summ - r);
 1051|  10.5M|      *escFreq = r + (r == 0);
 1052|  10.5M|    }
 1053|  10.5M|  }
 1054|  3.58M|  else
 1055|  3.58M|  {
 1056|  3.58M|    see = &p->DummySee;
 1057|  3.58M|    *escFreq = 1;
 1058|  3.58M|  }
 1059|  14.1M|  return see;
 1060|  14.1M|}
Ppmd8_Update1:
 1075|  5.17M|{
 1076|  5.17M|  CPpmd_State *s = p->FoundState;
 1077|  5.17M|  s->Freq += 4;
 1078|  5.17M|  p->MinContext->SummFreq += 4;
 1079|  5.17M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1079:7): [True: 3.60M, False: 1.56M]
  ------------------
 1080|  3.60M|  {
 1081|  3.60M|    SwapStates(&s[0], &s[-1]);
 1082|  3.60M|    p->FoundState = --s;
 1083|  3.60M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.60M|#define MAX_FREQ 124
  ------------------
  |  Branch (1083:9): [True: 800, False: 3.60M]
  ------------------
 1084|    800|      Rescale(p);
 1085|  3.60M|  }
 1086|  5.17M|  NextContext(p);
 1087|  5.17M|}
Ppmd8_Update1_0:
 1090|  5.87M|{
 1091|  5.87M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1092|  5.87M|  p->RunLength += p->PrevSuccess;
 1093|  5.87M|  p->MinContext->SummFreq += 4;
 1094|  5.87M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  5.87M|#define MAX_FREQ 124
  ------------------
  |  Branch (1094:7): [True: 124k, False: 5.75M]
  ------------------
 1095|   124k|    Rescale(p);
 1096|  5.87M|  NextContext(p);
 1097|  5.87M|}
Ppmd8_UpdateBin:
 1100|  20.0M|{
 1101|  20.0M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1102|  20.0M|  p->PrevSuccess = 1;
 1103|  20.0M|  p->RunLength++;
 1104|  20.0M|  NextContext(p);
 1105|  20.0M|}
Ppmd8_Update2:
 1108|  9.33M|{
 1109|  9.33M|  p->MinContext->SummFreq += 4;
 1110|  9.33M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  9.33M|#define MAX_FREQ 124
  ------------------
  |  Branch (1110:7): [True: 17.3k, False: 9.31M]
  ------------------
 1111|  17.3k|    Rescale(p);
 1112|  9.33M|  p->RunLength = p->InitRL;
 1113|  9.33M|  UpdateModel(p);
 1114|  9.33M|  p->MinContext = p->MaxContext;
 1115|  9.33M|}
Ppmd8_RangeDec_Init:
 1124|  11.0k|{
 1125|  11.0k|  unsigned i;
 1126|  11.0k|  p->Low = 0;
 1127|  11.0k|  p->Range = 0xFFFFFFFF;
 1128|  11.0k|  p->Code = 0;
 1129|  55.2k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1129:15): [True: 44.2k, False: 11.0k]
  ------------------
 1130|  44.2k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1131|  11.0k|  return (p->Code < 0xFFFFFFFF);
 1132|  11.0k|}
Ppmd8_DecodeSymbol:
 1158|  40.4M|{
 1159|  40.4M|  size_t charMask[256 / sizeof(size_t)];
 1160|  40.4M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1160:7): [True: 15.3M, False: 25.0M]
  ------------------
 1161|  15.3M|  {
 1162|  15.3M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |  104|  15.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |  102|  15.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1163|  15.3M|    unsigned i;
 1164|  15.3M|    UInt32 count, hiCnt;
 1165|  15.3M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1165:9): [True: 5.87M, False: 9.51M]
  ------------------
 1166|  5.87M|    {
 1167|  5.87M|      Byte symbol;
 1168|  5.87M|      RangeDec_Decode(p, 0, s->Freq);
 1169|  5.87M|      p->FoundState = s;
 1170|  5.87M|      symbol = s->Symbol;
 1171|  5.87M|      Ppmd8_Update1_0(p);
 1172|  5.87M|      return symbol;
 1173|  5.87M|    }
 1174|  9.51M|    p->PrevSuccess = 0;
 1175|  9.51M|    i = p->MinContext->NumStats;
 1176|  9.51M|    do
 1177|   132M|    {
 1178|   132M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1178:11): [True: 5.17M, False: 127M]
  ------------------
 1179|  5.17M|      {
 1180|  5.17M|        Byte symbol;
 1181|  5.17M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1182|  5.17M|        p->FoundState = s;
 1183|  5.17M|        symbol = s->Symbol;
 1184|  5.17M|        Ppmd8_Update1(p);
 1185|  5.17M|        return symbol;
 1186|  5.17M|      }
 1187|   132M|    }
 1188|   127M|    while (--i);
  ------------------
  |  Branch (1188:12): [True: 123M, False: 4.34M]
  ------------------
 1189|  4.34M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1189:9): [True: 2.13k, False: 4.34M]
  ------------------
 1190|  2.13k|      return -2;
 1191|  4.34M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1192|  4.34M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  148|  21.7M|  { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 17.3M, False: 4.34M]
  |  |  ------------------
  |  |  149|  17.3M|  p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }}
  ------------------
 1193|  4.34M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1155|  4.34M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1194|  4.34M|    i = p->MinContext->NumStats;
 1195|  16.3M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1155|  16.3M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1195:44): [True: 11.9M, False: 4.34M]
  ------------------
 1196|  4.34M|  }
 1197|  25.0M|  else
 1198|  25.0M|  {
 1199|  25.0M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  113|  25.0M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  25.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  114|  25.0M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |  103|  25.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  25.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|  25.0M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1200|  25.0M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1200:9): [True: 20.0M, False: 4.99M]
  ------------------
 1201|  20.0M|    {
 1202|  20.0M|      Byte symbol;
 1203|  20.0M|      RangeDec_Decode(p, 0, *prob);
 1204|  20.0M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  20.0M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  20.0M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  20.0M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  20.0M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1205|  20.0M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  20.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1206|  20.0M|      Ppmd8_UpdateBin(p);
 1207|  20.0M|      return symbol;
 1208|  20.0M|    }
 1209|  4.99M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1210|  4.99M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  4.99M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  4.99M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  4.99M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1211|  4.99M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1212|  4.99M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  148|  24.9M|  { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 19.9M, False: 4.99M]
  |  |  ------------------
  |  |  149|  19.9M|  p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }}
  ------------------
 1213|  4.99M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1155|  4.99M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1214|  4.99M|    p->PrevSuccess = 0;
 1215|  4.99M|  }
 1216|  9.34M|  for (;;)
 1217|  14.1M|  {
 1218|  14.1M|    CPpmd_State *ps[256], *s;
 1219|  14.1M|    UInt32 freqSum, count, hiCnt;
 1220|  14.1M|    CPpmd_See *see;
 1221|  14.1M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1222|  14.1M|    do
 1223|  24.9M|    {
 1224|  24.9M|      p->OrderFall++;
 1225|  24.9M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1225:11): [True: 1.10k, False: 24.9M]
  ------------------
 1226|  1.10k|        return -1;
 1227|  24.9M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |  103|  24.9M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |  102|  24.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1228|  24.9M|    }
 1229|  24.9M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1229:12): [True: 10.7M, False: 14.1M]
  ------------------
 1230|  14.1M|    hiCnt = 0;
 1231|  14.1M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |  104|  14.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |  102|  14.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1232|  14.1M|    i = 0;
 1233|  14.1M|    num = p->MinContext->NumStats - numMasked;
 1234|  14.1M|    do
 1235|  1.03G|    {
 1236|  1.03G|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1155|  1.03G|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1237|  1.03G|      hiCnt += (s->Freq & k);
 1238|  1.03G|      ps[i] = s++;
 1239|  1.03G|      i -= k;
 1240|  1.03G|    }
 1241|  1.03G|    while (i != num);
  ------------------
  |  Branch (1241:12): [True: 1.02G, False: 14.1M]
  ------------------
 1242|       |    
 1243|  14.1M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1244|  14.1M|    freqSum += hiCnt;
 1245|  14.1M|    count = RangeDec_GetThreshold(p, freqSum);
 1246|       |    
 1247|  14.1M|    if (count < hiCnt)
  ------------------
  |  Branch (1247:9): [True: 9.33M, False: 4.82M]
  ------------------
 1248|  9.33M|    {
 1249|  9.33M|      Byte symbol;
 1250|  9.33M|      CPpmd_State **pps = ps;
 1251|   324M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1251:23): [True: 315M, False: 9.33M]
  ------------------
 1252|  9.33M|      s = *pps;
 1253|  9.33M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1254|  9.33M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  9.33M|#define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
  |  |  ------------------
  |  |  |  |   90|  18.6M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (112:33): [True: 4.46M, False: 4.86M]
  |  |  |  Branch (112:66): [True: 142k, False: 4.32M]
  |  |  ------------------
  |  |  113|  9.33M|    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
  ------------------
 1255|  9.33M|      p->FoundState = s;
 1256|  9.33M|      symbol = s->Symbol;
 1257|  9.33M|      Ppmd8_Update2(p);
 1258|  9.33M|      return symbol;
 1259|  9.33M|    }
 1260|  4.82M|    if (count >= freqSum)
  ------------------
  |  Branch (1260:9): [True: 7.80k, False: 4.81M]
  ------------------
 1261|  7.80k|      return -2;
 1262|  4.81M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1263|  4.81M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1264|  21.4M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1155|  21.4M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1264:46): [True: 16.6M, False: 4.81M]
  ------------------
 1265|  4.81M|  }
 1266|  9.34M|}
archive_ppmd8.c:RestartModel:
  347|  11.3k|{
  348|  11.3k|  unsigned i, k, m, r;
  349|       |
  350|  11.3k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  351|  11.3k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  352|  11.3k|  RESET_TEXT(0);
  ------------------
  |  |  344|  11.3k|#define RESET_TEXT(offs) { p->Text = p->Base + p->AlignOffset + (offs); }
  ------------------
  353|  11.3k|  p->HiUnit = p->Text + p->Size;
  354|  11.3k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
  355|  11.3k|  p->GlueCount = 0;
  356|       |
  357|  11.3k|  p->OrderFall = p->MaxOrder;
  358|  11.3k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (358:39): [True: 11.0k, False: 254]
  ------------------
  359|  11.3k|  p->PrevSuccess = 0;
  360|       |
  361|  11.3k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
  362|  11.3k|  p->MinContext->Suffix = 0;
  363|  11.3k|  p->MinContext->NumStats = 255;
  364|  11.3k|  p->MinContext->Flags = 0;
  365|  11.3k|  p->MinContext->SummFreq = 256 + 1;
  366|  11.3k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  367|  11.3k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  11.3k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  11.3k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  368|  11.3k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  11.3k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  369|  2.91M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (369:15): [True: 2.90M, False: 11.3k]
  ------------------
  370|  2.90M|  {
  371|  2.90M|    CPpmd_State *s = &p->FoundState[i];
  372|  2.90M|    s->Symbol = (Byte)i;
  373|  2.90M|    s->Freq = 1;
  374|  2.90M|    SetSuccessor(s, 0);
  375|  2.90M|  }
  376|       |
  377|   294k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (377:19): [True: 283k, False: 11.3k]
  ------------------
  378|   283k|  {
  379|  2.72M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (379:12): [True: 2.43M, False: 283k]
  ------------------
  380|  2.43M|      i++;
  381|  2.55M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (381:17): [True: 2.26M, False: 283k]
  ------------------
  382|  2.26M|    {
  383|  2.26M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.26M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.26M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.26M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  384|  2.26M|      UInt16 *dest = p->BinSumm[m] + k;
  385|  20.4M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (385:19): [True: 18.1M, False: 2.26M]
  ------------------
  386|  18.1M|        dest[r] = val;
  387|  2.26M|    }
  388|   283k|  }
  389|       |
  390|   283k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (390:19): [True: 272k, False: 11.3k]
  ------------------
  391|   272k|  {
  392|  3.16M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (392:12): [True: 2.89M, False: 272k]
  ------------------
  393|  2.89M|      i++;
  394|  8.97M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (394:17): [True: 8.70M, False: 272k]
  ------------------
  395|  8.70M|    {
  396|  8.70M|      CPpmd_See *s = &p->See[m][k];
  397|  8.70M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.70M|#define PPMD_PERIOD_BITS 7
  ------------------
  398|  8.70M|      s->Count = 7;
  399|  8.70M|    }
  400|   272k|  }
  401|  11.3k|}
archive_ppmd8.c:SetSuccessor:
  339|  75.4M|{
  340|  75.4M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  341|  75.4M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  342|  75.4M|}
archive_ppmd8.c:SwapStates:
  437|  8.20M|{
  438|  8.20M|  CPpmd_State tmp = *t1;
  439|  8.20M|  *t1 = *t2;
  440|  8.20M|  *t2 = tmp;
  441|  8.20M|}
archive_ppmd8.c:Rescale:
  968|   142k|{
  969|   142k|  unsigned i, adder, sumFreq, escFreq;
  970|   142k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|   142k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|   142k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   142k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  971|   142k|  CPpmd_State *s = p->FoundState;
  972|   142k|  {
  973|   142k|    CPpmd_State tmp = *s;
  974|   223k|    for (; s != stats; s--)
  ------------------
  |  Branch (974:12): [True: 81.5k, False: 142k]
  ------------------
  975|  81.5k|      s[0] = s[-1];
  976|   142k|    *s = tmp;
  977|   142k|  }
  978|   142k|  escFreq = p->MinContext->SummFreq - s->Freq;
  979|   142k|  s->Freq += 4;
  980|   142k|  adder = (p->OrderFall != 0
  981|       |      #ifdef PPMD8_FREEZE_SUPPORT
  982|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  983|       |      #endif
  984|   142k|      );
  985|   142k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  986|   142k|  sumFreq = s->Freq;
  987|       |  
  988|   142k|  i = p->MinContext->NumStats;
  989|   142k|  do
  990|  2.96M|  {
  991|  2.96M|    escFreq -= (++s)->Freq;
  992|  2.96M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  2.96M|    sumFreq += s->Freq;
  994|  2.96M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (994:9): [True: 1.11M, False: 1.84M]
  ------------------
  995|  1.11M|    {
  996|  1.11M|      CPpmd_State *s1 = s;
  997|  1.11M|      CPpmd_State tmp = *s1;
  998|  1.11M|      do
  999|  59.1M|        s1[0] = s1[-1];
 1000|  59.1M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1000:14): [True: 59.1M, False: 0]
  |  Branch (1000:31): [True: 58.0M, False: 1.11M]
  ------------------
 1001|  1.11M|      *s1 = tmp;
 1002|  1.11M|    }
 1003|  2.96M|  }
 1004|  2.96M|  while (--i);
  ------------------
  |  Branch (1004:10): [True: 2.82M, False: 142k]
  ------------------
 1005|       |  
 1006|   142k|  if (s->Freq == 0)
  ------------------
  |  Branch (1006:7): [True: 26.9k, False: 115k]
  ------------------
 1007|  26.9k|  {
 1008|  26.9k|    unsigned numStats = p->MinContext->NumStats;
 1009|  26.9k|    unsigned n0, n1;
 1010|  29.4k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1010:24): [True: 2.50k, False: 26.9k]
  ------------------
 1011|  26.9k|    escFreq += i;
 1012|  26.9k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1013|  26.9k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1013:9): [True: 19.2k, False: 7.66k]
  ------------------
 1014|  19.2k|    {
 1015|  19.2k|      CPpmd_State tmp = *stats;
 1016|  19.2k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1017|  19.2k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  19.2k|#define MAX_FREQ 124
  ------------------
  |  Branch (1017:11): [True: 15.0k, False: 4.16k]
  ------------------
 1018|  15.0k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  15.0k|#define MAX_FREQ 124
  ------------------
 1019|  19.2k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  19.2k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1020|  19.2k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1021|  19.2k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  19.2k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  19.2k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1022|  19.2k|      return;
 1023|  19.2k|    }
 1024|  7.66k|    n0 = (numStats + 2) >> 1;
 1025|  7.66k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1026|  7.66k|    if (n0 != n1)
  ------------------
  |  Branch (1026:9): [True: 6.75k, False: 904]
  ------------------
 1027|  6.75k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  6.75k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  6.75k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1028|  7.66k|    p->MinContext->Flags &= ~0x08;
 1029|  7.66k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  7.66k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  7.66k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  7.66k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1030|  7.66k|    i = p->MinContext->NumStats;
 1031|  9.49k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1031:73): [True: 1.83k, False: 7.66k]
  ------------------
 1032|  7.66k|  }
 1033|   123k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1034|   123k|  p->MinContext->Flags |= 0x4;
 1035|   123k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|   123k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|   123k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   123k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|   123k|}
archive_ppmd8.c:InsertNode:
  118|  7.81M|{
  119|  7.81M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  7.81M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  7.81M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  7.81M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  7.81M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  7.81M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  7.81M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  7.81M|  p->Stamps[indx]++;
  124|  7.81M|}
archive_ppmd8.c:ShrinkUnits:
  250|  7.07k|{
  251|  7.07k|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  7.07k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  252|  7.07k|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  7.07k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  253|  7.07k|  if (i0 == i1)
  ------------------
  |  Branch (253:7): [True: 238, False: 6.83k]
  ------------------
  254|    238|    return oldPtr;
  255|  6.83k|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (255:7): [True: 1.56k, False: 5.27k]
  ------------------
  256|  1.56k|  {
  257|  1.56k|    void *ptr = RemoveNode(p, i1);
  258|  1.56k|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  246|  1.56k|  { UInt32 *d = (UInt32 *)dest; const UInt32 *z = (const UInt32 *)src; UInt32 n = num; \
  |  |  247|  1.66k|    do { d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3; } while (--n); }
  |  |  ------------------
  |  |  |  Branch (247:74): [True: 107, False: 1.56k]
  |  |  ------------------
  ------------------
  259|  1.56k|    InsertNode(p, oldPtr, i0);
  260|  1.56k|    return ptr;
  261|  1.56k|  }
  262|  5.27k|  SplitBlock(p, oldPtr, i0, i1);
  263|  5.27k|  return oldPtr;
  264|  6.83k|}
archive_ppmd8.c:RemoveNode:
  127|  7.72M|{
  128|  7.72M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  7.72M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  7.72M|  p->FreeList[indx] = node->Next;
  130|  7.72M|  p->Stamps[indx]--;
  131|  7.72M|  return node;
  132|  7.72M|}
archive_ppmd8.c:SplitBlock:
  135|   242k|{
  136|   242k|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|   242k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|   242k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|   242k|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|   242k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   242k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|   242k|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|   242k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 34.9k, False: 207k]
  ------------------
  139|  34.9k|  {
  140|  34.9k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|  34.9k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|  34.9k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|  34.9k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  34.9k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|  34.9k|  }
  143|   242k|  InsertNode(p, ptr, i);
  144|   242k|}
archive_ppmd8.c:NextContext:
 1063|  31.1M|{
 1064|  31.1M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  31.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |  103|  31.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  31.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1065|  31.1M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1065:7): [True: 14.5M, False: 16.5M]
  |  Branch (1065:28): [True: 10.3M, False: 4.17M]
  ------------------
 1066|  10.3M|    p->MinContext = p->MaxContext = c;
 1067|  20.7M|  else
 1068|  20.7M|  {
 1069|  20.7M|    UpdateModel(p);
 1070|  20.7M|    p->MinContext = p->MaxContext;
 1071|  20.7M|  }
 1072|  31.1M|}
archive_ppmd8.c:UpdateModel:
  799|  30.0M|{
  800|  30.0M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  336|  30.0M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  801|  30.0M|  CTX_PTR c;
  802|  30.0M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  803|  30.0M|  Byte flag, fSymbol = p->FoundState->Symbol;
  804|  30.0M|  CPpmd_State *s = NULL;
  805|       |  
  806|  30.0M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  30.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (806:7): [True: 26.4M, False: 3.61M]
  |  Branch (806:45): [True: 23.3M, False: 3.11M]
  ------------------
  807|  23.3M|  {
  808|  23.3M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  23.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  23.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  23.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  23.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|       |    
  810|  23.3M|    if (c->NumStats == 0)
  ------------------
  |  Branch (810:9): [True: 9.42M, False: 13.9M]
  ------------------
  811|  9.42M|    {
  812|  9.42M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  9.42M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  9.42M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  813|  9.42M|      if (s->Freq < 32)
  ------------------
  |  Branch (813:11): [True: 9.41M, False: 755]
  ------------------
  814|  9.41M|        s->Freq++;
  815|  9.42M|    }
  816|  13.9M|    else
  817|  13.9M|    {
  818|  13.9M|      s = STATS(c);
  ------------------
  |  |   30|  13.9M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  13.9M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  13.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  819|  13.9M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (819:11): [True: 9.36M, False: 4.57M]
  ------------------
  820|  9.36M|      {
  821|   240M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (821:28): [True: 231M, False: 9.36M]
  ------------------
  822|  9.36M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (822:13): [True: 4.60M, False: 4.76M]
  ------------------
  823|  4.60M|        {
  824|  4.60M|          SwapStates(&s[0], &s[-1]);
  825|  4.60M|          s--;
  826|  4.60M|        }
  827|  9.36M|      }
  828|  13.9M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  13.9M|#define MAX_FREQ 124
  ------------------
  |  Branch (828:11): [True: 13.7M, False: 163k]
  ------------------
  829|  13.7M|      {
  830|  13.7M|        s->Freq += 2;
  831|  13.7M|        c->SummFreq += 2;
  832|  13.7M|      }
  833|  13.9M|    }
  834|  23.3M|  }
  835|       |  
  836|  30.0M|  c = p->MaxContext;
  837|  30.0M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (837:7): [True: 4.17M, False: 25.9M]
  |  Branch (837:28): [True: 4.17M, False: 0]
  ------------------
  838|  4.17M|  {
  839|  4.17M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  4.17M|#define True 1
  ------------------
  840|  4.17M|    if (cs == 0)
  ------------------
  |  Branch (840:9): [True: 4, False: 4.17M]
  ------------------
  841|      4|    {
  842|      4|      SetSuccessor(p->FoundState, 0);
  843|      4|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  547|      4|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  844|      4|    }
  845|  4.17M|    else
  846|  4.17M|    {
  847|  4.17M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  4.17M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  848|  4.17M|      p->MaxContext = cs;
  849|  4.17M|    }
  850|  4.17M|    return;
  851|  4.17M|  }
  852|       |  
  853|  25.9M|  *p->Text++ = p->FoundState->Symbol;
  854|  25.9M|  successor = REF(p->Text);
  ------------------
  |  |   24|  25.9M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  25.9M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (855:7): [True: 29, False: 25.9M]
  ------------------
  856|     29|  {
  857|     29|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  547|     29|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  858|     29|    return;
  859|     29|  }
  860|       |  
  861|  25.9M|  if (!fSuccessor)
  ------------------
  |  Branch (861:7): [True: 961k, False: 24.9M]
  ------------------
  862|   961k|  {
  863|   961k|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  864|   961k|    if (cs == NULL)
  ------------------
  |  Branch (864:9): [True: 0, False: 961k]
  ------------------
  865|      0|    {
  866|      0|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  547|      0|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  867|      0|      return;
  868|      0|    }
  869|   961k|    fSuccessor = REF(cs);
  ------------------
  |  |   24|   961k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  870|   961k|  }
  871|  24.9M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |  102|  24.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (871:12): [True: 8.33M, False: 16.6M]
  ------------------
  872|  8.33M|  {
  873|  8.33M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  8.33M|#define False 0
  ------------------
  874|  8.33M|    if (cs == NULL)
  ------------------
  |  Branch (874:9): [True: 30, False: 8.33M]
  ------------------
  875|     30|    {
  876|     30|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  547|     30|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  877|     30|      return;
  878|     30|    }
  879|  8.33M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  8.33M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  880|  8.33M|  }
  881|       |  
  882|  25.9M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (882:7): [True: 1.73M, False: 24.1M]
  ------------------
  883|  1.73M|  {
  884|  1.73M|    successor = fSuccessor;
  885|  1.73M|    p->Text -= (p->MaxContext != p->MinContext);
  886|  1.73M|  }
  887|       |  #ifdef PPMD8_FREEZE_SUPPORT
  888|       |  else if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  889|       |  {
  890|       |    successor = fSuccessor;
  891|       |    RESET_TEXT(0);
  892|       |    p->OrderFall = 0;
  893|       |  }
  894|       |  #endif
  895|       |  
  896|  25.9M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  897|  25.9M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  898|       |  
  899|  50.8M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  24.9M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  24.9M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  24.9M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  24.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (899:10): [True: 24.9M, False: 25.9M]
  ------------------
  900|  24.9M|  {
  901|  24.9M|    unsigned ns1;
  902|  24.9M|    UInt32 cf, sf;
  903|  24.9M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (903:9): [True: 13.1M, False: 11.7M]
  ------------------
  904|  13.1M|    {
  905|  13.1M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (905:11): [True: 8.06M, False: 5.08M]
  ------------------
  906|  8.06M|      {
  907|       |        /* Expand for one UNIT */
  908|  8.06M|        unsigned oldNU = (ns1 + 1) >> 1;
  909|  8.06M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  8.06M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  910|  8.06M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  8.06M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (910:13): [True: 7.50M, False: 560k]
  ------------------
  911|  7.50M|        {
  912|  7.50M|          void *ptr = AllocUnits(p, i + 1);
  913|  7.50M|          void *oldPtr;
  914|  7.50M|          if (!ptr)
  ------------------
  |  Branch (914:15): [True: 155, False: 7.50M]
  ------------------
  915|    155|          {
  916|    155|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  547|    155|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  917|    155|            return;
  918|    155|          }
  919|  7.50M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  7.50M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  7.50M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  7.50M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  920|  7.50M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  246|  7.50M|  { UInt32 *d = (UInt32 *)dest; const UInt32 *z = (const UInt32 *)src; UInt32 n = num; \
  |  |  247|  14.2M|    do { d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3; } while (--n); }
  |  |  ------------------
  |  |  |  Branch (247:74): [True: 6.77M, False: 7.50M]
  |  |  ------------------
  ------------------
  921|  7.50M|          InsertNode(p, oldPtr, i);
  922|  7.50M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  7.50M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  7.50M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  923|  7.50M|        }
  924|  8.06M|      }
  925|  13.1M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  926|  13.1M|    }
  927|  11.7M|    else
  928|  11.7M|    {
  929|  11.7M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  930|  11.7M|      if (!s2)
  ------------------
  |  Branch (930:11): [True: 61, False: 11.7M]
  ------------------
  931|     61|      {
  932|     61|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  547|     61|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  933|     61|        return;
  934|     61|      }
  935|  11.7M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  11.7M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  11.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  936|  11.7M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  11.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  937|  11.7M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  11.7M|#define MAX_FREQ 124
  ------------------
  |  Branch (937:11): [True: 11.7M, False: 33.6k]
  ------------------
  938|  11.7M|        s2->Freq <<= 1;
  939|  33.6k|      else
  940|  33.6k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  33.6k|#define MAX_FREQ 124
  ------------------
  941|  11.7M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  942|  11.7M|    }
  943|  24.9M|    cf = 2 * fFreq * (c->SummFreq + 6);
  944|  24.9M|    sf = (UInt32)s0 + c->SummFreq;
  945|  24.9M|    if (cf < 6 * sf)
  ------------------
  |  Branch (945:9): [True: 17.6M, False: 7.25M]
  ------------------
  946|  17.6M|    {
  947|  17.6M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  948|  17.6M|      c->SummFreq += 4;
  949|  17.6M|    }
  950|  7.25M|    else
  951|  7.25M|    {
  952|  7.25M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  953|  7.25M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  954|  7.25M|    }
  955|  24.9M|    {
  956|  24.9M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  24.9M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  24.9M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  24.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  957|  24.9M|      SetSuccessor(s2, successor);
  958|  24.9M|      s2->Symbol = fSymbol;
  959|  24.9M|      s2->Freq = (Byte)cf;
  960|  24.9M|      c->Flags |= flag;
  961|  24.9M|      c->NumStats = (Byte)(ns1 + 1);
  962|  24.9M|    }
  963|  24.9M|  }
  964|  25.9M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  25.9M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |  103|  25.9M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  25.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  965|  25.9M|}
archive_ppmd8.c:CreateSuccessors:
  612|  12.5M|{
  613|  12.5M|  CPpmd_State upState;
  614|  12.5M|  Byte flags;
  615|  12.5M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  336|  12.5M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  616|       |  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
  617|  12.5M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  618|  12.5M|  unsigned numPs = 0;
  619|       |  
  620|  12.5M|  if (!skip)
  ------------------
  |  Branch (620:7): [True: 8.33M, False: 4.17M]
  ------------------
  621|  8.33M|    ps[numPs++] = p->FoundState;
  622|       |  
  623|  34.8M|  while (c->Suffix)
  ------------------
  |  Branch (623:10): [True: 34.1M, False: 710k]
  ------------------
  624|  34.1M|  {
  625|  34.1M|    CPpmd_Void_Ref successor;
  626|  34.1M|    CPpmd_State *s;
  627|  34.1M|    c = SUFFIX(c);
  ------------------
  |  |   32|  34.1M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  34.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  34.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  34.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|  34.1M|    if (s1)
  ------------------
  |  Branch (628:9): [True: 12.1M, False: 22.0M]
  ------------------
  629|  12.1M|    {
  630|  12.1M|      s = s1;
  631|  12.1M|      s1 = NULL;
  632|  12.1M|    }
  633|  22.0M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (633:14): [True: 10.8M, False: 11.1M]
  ------------------
  634|  10.8M|    {
  635|   146M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  10.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  10.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  10.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (635:26): [True: 135M, False: 10.8M]
  ------------------
  636|  10.8M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  10.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (636:11): [True: 10.8M, False: 50.4k]
  ------------------
  637|  10.8M|      {
  638|  10.8M|        s->Freq++;
  639|  10.8M|        c->SummFreq++;
  640|  10.8M|      }
  641|  10.8M|    }
  642|  11.1M|    else
  643|  11.1M|    {
  644|  11.1M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  11.1M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  11.1M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  645|  11.1M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  11.1M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  11.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  11.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  11.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  646|  11.1M|    }
  647|  34.1M|    successor = SUCCESSOR(s);
  ------------------
  |  |  336|  34.1M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  648|  34.1M|    if (successor != upBranch)
  ------------------
  |  Branch (648:9): [True: 11.8M, False: 22.3M]
  ------------------
  649|  11.8M|    {
  650|  11.8M|      c = CTX(successor);
  ------------------
  |  |   29|  11.8M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |  103|  11.8M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  11.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|  11.8M|      if (numPs == 0)
  ------------------
  |  Branch (651:11): [True: 644k, False: 11.1M]
  ------------------
  652|   644k|        return c;
  653|  11.1M|      break;
  654|  11.8M|    }
  655|  22.3M|    ps[numPs++] = s;
  656|  22.3M|  }
  657|       |  
  658|  11.8M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |  102|  11.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  659|  11.8M|  SetSuccessor(&upState, upBranch + 1);
  660|  11.8M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  661|       |
  662|  11.8M|  if (c->NumStats == 0)
  ------------------
  |  Branch (662:7): [True: 3.78M, False: 8.09M]
  ------------------
  663|  3.78M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  3.78M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.78M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  664|  8.09M|  else
  665|  8.09M|  {
  666|  8.09M|    UInt32 cf, s0;
  667|  8.09M|    CPpmd_State *s;
  668|  92.0M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  8.09M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|  8.09M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  8.09M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (668:24): [True: 83.9M, False: 8.09M]
  ------------------
  669|  8.09M|    cf = s->Freq - 1;
  670|  8.09M|    s0 = c->SummFreq - c->NumStats - cf;
  671|  8.09M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (671:32): [True: 5.94M, False: 2.14M]
  ------------------
  672|  8.09M|  }
  673|       |
  674|  42.5M|  while (numPs != 0)
  ------------------
  |  Branch (674:10): [True: 30.6M, False: 11.8M]
  ------------------
  675|  30.6M|  {
  676|       |    /* Create Child */
  677|  30.6M|    CTX_PTR c1; /* = AllocContext(p); */
  678|  30.6M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (678:9): [True: 29.3M, False: 1.33M]
  ------------------
  679|  29.3M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  29.3M|#define UNIT_SIZE 12
  ------------------
  680|  1.33M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (680:14): [True: 238k, False: 1.09M]
  ------------------
  681|   238k|      c1 = (CTX_PTR)RemoveNode(p, 0);
  682|  1.09M|    else
  683|  1.09M|    {
  684|  1.09M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  685|  1.09M|      if (!c1)
  ------------------
  |  Branch (685:11): [True: 34, False: 1.09M]
  ------------------
  686|     34|        return NULL;
  687|  1.09M|    }
  688|  30.6M|    c1->NumStats = 0;
  689|  30.6M|    c1->Flags = flags;
  690|  30.6M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|  30.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  30.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  691|  30.6M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|  30.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  692|  30.6M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|  30.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  693|  30.6M|    c = c1;
  694|  30.6M|  }
  695|       |
  696|  11.8M|  return c;
  697|  11.8M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  1.78M|{
  206|  1.78M|  unsigned i;
  207|  1.78M|  void *retVal;
  208|  1.78M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 344, False: 1.78M]
  ------------------
  209|    344|  {
  210|    344|    GlueFreeBlocks(p);
  211|    344|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 69, False: 275]
  ------------------
  212|     69|      return RemoveNode(p, indx);
  213|    344|  }
  214|  1.78M|  i = indx;
  215|  1.78M|  do
  216|  58.8M|  {
  217|  58.8M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|  58.8M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  58.8M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  58.8M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  58.8M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  58.8M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  58.8M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  58.8M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  58.8M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 1.54M, False: 57.3M]
  ------------------
  218|  1.54M|    {
  219|  1.54M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  1.54M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  1.54M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  1.54M|      p->GlueCount--;
  221|  1.54M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 1.54M, False: 250]
  ------------------
  222|  1.54M|    }
  223|  58.8M|  }
  224|  57.3M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 57.1M, False: 236k]
  ------------------
  225|   236k|  retVal = RemoveNode(p, i);
  226|   236k|  SplitBlock(p, retVal, i, indx);
  227|   236k|  return retVal;
  228|  1.78M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|    344|{
  148|    344|  CPpmd8_Node_Ref head = 0;
  149|    344|  CPpmd8_Node_Ref *prev = &head;
  150|    344|  unsigned i;
  151|       |
  152|    344|  p->GlueCount = 1 << 13;
  153|    344|  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|    344|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 101, False: 243]
  ------------------
  158|    101|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  13.4k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  13.4k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  13.4k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  13.4k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  13.4k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  13.4k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  13.4k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  13.4k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  13.4k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 13.0k, False: 344]
  ------------------
  162|  13.0k|  {
  163|  13.0k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  13.0k|    p->FreeList[i] = 0;
  165|  20.1k|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 7.12k, False: 13.0k]
  ------------------
  166|  7.12k|    {
  167|  7.12k|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  7.12k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  7.12k|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 7.02k, False: 95]
  ------------------
  169|  7.02k|      {
  170|  7.02k|        CPpmd8_Node *node2;
  171|  7.02k|        *prev = next;
  172|  7.02k|        prev = &(node->Next);
  173|  7.84k|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  7.84k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 820, False: 7.02k]
  ------------------
  174|    820|        {
  175|    820|          node->NU += node2->NU;
  176|    820|          node2->NU = 0;
  177|    820|        }
  178|  7.02k|      }
  179|  7.12k|      next = node->Next;
  180|  7.12k|    }
  181|  13.0k|  }
  182|    344|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  7.37k|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 7.02k, False: 344]
  ------------------
  186|  7.02k|  {
  187|  7.02k|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  7.02k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  7.02k|    unsigned nu;
  189|  7.02k|    head = node->Next;
  190|  7.02k|    nu = node->NU;
  191|  7.02k|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 725, False: 6.30k]
  ------------------
  192|    725|      continue;
  193|  6.30k|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 0, False: 6.30k]
  ------------------
  194|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  6.30k|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  6.30k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 38, False: 6.26k]
  ------------------
  196|     38|    {
  197|     38|      unsigned k = I2U(--i);
  ------------------
  |  |   19|     38|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|     38|      InsertNode(p, node + k, nu - k - 1);
  199|     38|    }
  200|  6.30k|    InsertNode(p, node, i);
  201|  6.30k|  }
  202|    344|}
archive_ppmd8.c:RestoreModel:
  555|    279|{
  556|    279|  CTX_PTR c;
  557|    279|  CPpmd_State *s;
  558|    279|  RESET_TEXT(0);
  ------------------
  |  |  344|    279|#define RESET_TEXT(offs) { p->Text = p->Base + p->AlignOffset + (offs); }
  ------------------
  559|  1.14k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|    866|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|    866|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    866|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    866|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (559:27): [True: 866, False: 279]
  ------------------
  560|    866|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (560:9): [True: 570, False: 296]
  ------------------
  561|    570|    {
  562|    570|      s = STATS(c);
  ------------------
  |  |   30|    570|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|    570|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    570|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|    570|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  564|    570|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|    570|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    570|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  565|    570|      SpecialFreeUnit(p, s);
  566|    570|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|    570|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    570|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|    570|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    570|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  567|    570|    }
  568|    296|    else
  569|    296|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  570|       | 
  571|    883|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|    604|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|    604|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    604|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    604|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (571:10): [True: 604, False: 279]
  ------------------
  572|    604|    if (!c->NumStats)
  ------------------
  |  Branch (572:9): [True: 184, False: 420]
  ------------------
  573|    184|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|    184|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    184|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|    184|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    184|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|    184|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|    184|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|    420|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (574:14): [True: 22, False: 398]
  ------------------
  575|     22|      Refresh(p, c, (c->NumStats + 2) >> 1, 1);
  576|       |
  577|       |  #ifdef PPMD8_FREEZE_SUPPORT
  578|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  579|       |  {
  580|       |    p->MaxContext = fSuccessor;
  581|       |    p->GlueCount += !(p->Stamps[1] & 1);
  582|       |  }
  583|       |  else if (p->RestoreMethod == PPMD8_RESTORE_METHOD_FREEZE)
  584|       |  {
  585|       |    while (p->MaxContext->Suffix)
  586|       |      p->MaxContext = SUFFIX(p->MaxContext);
  587|       |    RemoveBinContexts(p, p->MaxContext, 0);
  588|       |    p->RestoreMethod++;
  589|       |    p->GlueCount = 0;
  590|       |    p->OrderFall = p->MaxOrder;
  591|       |  }
  592|       |  else
  593|       |  #endif
  594|    279|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (594:7): [True: 279, False: 0]
  |  Branch (594:59): [True: 0, False: 0]
  ------------------
  595|    279|    RestartModel(p);
  596|      0|  else
  597|      0|  {
  598|      0|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (598:12): [True: 0, False: 0]
  ------------------
  599|      0|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|      0|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|      0|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|      0|    do
  601|      0|    {
  602|      0|      CutOff(p, p->MaxContext, 0);
  603|      0|      ExpandTextArea(p);
  604|      0|    }
  605|      0|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (605:12): [True: 0, False: 0]
  ------------------
  606|      0|    p->GlueCount = 0;
  607|      0|    p->OrderFall = p->MaxOrder;
  608|      0|  }
  609|    279|}
archive_ppmd8.c:SpecialFreeUnit:
  272|    570|{
  273|    570|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (273:7): [True: 421, False: 149]
  ------------------
  274|    421|    InsertNode(p, ptr, 0);
  275|    149|  else
  276|    149|  {
  277|       |    #ifdef PPMD8_FREEZE_SUPPORT
  278|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  279|       |    #endif
  280|    149|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|    149|#define UNIT_SIZE 12
  ------------------
  281|    149|  }
  282|    570|}
archive_ppmd8.c:Refresh:
  414|    318|{
  415|    318|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  416|    318|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|    318|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|    318|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    318|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  417|    318|  ctx->Stats = REF(s);
  ------------------
  |  |   24|    318|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  418|       |  #ifdef PPMD8_FREEZE_SUPPORT
  419|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  420|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  421|       |  #endif
  422|    318|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  423|    318|  escFreq = ctx->SummFreq - s->Freq;
  424|    318|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  425|    318|  do
  426|  2.03k|  {
  427|  2.03k|    escFreq -= (++s)->Freq;
  428|  2.03k|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  429|  2.03k|    flags |= 0x08 * (s->Symbol >= 0x40);
  430|  2.03k|  }
  431|  2.03k|  while (--i);
  ------------------
  |  Branch (431:10): [True: 1.71k, False: 318]
  ------------------
  432|    318|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  433|    318|  ctx->Flags = (Byte)flags;
  434|    318|}
archive_ppmd8.c:ReduceOrder:
  700|   961k|{
  701|   961k|  CPpmd_State *s = NULL;
  702|   961k|  CTX_PTR c1 = c;
  703|   961k|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|   961k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  704|       |  
  705|       |  #ifdef PPMD8_FREEZE_SUPPORT
  706|       |  /* The BUG in Shkarin's code was fixed: ps could overflow in CUT_OFF mode. */
  707|       |  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  708|       |  unsigned numPs = 0;
  709|       |  ps[numPs++] = p->FoundState;
  710|       |  #endif
  711|       |
  712|   961k|  SetSuccessor(p->FoundState, upBranch);
  713|   961k|  p->OrderFall++;
  714|       |
  715|   961k|  for (;;)
  716|   961k|  {
  717|   961k|    if (s1)
  ------------------
  |  Branch (717:9): [True: 0, False: 961k]
  ------------------
  718|      0|    {
  719|      0|      c = SUFFIX(c);
  ------------------
  |  |   32|      0|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|      0|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|      0|      s = s1;
  721|      0|      s1 = NULL;
  722|      0|    }
  723|   961k|    else
  724|   961k|    {
  725|   961k|      if (!c->Suffix)
  ------------------
  |  Branch (725:11): [True: 961k, False: 0]
  ------------------
  726|   961k|      {
  727|       |        #ifdef PPMD8_FREEZE_SUPPORT
  728|       |        if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  729|       |        {
  730|       |          do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  731|       |          RESET_TEXT(1);
  732|       |          p->OrderFall = 1;
  733|       |        }
  734|       |        #endif
  735|   961k|        return c;
  736|   961k|      }
  737|      0|      c = SUFFIX(c);
  ------------------
  |  |   32|      0|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|      0|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|      0|      if (c->NumStats)
  ------------------
  |  Branch (738:11): [True: 0, False: 0]
  ------------------
  739|      0|      {
  740|      0|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|      0|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |  104|      0|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|      0|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|      0|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (741:30): [True: 0, False: 0]
  ------------------
  742|      0|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|      0|#define MAX_FREQ 124
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|        {
  744|      0|          s->Freq += 2;
  745|      0|          c->SummFreq += 2;
  746|      0|        }
  747|      0|      }
  748|      0|      else
  749|      0|      {
  750|      0|        s = ONE_STATE(c);
  ------------------
  |  |   31|      0|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|      0|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  751|      0|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  752|      0|      }
  753|      0|    }
  754|      0|    if (SUCCESSOR(s))
  ------------------
  |  |  336|      0|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (336:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  755|      0|      break;
  756|       |    #ifdef PPMD8_FREEZE_SUPPORT
  757|       |    ps[numPs++] = s;
  758|       |    #endif
  759|      0|    SetSuccessor(s, upBranch);
  760|      0|    p->OrderFall++;
  761|      0|  }
  762|       |  
  763|       |  #ifdef PPMD8_FREEZE_SUPPORT
  764|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  765|       |  {
  766|       |    c = CTX(SUCCESSOR(s));
  767|       |    do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  768|       |    RESET_TEXT(1);
  769|       |    p->OrderFall = 1;
  770|       |    return c;
  771|       |  }
  772|       |  else
  773|       |  #endif
  774|      0|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  336|      0|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  775|      0|  {
  776|      0|    CTX_PTR successor;
  777|      0|    CPpmd_State *s2 = p->FoundState;
  778|      0|    p->FoundState = s;
  779|       |
  780|      0|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  781|      0|    if (successor == NULL)
  ------------------
  |  Branch (781:9): [True: 0, False: 0]
  ------------------
  782|      0|      SetSuccessor(s, 0);
  783|      0|    else
  784|      0|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|      0|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  785|      0|    p->FoundState = s2;
  786|      0|  }
  787|       |  
  788|      0|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (788:7): [True: 0, False: 0]
  |  Branch (788:28): [True: 0, False: 0]
  ------------------
  789|      0|  {
  790|      0|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  336|      0|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  791|      0|    p->Text--;
  792|      0|  }
  793|      0|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  336|      0|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (793:7): [True: 0, False: 0]
  ------------------
  794|      0|    return NULL;
  795|      0|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|      0|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |  103|      0|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|      0|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  796|      0|}
archive_ppmd8.c:AllocUnits:
  231|  19.2M|{
  232|  19.2M|  UInt32 numBytes;
  233|  19.2M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 7.24M, False: 12.0M]
  ------------------
  234|  7.24M|    return RemoveNode(p, indx);
  235|  12.0M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  12.0M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  12.0M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  12.0M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 11.3M, False: 689k]
  ------------------
  237|  11.3M|  {
  238|  11.3M|    void *retVal = p->LoUnit;
  239|  11.3M|    p->LoUnit += numBytes;
  240|  11.3M|    return retVal;
  241|  11.3M|  }
  242|   689k|  return AllocUnitsRare(p, indx);
  243|  12.0M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1135|  29.5M|{
 1136|  29.5M|  return p->Code / (p->Range /= total);
 1137|  29.5M|}
archive_ppmd8.c:RangeDec_Decode:
 1140|  54.6M|{
 1141|  54.6M|  start *= p->Range;
 1142|  54.6M|  p->Low += start;
 1143|  54.6M|  p->Code -= start;
 1144|  54.6M|  p->Range *= size;
 1145|       |
 1146|  65.9M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   131M|#define kTop (1 << 24)
  ------------------
  |  Branch (1146:10): [True: 11.3M, False: 54.6M]
  ------------------
 1147|  65.9M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   109M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  9.12k|#define kBot (1 << 15)
  ------------------
  |  Branch (1147:8): [True: 9.12k, False: 54.6M]
  |  Branch (1147:27): [True: 9.12k, False: 0]
  ------------------
 1148|  11.3M|  {
 1149|  11.3M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1150|  11.3M|    p->Range <<= 8;
 1151|  11.3M|    p->Low <<= 8;
 1152|  11.3M|  }
 1153|  54.6M|}

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

archive_read_new:
   92|    238|{
   93|    238|	struct archive_read *a;
   94|       |
   95|    238|	a = (struct archive_read *)calloc(1, sizeof(*a));
   96|    238|	if (a == NULL)
  ------------------
  |  Branch (96:6): [True: 0, False: 238]
  ------------------
   97|      0|		return (NULL);
   98|    238|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|    238|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
   99|       |
  100|    238|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   64|    238|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  101|    238|	a->entry = archive_entry_new2(&a->archive);
  102|    238|	a->archive.vtable = &archive_read_vtable;
  103|       |
  104|    238|	a->passphrases.last = &a->passphrases.first;
  105|       |
  106|    238|	return (&a->archive);
  107|    238|}
archive_read_set_open_callback:
  304|    238|{
  305|    238|	struct archive_read *a = (struct archive_read *)_a;
  306|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  307|    238|	    "archive_read_set_open_callback");
  308|    238|	a->client.opener = client_opener;
  309|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  310|    238|}
archive_read_set_read_callback:
  315|    238|{
  316|    238|	struct archive_read *a = (struct archive_read *)_a;
  317|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  318|    238|	    "archive_read_set_read_callback");
  319|    238|	a->client.reader = client_reader;
  320|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  321|    238|}
archive_read_set_skip_callback:
  326|    238|{
  327|    238|	struct archive_read *a = (struct archive_read *)_a;
  328|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  329|    238|	    "archive_read_set_skip_callback");
  330|    238|	a->client.skipper = client_skipper;
  331|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  332|    238|}
archive_read_set_seek_callback:
  337|    238|{
  338|    238|	struct archive_read *a = (struct archive_read *)_a;
  339|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  340|    238|	    "archive_read_set_seek_callback");
  341|    238|	a->client.seeker = client_seeker;
  342|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  343|    238|}
archive_read_set_close_callback:
  348|    238|{
  349|    238|	struct archive_read *a = (struct archive_read *)_a;
  350|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  351|    238|	    "archive_read_set_close_callback");
  352|    238|	a->client.closer = client_closer;
  353|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  354|    238|}
archive_read_set_callback_data:
  369|    238|{
  370|    238|	return archive_read_set_callback_data2(_a, client_data, 0);
  371|    238|}
archive_read_set_callback_data2:
  376|    238|{
  377|    238|	struct archive_read *a = (struct archive_read *)_a;
  378|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  379|    238|	    "archive_read_set_callback_data2");
  380|       |
  381|    238|	if (a->client.nodes == 0)
  ------------------
  |  Branch (381:6): [True: 238, False: 0]
  ------------------
  382|    238|	{
  383|    238|		a->client.dataset = (struct archive_read_data_node *)
  384|    238|		    calloc(1, sizeof(*a->client.dataset));
  385|    238|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (385:7): [True: 0, False: 238]
  ------------------
  386|      0|		{
  387|      0|			archive_set_error(&a->archive, ENOMEM,
  388|      0|				"No memory.");
  389|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  390|      0|		}
  391|    238|		a->client.nodes = 1;
  392|    238|	}
  393|       |
  394|    238|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (394:6): [True: 0, False: 238]
  ------------------
  395|      0|	{
  396|      0|		archive_set_error(&a->archive, EINVAL,
  397|      0|			"Invalid index specified.");
  398|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  399|      0|	}
  400|    238|	a->client.dataset[iindex].data = client_data;
  401|    238|	a->client.dataset[iindex].begin_position = -1;
  402|    238|	a->client.dataset[iindex].total_size = -1;
  403|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  404|    238|}
archive_read_open1:
  461|    238|{
  462|    238|	struct archive_read *a = (struct archive_read *)_a;
  463|    238|	struct archive_read_filter *filter, *tmp;
  464|    238|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  465|       |
  466|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|    238|	    "archive_read_open");
  468|    238|	archive_clear_error(&a->archive);
  469|       |
  470|    238|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (470:6): [True: 0, False: 238]
  ------------------
  471|      0|		archive_set_error(&a->archive, EINVAL,
  472|      0|		    "No reader function provided to archive_read_open");
  473|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  474|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  475|      0|	}
  476|       |
  477|       |	/* Open data source. */
  478|    238|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (478:6): [True: 238, False: 0]
  ------------------
  479|    238|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  480|    238|		if (e != 0) {
  ------------------
  |  Branch (480:7): [True: 0, False: 238]
  ------------------
  481|       |			/* If the open failed, call the closer to clean up. */
  482|      0|			read_client_close_proxy(a);
  483|      0|			return (e);
  484|      0|		}
  485|    238|	}
  486|       |
  487|    238|	filter = calloc(1, sizeof(*filter));
  488|    238|	if (filter == NULL)
  ------------------
  |  Branch (488:6): [True: 0, False: 238]
  ------------------
  489|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  490|    238|	filter->bidder = NULL;
  491|    238|	filter->upstream = NULL;
  492|    238|	filter->archive = a;
  493|    238|	filter->data = a->client.dataset[0].data;
  494|    238|	filter->vtable = &none_reader_vtable;
  495|    238|	filter->name = "none";
  496|    238|	filter->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  268|    238|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  497|    238|	filter->can_skip = 1;
  498|    238|	filter->can_seek = 1;
  499|       |
  500|    238|	a->client.dataset[0].begin_position = 0;
  501|    238|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (501:6): [True: 238, False: 0]
  |  Branch (501:20): [True: 0, False: 0]
  ------------------
  502|    238|	{
  503|    238|		a->filter = filter;
  504|       |		/* Build out the input pipeline. */
  505|    238|		e = choose_filters(a);
  506|    238|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  194|    238|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (506:7): [True: 2, False: 236]
  ------------------
  507|      2|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      2|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  508|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  509|      2|		}
  510|    238|	}
  511|      0|	else
  512|      0|	{
  513|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  514|      0|		tmp = a->filter;
  515|      0|		while (tmp->upstream)
  ------------------
  |  Branch (515:10): [True: 0, False: 0]
  ------------------
  516|      0|			tmp = tmp->upstream;
  517|      0|		tmp->upstream = filter;
  518|      0|	}
  519|       |
  520|    236|	if (!a->format)
  ------------------
  |  Branch (520:6): [True: 236, False: 0]
  ------------------
  521|    236|	{
  522|    236|		slot = choose_format(a);
  523|    236|		if (slot < 0) {
  ------------------
  |  Branch (523:7): [True: 3, False: 233]
  ------------------
  524|      3|			close_filters(a);
  525|      3|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      3|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  526|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  527|      3|		}
  528|    233|		a->format = &(a->formats[slot]);
  529|    233|	}
  530|       |
  531|    233|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|    233|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  532|       |
  533|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  534|    233|	client_switch_proxy(a->filter, 0);
  535|    233|	return (e);
  536|    236|}
__archive_read_header:
  605|     14|{
  606|     14|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (606:6): [True: 9, False: 5]
  ------------------
  607|      9|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  608|      5|	return a->filter->vtable->read_header(a->filter, entry);
  609|     14|}
archive_read_has_encrypted_entries:
  777|    233|{
  778|    233|	struct archive_read *a = (struct archive_read *)_a;
  779|    233|	int format_supports_encryption = archive_read_format_capabilities(_a)
  780|    233|			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  357|    233|#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);
  ------------------
  |  |  358|    233|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  781|       |
  782|    233|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (782:6): [True: 0, False: 233]
  |  Branch (782:13): [True: 112, False: 121]
  ------------------
  783|       |		/* Format in general doesn't support encryption */
  784|    112|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  369|    112|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  785|    112|	}
  786|       |
  787|       |	/* A reader potentially has read enough data now. */
  788|    121|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (788:6): [True: 121, False: 0]
  |  Branch (788:19): [True: 121, False: 0]
  ------------------
  789|    121|		return (a->format->has_encrypted_entries)(a);
  790|    121|	}
  791|       |
  792|       |	/* For any other reason we cannot say how many entries are there. */
  793|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  794|    121|}
archive_read_format_capabilities:
  802|    466|{
  803|    466|	struct archive_read *a = (struct archive_read *)_a;
  804|    466|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (804:6): [True: 466, False: 0]
  |  Branch (804:11): [True: 466, False: 0]
  |  Branch (804:24): [True: 296, False: 170]
  ------------------
  805|    296|		return (a->format->format_capabilties)(a);
  806|    296|	}
  807|    170|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  356|    170|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  808|    466|}
archive_read_data:
  823|   175k|{
  824|   175k|	struct archive *a = (struct archive *)_a;
  825|   175k|	char	*dest;
  826|   175k|	const void *read_buf;
  827|   175k|	size_t	 bytes_read;
  828|   175k|	size_t	 len;
  829|   175k|	int	 r;
  830|       |
  831|   175k|	bytes_read = 0;
  832|   175k|	dest = (char *)buff;
  833|       |
  834|   318k|	while (s > 0) {
  ------------------
  |  Branch (834:9): [True: 185k, False: 133k]
  ------------------
  835|   185k|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (835:7): [True: 185k, False: 0]
  ------------------
  836|   185k|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (836:7): [True: 52.5k, False: 132k]
  ------------------
  837|  52.5k|			read_buf = a->read_data_block;
  838|  52.5k|			a->read_data_is_posix_read = 1;
  839|  52.5k|			a->read_data_requested = s;
  840|  52.5k|			r = archive_read_data_block(a, &read_buf,
  841|  52.5k|			    &a->read_data_remaining, &a->read_data_offset);
  842|  52.5k|			a->read_data_block = read_buf;
  843|  52.5k|			if (r == ARCHIVE_EOF)
  ------------------
  |  |  191|  52.5k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (843:8): [True: 16.6k, False: 35.8k]
  ------------------
  844|  16.6k|				return (bytes_read);
  845|       |			/*
  846|       |			 * Error codes are all negative, so the status
  847|       |			 * return here cannot be confused with a valid
  848|       |			 * byte count.  (ARCHIVE_OK is zero.)
  849|       |			 */
  850|  35.8k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  192|  35.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (850:8): [True: 25.5k, False: 10.3k]
  ------------------
  851|  25.5k|				return (r);
  852|  35.8k|		}
  853|       |
  854|   142k|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (854:7): [True: 3, False: 142k]
  ------------------
  855|      3|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  856|      3|			    "Encountered out-of-order sparse blocks");
  857|      3|			return (ARCHIVE_RETRY);
  ------------------
  |  |  193|      3|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  858|      3|		}
  859|       |
  860|       |		/* Compute the amount of zero padding needed. */
  861|   142k|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (861:7): [True: 0, False: 142k]
  ------------------
  862|   142k|		    a->read_data_offset) {
  863|      0|			len = s;
  864|   142k|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (864:14): [True: 0, False: 142k]
  ------------------
  865|   142k|		    a->read_data_offset) {
  866|      0|			len = (size_t)(a->read_data_offset -
  867|      0|			    a->read_data_output_offset);
  868|      0|		} else
  869|   142k|			len = 0;
  870|       |
  871|       |		/* Add zeroes. */
  872|   142k|		memset(dest, 0, len);
  873|   142k|		s -= len;
  874|   142k|		a->read_data_output_offset += len;
  875|   142k|		dest += len;
  876|   142k|		bytes_read += len;
  877|       |
  878|       |		/* Copy data if there is any space left. */
  879|   142k|		if (s > 0) {
  ------------------
  |  Branch (879:7): [True: 142k, False: 0]
  ------------------
  880|   142k|			len = a->read_data_remaining;
  881|   142k|			if (len > s)
  ------------------
  |  Branch (881:8): [True: 132k, False: 10.3k]
  ------------------
  882|   132k|				len = s;
  883|   142k|			if (len) {
  ------------------
  |  Branch (883:8): [True: 141k, False: 1.58k]
  ------------------
  884|   141k|				memcpy(dest, a->read_data_block, len);
  885|   141k|				s -= len;
  886|   141k|				a->read_data_block += len;
  887|   141k|				a->read_data_remaining -= len;
  888|   141k|				a->read_data_output_offset += len;
  889|   141k|				a->read_data_offset += len;
  890|   141k|				dest += len;
  891|   141k|				bytes_read += len;
  892|   141k|			}
  893|   142k|		}
  894|   142k|	}
  895|   133k|	a->read_data_is_posix_read = 0;
  896|   133k|	a->read_data_requested = 0;
  897|   133k|	return (bytes_read);
  898|   175k|}
__archive_reset_read_data:
  904|   329k|{
  905|   329k|	a->read_data_output_offset = 0;
  906|   329k|	a->read_data_remaining = 0;
  907|   329k|	a->read_data_is_posix_read = 0;
  908|   329k|	a->read_data_requested = 0;
  909|       |
  910|       |   /* extra resets, from rar.c */
  911|   329k|   a->read_data_block = NULL;
  912|   329k|   a->read_data_offset = 0;
  913|   329k|}
archive_read_data_skip:
  920|  38.1k|{
  921|  38.1k|	struct archive_read *a = (struct archive_read *)_a;
  922|  38.1k|	int r;
  923|  38.1k|	const void *buff;
  924|  38.1k|	size_t size;
  925|  38.1k|	int64_t offset;
  926|       |
  927|  38.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|  38.1k|	do { \
  |  |  152|  38.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  38.1k|			(allowed_states), (function_name)); \
  |  |  154|  38.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|  38.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 38.1k]
  |  |  ------------------
  |  |  155|  38.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  38.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  928|  38.1k|	    "archive_read_data_skip");
  929|       |
  930|  38.1k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (930:6): [True: 38.1k, False: 0]
  ------------------
  931|  38.1k|		r = (a->format->read_data_skip)(a);
  932|      0|	else {
  933|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (933:10): [True: 0, False: 0]
  ------------------
  934|      0|			    &buff, &size, &offset))
  935|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  936|      0|			;
  937|      0|	}
  938|       |
  939|  38.1k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  191|  38.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (939:6): [True: 35, False: 38.1k]
  ------------------
  940|     35|		r = ARCHIVE_OK;
  ------------------
  |  |  192|     35|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  941|       |
  942|  38.1k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|  38.1k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  943|  38.1k|	return (r);
  944|  38.1k|}
archive_seek_data:
  948|    233|{
  949|    233|	struct archive_read *a = (struct archive_read *)_a;
  950|    233|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|    233|	do { \
  |  |  152|    233|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    233|			(allowed_states), (function_name)); \
  |  |  154|    233|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    233|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 176, False: 57]
  |  |  ------------------
  |  |  155|    233|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|    176|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    233|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  951|    233|	    "archive_seek_data_block");
  952|       |
  953|     57|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (953:6): [True: 30, False: 27]
  ------------------
  954|     30|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|     30|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  955|     30|		    "Internal error: "
  956|     30|		    "No format_seek_data_block function registered");
  957|     30|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|     30|	}
  959|       |
  960|     27|	return (a->format->seek_data)(a, offset, whence);
  961|     57|}
__archive_read_free_filters:
 1012|    240|{
 1013|       |	/* Make sure filters are closed and their buffers are freed */
 1014|    240|	close_filters(a);
 1015|       |
 1016|    515|	while (a->filter != NULL) {
  ------------------
  |  Branch (1016:9): [True: 275, False: 240]
  ------------------
 1017|    275|		struct archive_read_filter *t = a->filter->upstream;
 1018|    275|		free(a->filter);
 1019|    275|		a->filter = t;
 1020|    275|	}
 1021|    240|}
__archive_read_register_format:
 1193|  4.28k|{
 1194|  4.28k|	int i, number_slots;
 1195|       |
 1196|  4.28k|	archive_check_magic(&a->archive,
  ------------------
  |  |  151|  4.28k|	do { \
  |  |  152|  4.28k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  4.28k|			(allowed_states), (function_name)); \
  |  |  154|  4.28k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|  4.28k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 4.28k]
  |  |  ------------------
  |  |  155|  4.28k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  4.28k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1197|  4.28k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1198|  4.28k|	    "__archive_read_register_format");
 1199|       |
 1200|  4.28k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1201|       |
 1202|  34.5k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1202:14): [True: 34.5k, False: 0]
  ------------------
 1203|  34.5k|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1203:7): [True: 476, False: 34.0k]
  ------------------
 1204|    476|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  194|    476|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1205|  34.0k|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1205:7): [True: 3.80k, False: 30.2k]
  ------------------
 1206|  3.80k|			a->formats[i].bid = bid;
 1207|  3.80k|			a->formats[i].options = options;
 1208|  3.80k|			a->formats[i].read_header = read_header;
 1209|  3.80k|			a->formats[i].read_data = read_data;
 1210|  3.80k|			a->formats[i].read_data_skip = read_data_skip;
 1211|  3.80k|			a->formats[i].seek_data = seek_data;
 1212|  3.80k|			a->formats[i].cleanup = cleanup;
 1213|  3.80k|			a->formats[i].data = format_data;
 1214|  3.80k|			a->formats[i].name = name;
 1215|  3.80k|			a->formats[i].format_capabilties = format_capabilities;
 1216|  3.80k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1217|  3.80k|			return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1218|  3.80k|		}
 1219|  34.0k|	}
 1220|       |
 1221|      0|	archive_set_error(&a->archive, ENOMEM,
 1222|      0|	    "Not enough slots for format registration");
 1223|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1224|  4.28k|}
__archive_read_register_bidder:
 1235|  3.09k|{
 1236|  3.09k|	struct archive_read_filter_bidder *bidder;
 1237|  3.09k|	int i, number_slots;
 1238|       |
 1239|  3.09k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|  3.09k|	do { \
  |  |  152|  3.09k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  3.09k|			(allowed_states), (function_name)); \
  |  |  154|  3.09k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|  3.09k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 3.09k]
  |  |  ------------------
  |  |  155|  3.09k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  3.09k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1240|  3.09k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1241|       |
 1242|  3.09k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1243|       |
 1244|  21.6k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1244:14): [True: 21.6k, False: 0]
  ------------------
 1245|  21.6k|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1245:7): [True: 18.5k, False: 3.09k]
  ------------------
 1246|  18.5k|			continue;
 1247|  3.09k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1248|  3.09k|		bidder = (a->bidders + i);
 1249|  3.09k|		bidder->data = bidder_data;
 1250|  3.09k|		bidder->name = name;
 1251|  3.09k|		bidder->vtable = vtable;
 1252|  3.09k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1252:7): [True: 0, False: 3.09k]
  |  Branch (1252:38): [True: 0, False: 3.09k]
  ------------------
 1253|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1254|      0|					"Internal error: "
 1255|      0|					"no bid/init for filter bidder");
 1256|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1257|      0|		}
 1258|       |
 1259|  3.09k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.09k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1260|  3.09k|	}
 1261|       |
 1262|      0|	archive_set_error(&a->archive, ENOMEM,
 1263|      0|	    "Not enough slots for filter registration");
 1264|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1265|  3.09k|}
__archive_read_ahead:
 1320|  12.0M|{
 1321|  12.0M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1322|  12.0M|}
__archive_read_filter_ahead:
 1327|  12.1M|{
 1328|  12.1M|	ssize_t bytes_read;
 1329|  12.1M|	size_t tocopy;
 1330|       |
 1331|  12.1M|	if (filter->fatal) {
  ------------------
  |  Branch (1331:6): [True: 93, False: 12.1M]
  ------------------
 1332|     93|		if (avail)
  ------------------
  |  Branch (1332:7): [True: 69, False: 24]
  ------------------
 1333|     69|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|     69|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1334|     93|		return (NULL);
 1335|     93|	}
 1336|       |
 1337|       |	/*
 1338|       |	 * Keep pulling more data until we can satisfy the request.
 1339|       |	 */
 1340|  12.1M|	for (;;) {
 1341|       |
 1342|       |		/*
 1343|       |		 * If we can satisfy from the copy buffer (and the
 1344|       |		 * copy buffer isn't empty), we're done.  In particular,
 1345|       |		 * note that min == 0 is a perfectly well-defined
 1346|       |		 * request.
 1347|       |		 */
 1348|  12.1M|		if (filter->avail >= min && filter->avail > 0) {
  ------------------
  |  Branch (1348:7): [True: 131k, False: 11.9M]
  |  Branch (1348:31): [True: 107k, False: 23.8k]
  ------------------
 1349|   107k|			if (avail != NULL)
  ------------------
  |  Branch (1349:8): [True: 107k, False: 147]
  ------------------
 1350|   107k|				*avail = filter->avail;
 1351|   107k|			return (filter->next);
 1352|   107k|		}
 1353|       |
 1354|       |		/*
 1355|       |		 * We can satisfy directly from client buffer if everything
 1356|       |		 * currently in the copy buffer is still in the client buffer.
 1357|       |		 */
 1358|  12.0M|		if (filter->client_total >= filter->client_avail + filter->avail
  ------------------
  |  Branch (1358:7): [True: 12.0M, False: 12.9k]
  ------------------
 1359|  12.0M|		    && filter->client_avail + filter->avail >= min) {
  ------------------
  |  Branch (1359:10): [True: 12.0M, False: 3.64k]
  ------------------
 1360|       |			/* "Roll back" to client buffer. */
 1361|  12.0M|			filter->client_avail += filter->avail;
 1362|  12.0M|			filter->client_next -= filter->avail;
 1363|       |			/* Copy buffer is now empty. */
 1364|  12.0M|			filter->avail = 0;
 1365|  12.0M|			filter->next = filter->buffer;
 1366|       |			/* Return data from client buffer. */
 1367|  12.0M|			if (avail != NULL)
  ------------------
  |  Branch (1367:8): [True: 11.8M, False: 120k]
  ------------------
 1368|  11.8M|				*avail = filter->client_avail;
 1369|  12.0M|			return (filter->client_next);
 1370|  12.0M|		}
 1371|       |
 1372|       |		/* Move data forward in copy buffer if necessary. */
 1373|  16.6k|		if (filter->next > filter->buffer &&
  ------------------
  |  Branch (1373:7): [True: 461, False: 16.1k]
  ------------------
 1374|  16.6k|		    filter->next + min > filter->buffer + filter->buffer_size) {
  ------------------
  |  Branch (1374:7): [True: 445, False: 16]
  ------------------
 1375|    445|			if (filter->avail > 0)
  ------------------
  |  Branch (1375:8): [True: 445, False: 0]
  ------------------
 1376|    445|				memmove(filter->buffer, filter->next,
 1377|    445|				    filter->avail);
 1378|    445|			filter->next = filter->buffer;
 1379|    445|		}
 1380|       |
 1381|       |		/* If we've used up the client data, get more. */
 1382|  16.6k|		if (filter->client_avail <= 0) {
  ------------------
  |  Branch (1382:7): [True: 10.2k, False: 6.33k]
  ------------------
 1383|  10.2k|			if (filter->end_of_file) {
  ------------------
  |  Branch (1383:8): [True: 716, False: 9.56k]
  ------------------
 1384|    716|				if (avail != NULL)
  ------------------
  |  Branch (1384:9): [True: 691, False: 25]
  ------------------
 1385|    691|					*avail = filter->avail;
 1386|    716|				return (NULL);
 1387|    716|			}
 1388|  9.56k|			bytes_read = (filter->vtable->read)(filter,
 1389|  9.56k|			    &filter->client_buff);
 1390|  9.56k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1390:8): [True: 7, False: 9.55k]
  ------------------
 1391|      7|				filter->client_total = filter->client_avail = 0;
 1392|      7|				filter->client_next =
 1393|      7|				    filter->client_buff = NULL;
 1394|      7|				filter->fatal = 1;
 1395|      7|				if (avail != NULL)
  ------------------
  |  Branch (1395:9): [True: 7, False: 0]
  ------------------
 1396|      7|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1397|      7|				return (NULL);
 1398|      7|			}
 1399|  9.55k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1399:8): [True: 205, False: 9.35k]
  ------------------
 1400|       |				/* Check for another client object first */
 1401|    205|				if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1401:9): [True: 0, False: 205]
  ------------------
 1402|    205|				      filter->archive->client.nodes - 1) {
 1403|      0|					if (client_switch_proxy(filter,
  ------------------
  |  Branch (1403:10): [True: 0, False: 0]
  ------------------
 1404|      0|					    filter->archive->client.cursor + 1)
 1405|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1406|      0|						continue;
 1407|      0|				}
 1408|       |				/* Premature end-of-file. */
 1409|    205|				filter->client_total = filter->client_avail = 0;
 1410|    205|				filter->client_next =
 1411|    205|				    filter->client_buff = NULL;
 1412|    205|				filter->end_of_file = 1;
 1413|       |				/* Return whatever we do have. */
 1414|    205|				if (avail != NULL)
  ------------------
  |  Branch (1414:9): [True: 176, False: 29]
  ------------------
 1415|    176|					*avail = filter->avail;
 1416|    205|				return (NULL);
 1417|    205|			}
 1418|  9.35k|			filter->client_total = bytes_read;
 1419|  9.35k|			filter->client_avail = filter->client_total;
 1420|  9.35k|			filter->client_next = filter->client_buff;
 1421|  9.35k|		} else {
 1422|       |			/*
 1423|       |			 * We can't satisfy the request from the copy
 1424|       |			 * buffer or the existing client data, so we
 1425|       |			 * need to copy more client data over to the
 1426|       |			 * copy buffer.
 1427|       |			 */
 1428|       |
 1429|       |			/* Ensure the buffer is big enough. */
 1430|  6.33k|			if (min > filter->buffer_size) {
  ------------------
  |  Branch (1430:8): [True: 209, False: 6.12k]
  ------------------
 1431|    209|				size_t s, t;
 1432|    209|				char *p;
 1433|       |
 1434|       |				/* Double the buffer; watch for overflow. */
 1435|    209|				s = t = filter->buffer_size;
 1436|    209|				if (s == 0)
  ------------------
  |  Branch (1436:9): [True: 135, False: 74]
  ------------------
 1437|    135|					s = min;
 1438|    308|				while (s < min) {
  ------------------
  |  Branch (1438:12): [True: 99, False: 209]
  ------------------
 1439|     99|					t *= 2;
 1440|     99|					if (t <= s) { /* Integer overflow! */
  ------------------
  |  Branch (1440:10): [True: 0, False: 99]
  ------------------
 1441|      0|						archive_set_error(
 1442|      0|						    &filter->archive->archive,
 1443|      0|						    ENOMEM,
 1444|      0|						    "Unable to allocate copy"
 1445|      0|						    " buffer");
 1446|      0|						filter->fatal = 1;
 1447|      0|						if (avail != NULL)
  ------------------
  |  Branch (1447:11): [True: 0, False: 0]
  ------------------
 1448|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1449|      0|						return (NULL);
 1450|      0|					}
 1451|     99|					s = t;
 1452|     99|				}
 1453|       |				/* Now s >= min, so allocate a new buffer. */
 1454|    209|				p = (char *)malloc(s);
 1455|    209|				if (p == NULL) {
  ------------------
  |  Branch (1455:9): [True: 2, False: 207]
  ------------------
 1456|      2|					archive_set_error(
 1457|      2|						&filter->archive->archive,
 1458|      2|						ENOMEM,
 1459|      2|					    "Unable to allocate copy buffer");
 1460|      2|					filter->fatal = 1;
 1461|      2|					if (avail != NULL)
  ------------------
  |  Branch (1461:10): [True: 2, False: 0]
  ------------------
 1462|      2|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1463|      2|					return (NULL);
 1464|      2|				}
 1465|       |				/* Move data into newly-enlarged buffer. */
 1466|    207|				if (filter->avail > 0)
  ------------------
  |  Branch (1466:9): [True: 74, False: 133]
  ------------------
 1467|     74|					memmove(p, filter->next, filter->avail);
 1468|    207|				free(filter->buffer);
 1469|    207|				filter->next = filter->buffer = p;
 1470|    207|				filter->buffer_size = s;
 1471|    207|			}
 1472|       |
 1473|       |			/* We can add client data to copy buffer. */
 1474|       |			/* First estimate: copy to fill rest of buffer. */
 1475|  6.33k|			tocopy = (filter->buffer + filter->buffer_size)
 1476|  6.33k|			    - (filter->next + filter->avail);
 1477|       |			/* Don't waste time buffering more than we need to. */
 1478|  6.33k|			if (tocopy + filter->avail > min)
  ------------------
  |  Branch (1478:8): [True: 96, False: 6.23k]
  ------------------
 1479|     96|				tocopy = min - filter->avail;
 1480|       |			/* Don't copy more than is available. */
 1481|  6.33k|			if (tocopy > filter->client_avail)
  ------------------
  |  Branch (1481:8): [True: 6.25k, False: 79]
  ------------------
 1482|  6.25k|				tocopy = filter->client_avail;
 1483|       |
 1484|  6.33k|			memcpy(filter->next + filter->avail,
 1485|  6.33k|			    filter->client_next, tocopy);
 1486|       |			/* Remove this data from client buffer. */
 1487|  6.33k|			filter->client_next += tocopy;
 1488|  6.33k|			filter->client_avail -= tocopy;
 1489|       |			/* add it to copy buffer. */
 1490|  6.33k|			filter->avail += tocopy;
 1491|  6.33k|		}
 1492|  16.6k|	}
 1493|  12.1M|}
__archive_read_consume:
 1500|  12.1M|{
 1501|  12.1M|	return (__archive_read_filter_consume(a->filter, request));
 1502|  12.1M|}
__archive_read_filter_consume:
 1507|  12.1M|{
 1508|  12.1M|	int64_t skipped;
 1509|       |
 1510|  12.1M|	if (request < 0)
  ------------------
  |  Branch (1510:6): [True: 0, False: 12.1M]
  ------------------
 1511|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1512|  12.1M|	if (request == 0)
  ------------------
  |  Branch (1512:6): [True: 115k, False: 12.0M]
  ------------------
 1513|   115k|		return 0;
 1514|       |
 1515|  12.0M|	skipped = advance_file_pointer(filter, request);
 1516|  12.0M|	if (skipped == request)
  ------------------
  |  Branch (1516:6): [True: 12.0M, False: 13]
  ------------------
 1517|  12.0M|		return (skipped);
 1518|       |	/* We hit EOF before we satisfied the skip request. */
 1519|     13|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1519:6): [True: 0, False: 13]
  ------------------
 1520|      0|		skipped = 0;
 1521|     13|	archive_set_error(&filter->archive->archive,
 1522|     13|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1523|     13|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1524|     13|	    (intmax_t)request, (intmax_t)skipped);
 1525|     13|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1526|  12.0M|}
__archive_read_seek:
 1623|    564|{
 1624|    564|	return __archive_read_filter_seek(a->filter, offset, whence);
 1625|    564|}
__archive_read_filter_seek:
 1630|    564|{
 1631|    564|	struct archive_read_client *client;
 1632|    564|	int64_t r;
 1633|    564|	unsigned int cursor;
 1634|       |
 1635|    564|	if (filter->closed || filter->fatal)
  ------------------
  |  Branch (1635:6): [True: 0, False: 564]
  |  Branch (1635:24): [True: 3, False: 561]
  ------------------
 1636|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1637|    561|	if (filter->can_seek == 0)
  ------------------
  |  Branch (1637:6): [True: 10, False: 551]
  ------------------
 1638|     10|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1639|       |
 1640|    551|	client = &(filter->archive->client);
 1641|    551|	switch (whence) {
 1642|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1642:2): [True: 0, False: 551]
  ------------------
 1643|       |		/* Adjust the offset and use SEEK_SET instead */
 1644|      0|		offset += filter->position;
 1645|      0|		__LA_FALLTHROUGH;
 1646|    193|	case SEEK_SET:
  ------------------
  |  Branch (1646:2): [True: 193, False: 358]
  ------------------
 1647|    193|		cursor = 0;
 1648|    193|		while (1)
  ------------------
  |  Branch (1648:10): [Folded - Ignored]
  ------------------
 1649|    193|		{
 1650|    193|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1650:8): [True: 0, False: 193]
  ------------------
 1651|    193|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1651:8): [True: 9, False: 184]
  ------------------
 1652|    193|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1652:8): [True: 184, False: 0]
  ------------------
 1653|    184|			      client->dataset[cursor].total_size - 1 > offset ||
 1654|    193|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1654:8): [True: 0, False: 0]
  ------------------
 1655|    193|				break;
 1656|      0|			r = client->dataset[cursor].begin_position +
 1657|      0|				client->dataset[cursor].total_size;
 1658|      0|			client->dataset[++cursor].begin_position = r;
 1659|      0|		}
 1660|    193|		while (1) {
  ------------------
  |  Branch (1660:10): [Folded - Ignored]
  ------------------
 1661|    193|			r = client_switch_proxy(filter, cursor);
 1662|    193|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    193|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1662:8): [True: 0, False: 193]
  ------------------
 1663|      0|				return r;
 1664|    193|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1664:8): [True: 0, False: 193]
  ------------------
 1665|      0|				return r;
 1666|    193|			client->dataset[cursor].total_size = r;
 1667|    193|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1667:8): [True: 193, False: 0]
  ------------------
 1668|    193|			    client->dataset[cursor].total_size - 1 > offset ||
 1669|    193|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1669:8): [True: 0, False: 0]
  ------------------
 1670|    193|				break;
 1671|      0|			r = client->dataset[cursor].begin_position +
 1672|      0|				client->dataset[cursor].total_size;
 1673|      0|			client->dataset[++cursor].begin_position = r;
 1674|      0|		}
 1675|    193|		offset -= client->dataset[cursor].begin_position;
 1676|    193|		if (offset < 0
  ------------------
  |  Branch (1676:7): [True: 0, False: 193]
  ------------------
 1677|    193|		    || offset > client->dataset[cursor].total_size)
  ------------------
  |  Branch (1677:10): [True: 0, False: 193]
  ------------------
 1678|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1679|    193|		if ((r = client_seek_proxy(filter, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1679:7): [True: 0, False: 193]
  ------------------
 1680|      0|			return r;
 1681|    193|		break;
 1682|       |
 1683|    358|	case SEEK_END:
  ------------------
  |  Branch (1683:2): [True: 358, False: 193]
  ------------------
 1684|    358|		cursor = 0;
 1685|    358|		while (1) {
  ------------------
  |  Branch (1685:10): [Folded - Ignored]
  ------------------
 1686|    358|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1686:8): [True: 0, False: 358]
  ------------------
 1687|    358|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1687:8): [True: 179, False: 179]
  ------------------
 1688|    358|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1688:8): [True: 179, False: 0]
  ------------------
 1689|    358|				break;
 1690|      0|			r = client->dataset[cursor].begin_position +
 1691|      0|				client->dataset[cursor].total_size;
 1692|      0|			client->dataset[++cursor].begin_position = r;
 1693|      0|		}
 1694|    358|		while (1) {
  ------------------
  |  Branch (1694:10): [Folded - Ignored]
  ------------------
 1695|    358|			r = client_switch_proxy(filter, cursor);
 1696|    358|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    358|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1696:8): [True: 0, False: 358]
  ------------------
 1697|      0|				return r;
 1698|    358|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1698:8): [True: 0, False: 358]
  ------------------
 1699|      0|				return r;
 1700|    358|			client->dataset[cursor].total_size = r;
 1701|    358|			r = client->dataset[cursor].begin_position +
 1702|    358|				client->dataset[cursor].total_size;
 1703|    358|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1703:8): [True: 358, False: 0]
  ------------------
 1704|    358|				break;
 1705|      0|			client->dataset[++cursor].begin_position = r;
 1706|      0|		}
 1707|    358|		while (1) {
  ------------------
  |  Branch (1707:10): [Folded - Ignored]
  ------------------
 1708|    358|			if (r + offset >=
  ------------------
  |  Branch (1708:8): [True: 358, False: 0]
  ------------------
 1709|    358|			    client->dataset[cursor].begin_position)
 1710|    358|				break;
 1711|      0|			offset += client->dataset[cursor].total_size;
 1712|      0|			if (cursor == 0)
  ------------------
  |  Branch (1712:8): [True: 0, False: 0]
  ------------------
 1713|      0|				break;
 1714|      0|			cursor--;
 1715|      0|			r = client->dataset[cursor].begin_position +
 1716|      0|				client->dataset[cursor].total_size;
 1717|      0|		}
 1718|    358|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1719|    358|		if ((r = client_switch_proxy(filter, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  192|    358|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1719:7): [True: 0, False: 358]
  ------------------
 1720|      0|			return r;
 1721|    358|		r = client_seek_proxy(filter, offset, SEEK_SET);
 1722|    358|		if (r < ARCHIVE_OK)
  ------------------
  |  |  192|    358|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1722:7): [True: 0, False: 358]
  ------------------
 1723|      0|			return r;
 1724|    358|		break;
 1725|       |
 1726|    358|	default:
  ------------------
  |  Branch (1726:2): [True: 0, False: 551]
  ------------------
 1727|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1728|    551|	}
 1729|    551|	r += client->dataset[cursor].begin_position;
 1730|       |
 1731|    551|	if (r >= 0) {
  ------------------
  |  Branch (1731:6): [True: 551, False: 0]
  ------------------
 1732|       |		/*
 1733|       |		 * Ouch.  Clearing the buffer like this hurts, especially
 1734|       |		 * at bid time.  A lot of our efficiency at bid time comes
 1735|       |		 * from having bidders reuse the data we've already read.
 1736|       |		 *
 1737|       |		 * TODO: If the seek request is in data we already
 1738|       |		 * have, then don't call the seek callback.
 1739|       |		 *
 1740|       |		 * TODO: Zip seeks to end-of-file at bid time.  If
 1741|       |		 * other formats also start doing this, we may need to
 1742|       |		 * find a way for clients to fudge the seek offset to
 1743|       |		 * a block boundary.
 1744|       |		 *
 1745|       |		 * Hmmm... If whence was SEEK_END, we know the file
 1746|       |		 * size is (r - offset).  Can we use that to simplify
 1747|       |		 * the TODO items above?
 1748|       |		 */
 1749|    551|		filter->avail = filter->client_avail = 0;
 1750|    551|		filter->next = filter->buffer;
 1751|    551|		filter->position = r;
 1752|    551|		filter->end_of_file = 0;
 1753|    551|	}
 1754|    551|	return r;
 1755|    551|}
archive_read.c:_archive_read_close:
 1044|     57|{
 1045|     57|	struct archive_read *a = (struct archive_read *)_a;
 1046|     57|	int r = ARCHIVE_OK, r1 = ARCHIVE_OK;
  ------------------
  |  |  192|     57|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r = ARCHIVE_OK, r1 = ARCHIVE_OK;
  ------------------
  |  |  192|     57|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1047|       |
 1048|     57|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|     57|	do { \
  |  |  152|     57|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|     57|			(allowed_states), (function_name)); \
  |  |  154|     57|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|     57|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 57]
  |  |  ------------------
  |  |  155|     57|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|     57|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1049|     57|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_close");
 1050|     57|	if (a->archive.state == ARCHIVE_STATE_CLOSED)
  ------------------
  |  |   68|     57|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1050:6): [True: 0, False: 57]
  ------------------
 1051|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1052|     57|	archive_clear_error(&a->archive);
 1053|     57|	a->archive.state = ARCHIVE_STATE_CLOSED;
  ------------------
  |  |   68|     57|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
 1054|       |
 1055|       |	/* TODO: Clean up the formatters. */
 1056|       |
 1057|       |	/* Release the filter objects. */
 1058|     57|	r1 = close_filters(a);
 1059|     57|	if (r1 < r)
  ------------------
  |  Branch (1059:6): [True: 0, False: 57]
  ------------------
 1060|      0|		r = r1;
 1061|       |
 1062|     57|	return (r);
 1063|     57|}
archive_read.c:_archive_read_free:
 1070|    238|{
 1071|    238|	struct archive_read *a = (struct archive_read *)_a;
 1072|    238|	struct archive_read_passphrase *p;
 1073|    238|	int i, n;
 1074|    238|	int slots;
 1075|    238|	int r = ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1076|       |
 1077|    238|	if (_a == NULL)
  ------------------
  |  Branch (1077:6): [True: 0, False: 238]
  ------------------
 1078|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1079|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1080|    238|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1081|    238|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   68|    476|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1081:6): [True: 238, False: 0]
  ------------------
 1082|    238|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   69|    238|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1082:9): [True: 57, False: 181]
  ------------------
 1083|     57|		r = archive_read_close(&a->archive);
 1084|       |
 1085|       |	/* Call cleanup functions registered by optional components. */
 1086|    238|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1086:6): [True: 0, False: 238]
  ------------------
 1087|      0|		r = (a->cleanup_archive_extract)(a);
 1088|       |
 1089|       |	/* Cleanup format-specific data. */
 1090|    238|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1091|  4.04k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1091:14): [True: 3.80k, False: 238]
  ------------------
 1092|  3.80k|		a->format = &(a->formats[i]);
 1093|  3.80k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1093:7): [True: 3.57k, False: 238]
  ------------------
 1094|  3.57k|			(a->formats[i].cleanup)(a);
 1095|  3.80k|	}
 1096|       |
 1097|       |	/* Free the filters */
 1098|    238|	__archive_read_free_filters(a);
 1099|       |
 1100|       |	/* Release the bidder objects. */
 1101|    238|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1102|  4.04k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1102:14): [True: 3.80k, False: 238]
  ------------------
 1103|  3.80k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1103:7): [True: 714, False: 3.09k]
  ------------------
 1104|  3.80k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1104:7): [True: 3.09k, False: 0]
  ------------------
 1105|  3.80k|			continue;
 1106|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1107|      0|	}
 1108|       |
 1109|       |	/* Release passphrase list. */
 1110|    238|	p = a->passphrases.first;
 1111|    476|	while (p != NULL) {
  ------------------
  |  Branch (1111:9): [True: 238, False: 238]
  ------------------
 1112|    238|		struct archive_read_passphrase *np = p->next;
 1113|       |
 1114|       |		/* A passphrase should be cleaned. */
 1115|    238|		memset(p->passphrase, 0, strlen(p->passphrase));
 1116|    238|		free(p->passphrase);
 1117|    238|		free(p);
 1118|    238|		p = np;
 1119|    238|	}
 1120|       |
 1121|    238|	archive_string_free(&a->archive.error_string);
 1122|    238|	archive_entry_free(a->entry);
 1123|    238|	a->archive.magic = 0;
 1124|    238|	__archive_clean(&a->archive);
 1125|    238|	free(a->client.dataset);
 1126|    238|	free(a);
 1127|    238|	return (r);
 1128|    238|}
archive_read.c:_archive_read_next_header:
  680|   329k|{
  681|   329k|	int ret;
  682|   329k|	struct archive_read *a = (struct archive_read *)_a;
  683|   329k|	*entryp = NULL;
  684|   329k|	ret = _archive_read_next_header2(_a, a->entry);
  685|   329k|	*entryp = a->entry;
  686|   329k|	return ret;
  687|   329k|}
archive_read.c:_archive_read_next_header2:
  616|   329k|{
  617|   329k|	struct archive_read *a = (struct archive_read *)_a;
  618|   329k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  192|   329k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  619|       |
  620|   329k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|   329k|	do { \
  |  |  152|   329k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|   329k|			(allowed_states), (function_name)); \
  |  |  154|   329k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|   329k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 329k]
  |  |  ------------------
  |  |  155|   329k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|   329k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  621|   329k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
  622|   329k|	    "archive_read_next_header");
  623|       |
  624|   329k|	archive_entry_clear(entry);
  625|   329k|	archive_clear_error(&a->archive);
  626|       |
  627|       |	/*
  628|       |	 * If client didn't consume entire data, skip any remainder
  629|       |	 * (This is especially important for GNU incremental directories.)
  630|       |	 */
  631|   329k|	if (a->archive.state == ARCHIVE_STATE_DATA) {
  ------------------
  |  |   66|   329k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (631:6): [True: 38.1k, False: 291k]
  ------------------
  632|  38.1k|		r1 = archive_read_data_skip(&a->archive);
  633|  38.1k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  191|  38.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (633:7): [True: 0, False: 38.1k]
  ------------------
  634|      0|			archive_set_error(&a->archive, EIO,
  635|      0|			    "Premature end-of-file.");
  636|  38.1k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  191|  76.3k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  198|  38.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (636:7): [True: 0, False: 38.1k]
  |  Branch (636:28): [True: 14, False: 38.1k]
  ------------------
  637|     14|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|     14|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  638|     14|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  639|     14|		}
  640|  38.1k|	}
  641|       |
  642|       |	/* Record start-of-header offset in uncompressed stream. */
  643|   329k|	a->header_position = a->filter->position;
  644|       |
  645|   329k|	++_a->file_count;
  646|   329k|	r2 = (a->format->read_header)(a, entry);
  647|       |
  648|       |	/*
  649|       |	 * EOF and FATAL are persistent at this layer.  By
  650|       |	 * modifying the state, we guarantee that future calls to
  651|       |	 * read a header or read data will fail.
  652|       |	 */
  653|   329k|	switch (r2) {
  ------------------
  |  Branch (653:10): [True: 0, False: 329k]
  ------------------
  654|     41|	case ARCHIVE_EOF:
  ------------------
  |  |  191|     41|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (654:2): [True: 41, False: 329k]
  ------------------
  655|     41|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   67|     41|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  656|     41|		--_a->file_count;/* Revert a file counter. */
  657|     41|		break;
  658|  26.4k|	case ARCHIVE_OK:
  ------------------
  |  |  192|  26.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (658:2): [True: 26.4k, False: 302k]
  ------------------
  659|  26.4k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  26.4k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  660|  26.4k|		break;
  661|  11.7k|	case ARCHIVE_WARN:
  ------------------
  |  |  194|  11.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (661:2): [True: 11.7k, False: 317k]
  ------------------
  662|  11.7k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  11.7k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  663|  11.7k|		break;
  664|   290k|	case ARCHIVE_RETRY:
  ------------------
  |  |  193|   290k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (664:2): [True: 290k, False: 38.4k]
  ------------------
  665|   290k|		break;
  666|    121|	case ARCHIVE_FATAL:
  ------------------
  |  |  198|    121|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (666:2): [True: 121, False: 329k]
  ------------------
  667|    121|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    121|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  668|    121|		break;
  669|   329k|	}
  670|       |
  671|   329k|	__archive_reset_read_data(&a->archive);
  672|       |
  673|   329k|	a->data_start_node = a->client.cursor;
  674|       |	/* EOF always wins; otherwise return the worst error. */
  675|   329k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  191|  26.9k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (675:10): [True: 302k, False: 26.9k]
  |  Branch (675:21): [True: 41, False: 26.9k]
  ------------------
  676|   329k|}
archive_read.c:_archive_read_data_block:
  974|  52.5k|{
  975|  52.5k|	struct archive_read *a = (struct archive_read *)_a;
  976|  52.5k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|  52.5k|	do { \
  |  |  152|  52.5k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  52.5k|			(allowed_states), (function_name)); \
  |  |  154|  52.5k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|  52.5k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 52.5k]
  |  |  ------------------
  |  |  155|  52.5k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  52.5k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  977|  52.5k|	    "archive_read_data_block");
  978|       |
  979|  52.5k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (979:6): [True: 0, False: 52.5k]
  ------------------
  980|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  981|      0|		    "Internal error: "
  982|      0|		    "No format->read_data function registered");
  983|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  984|      0|	}
  985|       |
  986|  52.5k|	return (a->format->read_data)(a, buff, size, offset);
  987|  52.5k|}
archive_read.c:_archive_filter_bytes:
 1171|      4|{
 1172|      4|	struct archive_read_filter *f = get_filter(_a, n);
 1173|      4|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1173:9): [True: 0, False: 4]
  ------------------
 1174|      4|}
archive_read.c:get_filter:
 1132|      4|{
 1133|      4|	struct archive_read *a = (struct archive_read *)_a;
 1134|      4|	struct archive_read_filter *f = a->filter;
 1135|       |	/* We use n == -1 for 'the last filter', which is always the
 1136|       |	 * client proxy. */
 1137|      4|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1137:6): [True: 0, False: 4]
  |  Branch (1137:17): [True: 0, False: 0]
  ------------------
 1138|      0|		struct archive_read_filter *last = f;
 1139|      0|		f = f->upstream;
 1140|      0|		while (f != NULL) {
  ------------------
  |  Branch (1140:10): [True: 0, False: 0]
  ------------------
 1141|      0|			last = f;
 1142|      0|			f = f->upstream;
 1143|      0|		}
 1144|      0|		return (last);
 1145|      0|	}
 1146|      4|	if (n < 0)
  ------------------
  |  Branch (1146:6): [True: 0, False: 4]
  ------------------
 1147|      0|		return NULL;
 1148|      4|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1148:9): [True: 0, False: 4]
  |  Branch (1148:18): [True: 0, False: 0]
  ------------------
 1149|      0|		f = f->upstream;
 1150|      0|		--n;
 1151|      0|	}
 1152|      4|	return (f);
 1153|      4|}
archive_read.c:read_client_close_proxy:
  239|    238|{
  240|    238|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  241|    238|	unsigned int i;
  242|       |
  243|    238|	if (a->client.closer == NULL)
  ------------------
  |  Branch (243:6): [True: 0, False: 238]
  ------------------
  244|      0|		return (r);
  245|    476|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (245:14): [True: 238, False: 238]
  ------------------
  246|    238|	{
  247|    238|		r2 = (a->client.closer)
  248|    238|			((struct archive *)a, a->client.dataset[i].data);
  249|    238|		if (r > r2)
  ------------------
  |  Branch (249:7): [True: 0, False: 238]
  ------------------
  250|      0|			r = r2;
  251|    238|	}
  252|    238|	return (r);
  253|    238|}
archive_read.c:client_read_proxy:
  163|    801|{
  164|    801|	ssize_t r;
  165|    801|	r = (self->archive->client.reader)(&self->archive->archive,
  166|    801|	    self->data, buff);
  167|    801|	return (r);
  168|    801|}
archive_read.c:client_close_proxy:
  257|    238|{
  258|    238|	return read_client_close_proxy(self->archive);
  259|    238|}
archive_read.c:client_switch_proxy:
  273|  1.14k|{
  274|  1.14k|  int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  192|  1.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
                int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  192|  1.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  275|  1.14k|	void *data2 = NULL;
  276|       |
  277|       |	/* Don't do anything if already in the specified data node */
  278|  1.14k|	if (self->archive->client.cursor == iindex)
  ------------------
  |  Branch (278:6): [True: 1.14k, False: 0]
  ------------------
  279|  1.14k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  280|       |
  281|      0|	self->archive->client.cursor = iindex;
  282|      0|	data2 = self->archive->client.dataset[self->archive->client.cursor].data;
  283|      0|	if (self->archive->client.switcher != NULL)
  ------------------
  |  Branch (283:6): [True: 0, False: 0]
  ------------------
  284|      0|	{
  285|      0|		r1 = r2 = (self->archive->client.switcher)
  286|      0|			((struct archive *)self->archive, self->data, data2);
  287|      0|		self->data = data2;
  288|      0|	}
  289|      0|	else
  290|      0|	{
  291|       |		/* Attempt to call close and open instead */
  292|      0|		if (self->archive->client.closer != NULL)
  ------------------
  |  Branch (292:7): [True: 0, False: 0]
  ------------------
  293|      0|			r1 = (self->archive->client.closer)
  294|      0|				((struct archive *)self->archive, self->data);
  295|      0|		self->data = data2;
  296|      0|		r2 = client_open_proxy(self);
  297|      0|	}
  298|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|  1.14k|}
archive_read.c:choose_filters:
  549|    238|{
  550|    238|	int number_bidders, i, bid, best_bid, number_filters;
  551|    238|	struct archive_read_filter_bidder *bidder, *best_bidder;
  552|    238|	struct archive_read_filter *filter;
  553|    238|	ssize_t avail;
  554|    238|	int r;
  555|       |
  556|    275|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  545|    275|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (556:27): [True: 275, False: 0]
  ------------------
  557|    275|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  558|       |
  559|    275|		best_bid = 0;
  560|    275|		best_bidder = NULL;
  561|       |
  562|    275|		bidder = a->bidders;
  563|  4.67k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (563:15): [True: 4.40k, False: 275]
  ------------------
  564|  4.40k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (564:8): [True: 825, False: 3.57k]
  ------------------
  565|    825|				continue;
  566|  3.57k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  567|  3.57k|			if (bid > best_bid) {
  ------------------
  |  Branch (567:8): [True: 37, False: 3.53k]
  ------------------
  568|     37|				best_bid = bid;
  569|     37|				best_bidder = bidder;
  570|     37|			}
  571|  3.57k|		}
  572|       |
  573|       |		/* If no bidder, we're done. */
  574|    275|		if (best_bidder == NULL) {
  ------------------
  |  Branch (574:7): [True: 238, False: 37]
  ------------------
  575|       |			/* Verify the filter by asking it for some data. */
  576|    238|			__archive_read_filter_ahead(a->filter, 1, &avail);
  577|    238|			if (avail < 0) {
  ------------------
  |  Branch (577:8): [True: 2, False: 236]
  ------------------
  578|      2|				__archive_read_free_filters(a);
  579|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  580|      2|			}
  581|    236|			return (ARCHIVE_OK);
  ------------------
  |  |  192|    236|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  582|    238|		}
  583|       |
  584|     37|		filter
  585|     37|		    = (struct archive_read_filter *)calloc(1, sizeof(*filter));
  586|     37|		if (filter == NULL)
  ------------------
  |  Branch (586:7): [True: 0, False: 37]
  ------------------
  587|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  588|     37|		filter->bidder = best_bidder;
  589|     37|		filter->archive = a;
  590|     37|		filter->upstream = a->filter;
  591|     37|		a->filter = filter;
  592|     37|		r = (best_bidder->vtable->init)(a->filter);
  593|     37|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|     37|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (593:7): [True: 0, False: 37]
  ------------------
  594|      0|			__archive_read_free_filters(a);
  595|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  596|      0|		}
  597|     37|	}
  598|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  599|      0|	    "Input requires too many filters for decoding");
  600|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  601|    238|}
archive_read.c:choose_format:
  695|    236|{
  696|    236|	int slots;
  697|    236|	int i;
  698|    236|	int bid, best_bid;
  699|    236|	int best_bid_slot;
  700|       |
  701|    236|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  702|    236|	best_bid = -1;
  703|    236|	best_bid_slot = -1;
  704|       |
  705|       |	/* Set up a->format for convenience of bidders. */
  706|    236|	a->format = &(a->formats[0]);
  707|  4.01k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (707:14): [True: 3.77k, False: 236]
  ------------------
  708|  3.77k|		if (a->format->bid) {
  ------------------
  |  Branch (708:7): [True: 3.77k, False: 0]
  ------------------
  709|  3.77k|			bid = (a->format->bid)(a, best_bid);
  710|  3.77k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  198|  3.77k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (710:8): [True: 0, False: 3.77k]
  ------------------
  711|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  712|  3.77k|			if (a->filter->position != 0)
  ------------------
  |  Branch (712:8): [True: 179, False: 3.59k]
  ------------------
  713|    179|				__archive_read_seek(a, 0, SEEK_SET);
  714|  3.77k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (714:8): [True: 452, False: 3.32k]
  |  Branch (714:28): [True: 236, False: 3.08k]
  ------------------
  715|    688|				best_bid = bid;
  716|    688|				best_bid_slot = i;
  717|    688|			}
  718|  3.77k|		}
  719|  3.77k|	}
  720|       |
  721|       |	/*
  722|       |	 * There were no bidders; this is a serious programmer error
  723|       |	 * and demands a quick and definitive abort.
  724|       |	 */
  725|    236|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (725:6): [True: 0, False: 236]
  ------------------
  726|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  727|      0|		    "No formats registered");
  728|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  729|      0|	}
  730|       |
  731|       |	/*
  732|       |	 * There were bidders, but no non-zero bids; this means we
  733|       |	 * can't support this stream.
  734|       |	 */
  735|    236|	if (best_bid < 1) {
  ------------------
  |  Branch (735:6): [True: 3, False: 233]
  ------------------
  736|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  737|      3|		    "Unrecognized archive format");
  738|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  739|      3|	}
  740|       |
  741|    233|	return (best_bid_slot);
  742|    236|}
archive_read.c:close_filters:
  991|    300|{
  992|    300|	struct archive_read_filter *f = a->filter;
  993|    300|	int r = ARCHIVE_OK;
  ------------------
  |  |  192|    300|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  994|       |	/* Close each filter in the pipeline. */
  995|    642|	while (f != NULL) {
  ------------------
  |  Branch (995:9): [True: 342, False: 300]
  ------------------
  996|    342|		struct archive_read_filter *t = f->upstream;
  997|    342|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (997:7): [True: 275, False: 67]
  |  Branch (997:21): [True: 275, False: 0]
  ------------------
  998|    275|			int r1 = (f->vtable->close)(f);
  999|    275|			f->closed = 1;
 1000|    275|			if (r1 < r)
  ------------------
  |  Branch (1000:8): [True: 0, False: 275]
  ------------------
 1001|      0|				r = r1;
 1002|    275|		}
 1003|    342|		free(f->buffer);
 1004|    342|		f->buffer = NULL;
 1005|    342|		f = t;
 1006|    342|	}
 1007|    300|	return r;
 1008|    300|}
archive_read.c:advance_file_pointer:
 1536|  12.0M|{
 1537|  12.0M|	int64_t bytes_skipped, total_bytes_skipped = 0;
 1538|  12.0M|	ssize_t bytes_read;
 1539|  12.0M|	size_t min;
 1540|       |
 1541|  12.0M|	if (filter->fatal)
  ------------------
  |  Branch (1541:6): [True: 0, False: 12.0M]
  ------------------
 1542|      0|		return (-1);
 1543|       |
 1544|       |	/* Use up the copy buffer first. */
 1545|  12.0M|	if (filter->avail > 0) {
  ------------------
  |  Branch (1545:6): [True: 98.0k, False: 11.9M]
  ------------------
 1546|  98.0k|		min = (size_t)minimum(request, (int64_t)filter->avail);
  ------------------
  |  |   55|  98.0k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (55:24): [True: 98.0k, False: 12]
  |  |  ------------------
  ------------------
 1547|  98.0k|		filter->next += min;
 1548|  98.0k|		filter->avail -= min;
 1549|  98.0k|		request -= min;
 1550|  98.0k|		filter->position += min;
 1551|  98.0k|		total_bytes_skipped += min;
 1552|  98.0k|	}
 1553|       |
 1554|       |	/* Then use up the client buffer. */
 1555|  12.0M|	if (filter->client_avail > 0) {
  ------------------
  |  Branch (1555:6): [True: 11.9M, False: 98.0k]
  ------------------
 1556|  11.9M|		min = (size_t)minimum(request, (int64_t)filter->client_avail);
  ------------------
  |  |   55|  11.9M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (55:24): [True: 11.9M, False: 2.65k]
  |  |  ------------------
  ------------------
 1557|  11.9M|		filter->client_next += min;
 1558|  11.9M|		filter->client_avail -= min;
 1559|  11.9M|		request -= min;
 1560|  11.9M|		filter->position += min;
 1561|  11.9M|		total_bytes_skipped += min;
 1562|  11.9M|	}
 1563|  12.0M|	if (request == 0)
  ------------------
  |  Branch (1563:6): [True: 12.0M, False: 13]
  ------------------
 1564|  12.0M|		return (total_bytes_skipped);
 1565|       |
 1566|       |	/* If there's an optimized skip function, use it. */
 1567|     13|	if (filter->can_skip != 0) {
  ------------------
  |  Branch (1567:6): [True: 13, False: 0]
  ------------------
 1568|     13|		bytes_skipped = client_skip_proxy(filter, request);
 1569|     13|		if (bytes_skipped < 0) {	/* error */
  ------------------
  |  Branch (1569:7): [True: 0, False: 13]
  ------------------
 1570|      0|			filter->fatal = 1;
 1571|      0|			return (bytes_skipped);
 1572|      0|		}
 1573|     13|		filter->position += bytes_skipped;
 1574|     13|		total_bytes_skipped += bytes_skipped;
 1575|     13|		request -= bytes_skipped;
 1576|     13|		if (request == 0)
  ------------------
  |  Branch (1576:7): [True: 0, False: 13]
  ------------------
 1577|      0|			return (total_bytes_skipped);
 1578|     13|	}
 1579|       |
 1580|       |	/* Use ordinary reads as necessary to complete the request. */
 1581|     13|	for (;;) {
 1582|     13|		bytes_read = (filter->vtable->read)(filter, &filter->client_buff);
 1583|     13|		if (bytes_read < 0) {
  ------------------
  |  Branch (1583:7): [True: 0, False: 13]
  ------------------
 1584|      0|			filter->client_buff = NULL;
 1585|      0|			filter->fatal = 1;
 1586|      0|			return (bytes_read);
 1587|      0|		}
 1588|       |
 1589|     13|		if (bytes_read == 0) {
  ------------------
  |  Branch (1589:7): [True: 13, False: 0]
  ------------------
 1590|     13|			if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1590:8): [True: 0, False: 13]
  ------------------
 1591|     13|			      filter->archive->client.nodes - 1) {
 1592|      0|				if (client_switch_proxy(filter,
  ------------------
  |  Branch (1592:9): [True: 0, False: 0]
  ------------------
 1593|      0|				    filter->archive->client.cursor + 1)
 1594|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1595|      0|					continue;
 1596|      0|			}
 1597|     13|			filter->client_buff = NULL;
 1598|     13|			filter->end_of_file = 1;
 1599|     13|			return (total_bytes_skipped);
 1600|     13|		}
 1601|       |
 1602|      0|		if (bytes_read >= request) {
  ------------------
  |  Branch (1602:7): [True: 0, False: 0]
  ------------------
 1603|      0|			filter->client_next =
 1604|      0|			    ((const char *)filter->client_buff) + request;
 1605|      0|			filter->client_avail = (size_t)(bytes_read - request);
 1606|      0|			filter->client_total = bytes_read;
 1607|      0|			total_bytes_skipped += request;
 1608|      0|			filter->position += request;
 1609|      0|			return (total_bytes_skipped);
 1610|      0|		}
 1611|       |
 1612|      0|		filter->position += bytes_read;
 1613|      0|		total_bytes_skipped += bytes_read;
 1614|      0|		request -= bytes_read;
 1615|      0|	}
 1616|     13|}
archive_read.c:client_skip_proxy:
  172|     13|{
  173|     13|	if (request < 0)
  ------------------
  |  Branch (173:6): [True: 0, False: 13]
  ------------------
  174|      0|		__archive_errx(1, "Negative skip requested.");
  175|     13|	if (request == 0)
  ------------------
  |  Branch (175:6): [True: 0, False: 13]
  ------------------
  176|      0|		return 0;
  177|       |
  178|     13|	if (self->archive->client.skipper != NULL) {
  ------------------
  |  Branch (178:6): [True: 13, False: 0]
  ------------------
  179|       |		/* Seek requests over 1GiB are broken down into
  180|       |		 * multiple seeks.  This avoids overflows when the
  181|       |		 * requests get passed through 32-bit arguments. */
  182|     13|		int64_t skip_limit = (int64_t)1 << 30;
  183|     13|		int64_t total = 0;
  184|     13|		for (;;) {
  185|     13|			int64_t get, ask = request;
  186|     13|			if (ask > skip_limit)
  ------------------
  |  Branch (186:8): [True: 5, False: 8]
  ------------------
  187|      5|				ask = skip_limit;
  188|     13|			get = (self->archive->client.skipper)
  189|     13|				(&self->archive->archive, self->data, ask);
  190|     13|			total += get;
  191|     13|			if (get == 0 || get == request)
  ------------------
  |  Branch (191:8): [True: 13, False: 0]
  |  Branch (191:20): [True: 0, False: 0]
  ------------------
  192|     13|				return (total);
  193|      0|			if (get > request)
  ------------------
  |  Branch (193:8): [True: 0, False: 0]
  ------------------
  194|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  195|      0|			request -= get;
  196|      0|		}
  197|     13|	} else if (self->archive->client.seeker != NULL
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|		&& request > 64 * 1024) {
  ------------------
  |  Branch (198:6): [True: 0, False: 0]
  ------------------
  199|       |		/* If the client provided a seeker but not a skipper,
  200|       |		 * we can use the seeker to skip forward.
  201|       |		 *
  202|       |		 * Note: This isn't always a good idea.  The client
  203|       |		 * skipper is allowed to skip by less than requested
  204|       |		 * if it needs to maintain block alignment.  The
  205|       |		 * seeker is not allowed to play such games, so using
  206|       |		 * the seeker here may be a performance loss compared
  207|       |		 * to just reading and discarding.  That's why we
  208|       |		 * only do this for skips of over 64k.
  209|       |		 */
  210|      0|		int64_t before = self->position;
  211|      0|		int64_t after = (self->archive->client.seeker)
  212|      0|		    (&self->archive->archive, self->data, request, SEEK_CUR);
  213|      0|		if (after != before + request)
  ------------------
  |  Branch (213:7): [True: 0, False: 0]
  ------------------
  214|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  215|      0|		return after - before;
  216|      0|	}
  217|      0|	return 0;
  218|     13|}
archive_read.c:client_seek_proxy:
  222|  1.10k|{
  223|       |	/* DO NOT use the skipper here!  If we transparently handled
  224|       |	 * forward seek here by using the skipper, that will break
  225|       |	 * other libarchive code that assumes a successful forward
  226|       |	 * seek means it can also seek backwards.
  227|       |	 */
  228|  1.10k|	if (self->archive->client.seeker == NULL) {
  ------------------
  |  Branch (228:6): [True: 0, False: 1.10k]
  ------------------
  229|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  230|      0|		    "Current client reader does not support seeking a device");
  231|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  232|      0|	}
  233|  1.10k|	return (self->archive->client.seeker)(&self->archive->archive,
  234|  1.10k|	    self->data, offset, whence);
  235|  1.10k|}

archive_read_add_passphrase:
   88|    238|{
   89|    238|	struct archive_read *a = (struct archive_read *)_a;
   90|    238|	struct archive_read_passphrase *p;
   91|       |
   92|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
   93|    238|		"archive_read_add_passphrase");
   94|       |
   95|    238|	if (passphrase == NULL || passphrase[0] == '\0') {
  ------------------
  |  Branch (95:6): [True: 0, False: 238]
  |  Branch (95:28): [True: 0, False: 238]
  ------------------
   96|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   97|      0|		    "Empty passphrase is unacceptable");
   98|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   99|      0|	}
  100|       |
  101|    238|	p = new_read_passphrase(a, passphrase);
  102|    238|	if (p == NULL)
  ------------------
  |  Branch (102:6): [True: 0, False: 238]
  ------------------
  103|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  104|    238|	add_passphrase_to_tail(a, p);
  105|       |
  106|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  107|    238|}
__archive_read_reset_passphrase:
  129|  27.6k|{
  130|       |
  131|  27.6k|	a->passphrases.candidate = -1;
  132|  27.6k|}
__archive_read_next_passphrase:
  139|  8.84k|{
  140|  8.84k|	struct archive_read_passphrase *p;
  141|  8.84k|	const char *passphrase;
  142|       |
  143|  8.84k|	if (a->passphrases.candidate < 0) {
  ------------------
  |  Branch (143:6): [True: 4.17k, False: 4.66k]
  ------------------
  144|       |		/* Count out how many passphrases we have. */
  145|  4.17k|		int cnt = 0;
  146|       |
  147|  8.35k|		for (p = a->passphrases.first; p != NULL; p = p->next)
  ------------------
  |  Branch (147:34): [True: 4.17k, False: 4.17k]
  ------------------
  148|  4.17k|			cnt++;
  149|  4.17k|		a->passphrases.candidate = cnt;
  150|  4.17k|		p = a->passphrases.first;
  151|  4.66k|	} else if (a->passphrases.candidate > 1) {
  ------------------
  |  Branch (151:13): [True: 0, False: 4.66k]
  ------------------
  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|  4.66k|	} else if (a->passphrases.candidate == 1) {
  ------------------
  |  Branch (158:13): [True: 2.46k, False: 2.20k]
  ------------------
  159|       |		/* This case is that all candidates failed to decrypt. */
  160|  2.46k|		a->passphrases.candidate = 0;
  161|  2.46k|		if (a->passphrases.first->next != NULL) {
  ------------------
  |  Branch (161:7): [True: 0, False: 2.46k]
  ------------------
  162|       |			/* Rotate a passphrase list. */
  163|      0|			p = remove_passphrases_from_head(a);
  164|      0|			add_passphrase_to_tail(a, p);
  165|      0|		}
  166|  2.46k|		p = NULL;
  167|  2.46k|	} else  /* There is no passphrase candidate. */
  168|  2.20k|		p = NULL;
  169|       |
  170|  8.84k|	if (p != NULL)
  ------------------
  |  Branch (170:6): [True: 4.17k, False: 4.66k]
  ------------------
  171|  4.17k|		passphrase = p->passphrase;
  172|  4.66k|	else if (a->passphrases.callback != NULL) {
  ------------------
  |  Branch (172:11): [True: 0, False: 4.66k]
  ------------------
  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|  4.66k|		passphrase = NULL;
  187|       |
  188|  8.84k|	return (passphrase);
  189|  8.84k|}
archive_read_add_passphrase.c:new_read_passphrase:
   67|    238|{
   68|    238|	struct archive_read_passphrase *p;
   69|       |
   70|    238|	p = malloc(sizeof(*p));
   71|    238|	if (p == NULL) {
  ------------------
  |  Branch (71:6): [True: 0, False: 238]
  ------------------
   72|      0|		archive_set_error(&a->archive, ENOMEM,
   73|      0|		    "Can't allocate memory");
   74|      0|		return (NULL);
   75|      0|	}
   76|    238|	p->passphrase = strdup(passphrase);
   77|    238|	if (p->passphrase == NULL) {
  ------------------
  |  Branch (77:6): [True: 0, False: 238]
  ------------------
   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|    238|	return (p);
   84|    238|}
archive_read_add_passphrase.c:add_passphrase_to_tail:
   36|    238|{
   37|    238|	*a->passphrases.last = p;
   38|    238|	a->passphrases.last = &p->next;
   39|    238|	p->next = NULL;
   40|    238|}

archive_read_open_memory:
   57|    238|{
   58|    238|	return archive_read_open_memory2(a, buff, size, size);
   59|    238|}
archive_read_open_memory2:
   69|    238|{
   70|    238|	struct read_memory_data *mine;
   71|       |
   72|    238|	mine = (struct read_memory_data *)calloc(1, sizeof(*mine));
   73|    238|	if (mine == NULL) {
  ------------------
  |  Branch (73:6): [True: 0, False: 238]
  ------------------
   74|      0|		archive_set_error(a, ENOMEM, "No memory");
   75|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   76|      0|	}
   77|    238|	mine->start = mine->p = (const unsigned char *)buff;
   78|    238|	mine->end = mine->start + size;
   79|    238|	mine->read_size = read_size;
   80|    238|	archive_read_set_open_callback(a, memory_read_open);
   81|    238|	archive_read_set_read_callback(a, memory_read);
   82|    238|	archive_read_set_seek_callback(a, memory_read_seek);
   83|    238|	archive_read_set_skip_callback(a, memory_read_skip);
   84|    238|	archive_read_set_close_callback(a, memory_read_close);
   85|    238|	archive_read_set_callback_data(a, mine);
   86|    238|	return (archive_read_open1(a));
   87|    238|}
archive_read_open_memory.c:memory_read_open:
   94|    238|{
   95|    238|	(void)a; /* UNUSED */
   96|    238|	(void)client_data; /* UNUSED */
   97|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   98|    238|}
archive_read_open_memory.c:memory_read:
  109|    801|{
  110|    801|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  111|    801|	ssize_t size;
  112|       |
  113|    801|	(void)a; /* UNUSED */
  114|    801|	*buff = mine->p;
  115|    801|	size = mine->end - mine->p;
  116|    801|	if (size > mine->read_size)
  ------------------
  |  Branch (116:6): [True: 0, False: 801]
  ------------------
  117|      0|		size = mine->read_size;
  118|    801|        mine->p += size;
  119|    801|	return (size);
  120|    801|}
archive_read_open_memory.c:memory_read_skip:
  129|     13|{
  130|     13|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  131|       |
  132|     13|	(void)a; /* UNUSED */
  133|     13|	if ((int64_t)skip > (int64_t)(mine->end - mine->p))
  ------------------
  |  Branch (133:6): [True: 13, False: 0]
  ------------------
  134|     13|		skip = mine->end - mine->p;
  135|       |	/* Round down to block size. */
  136|     13|	skip /= mine->read_size;
  137|     13|	skip *= mine->read_size;
  138|     13|	mine->p += skip;
  139|     13|	return (skip);
  140|     13|}
archive_read_open_memory.c:memory_read_seek:
  147|  1.10k|{
  148|  1.10k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  149|       |
  150|  1.10k|	(void)a; /* UNUSED */
  151|  1.10k|	switch (whence) {
  152|    551|	case SEEK_SET:
  ------------------
  |  Branch (152:2): [True: 551, False: 551]
  ------------------
  153|    551|		mine->p = mine->start + offset;
  154|    551|		break;
  155|      0|	case SEEK_CUR:
  ------------------
  |  Branch (155:2): [True: 0, False: 1.10k]
  ------------------
  156|      0|		mine->p += offset;
  157|      0|		break;
  158|    551|	case SEEK_END:
  ------------------
  |  Branch (158:2): [True: 551, False: 551]
  ------------------
  159|    551|		mine->p = mine->end + offset;
  160|    551|		break;
  161|      0|	default:
  ------------------
  |  Branch (161:2): [True: 0, False: 1.10k]
  ------------------
  162|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  163|  1.10k|	}
  164|  1.10k|	if (mine->p < mine->start) {
  ------------------
  |  Branch (164:6): [True: 0, False: 1.10k]
  ------------------
  165|      0|		mine->p = mine->start;
  166|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  167|      0|	}
  168|  1.10k|	if (mine->p > mine->end) {
  ------------------
  |  Branch (168:6): [True: 0, False: 1.10k]
  ------------------
  169|      0|		mine->p = mine->end;
  170|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  171|      0|	}
  172|  1.10k|	return (mine->p - mine->start);
  173|  1.10k|}
archive_read_open_memory.c:memory_read_close:
  180|    238|{
  181|    238|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  182|    238|	(void)a; /* UNUSED */
  183|    238|	free(mine);
  184|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  185|    238|}

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

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

archive_read_support_filter_bzip2:
   89|    238|{
   90|    238|	struct archive_read *a = (struct archive_read *)_a;
   91|       |
   92|    238|	if (__archive_read_register_bidder(a, NULL, "bzip2",
  ------------------
  |  Branch (92:6): [True: 0, False: 238]
  ------------------
   93|    238|				&bzip2_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   94|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   95|       |
   96|    238|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
   97|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   98|       |#else
   99|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  100|       |	    "Using external bzip2 program");
  101|       |	return (ARCHIVE_WARN);
  102|       |#endif
  103|    238|}
archive_read_support_filter_bzip2.c:bzip2_reader_bid:
  114|    275|{
  115|    275|	const unsigned char *buffer;
  116|    275|	ssize_t avail;
  117|    275|	int bits_checked;
  118|       |
  119|    275|	(void)self; /* UNUSED */
  120|       |
  121|       |	/* Minimal bzip2 archive is 14 bytes. */
  122|    275|	buffer = __archive_read_filter_ahead(filter, 14, &avail);
  123|    275|	if (buffer == NULL)
  ------------------
  |  Branch (123:6): [True: 4, False: 271]
  ------------------
  124|      4|		return (0);
  125|       |
  126|       |	/* First three bytes must be "BZh" */
  127|    271|	bits_checked = 0;
  128|    271|	if (memcmp(buffer, "BZh", 3) != 0)
  ------------------
  |  Branch (128:6): [True: 271, False: 0]
  ------------------
  129|    271|		return (0);
  130|      0|	bits_checked += 24;
  131|       |
  132|       |	/* Next follows a compression flag which must be an ASCII digit. */
  133|      0|	if (buffer[3] < '1' || buffer[3] > '9')
  ------------------
  |  Branch (133:6): [True: 0, False: 0]
  |  Branch (133:25): [True: 0, False: 0]
  ------------------
  134|      0|		return (0);
  135|      0|	bits_checked += 5;
  136|       |
  137|       |	/* After BZh[1-9], there must be either a data block
  138|       |	 * which begins with 0x314159265359 or an end-of-data
  139|       |	 * marker of 0x177245385090. */
  140|      0|	if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", 6) == 0)
  ------------------
  |  Branch (140:6): [True: 0, False: 0]
  ------------------
  141|      0|		bits_checked += 48;
  142|      0|	else if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", 6) == 0)
  ------------------
  |  Branch (142:11): [True: 0, False: 0]
  ------------------
  143|      0|		bits_checked += 48;
  144|      0|	else
  145|      0|		return (0);
  146|       |
  147|      0|	return (bits_checked);
  148|      0|}

archive_read_support_filter_compress:
  159|    238|{
  160|    238|	struct archive_read *a = (struct archive_read *)_a;
  161|       |
  162|    238|	return __archive_read_register_bidder(a, NULL, "compress (.Z)",
  163|    238|			&compress_bidder_vtable);
  164|    238|}
archive_read_support_filter_compress.c:compress_bidder_bid:
  173|    275|{
  174|    275|	const unsigned char *buffer;
  175|    275|	ssize_t avail;
  176|    275|	int bits_checked;
  177|       |
  178|    275|	(void)self; /* UNUSED */
  179|       |
  180|       |	/* Shortest valid compress file is 3 bytes. */
  181|    275|	buffer = __archive_read_filter_ahead(filter, 3, &avail);
  182|       |
  183|    275|	if (buffer == NULL)
  ------------------
  |  Branch (183:6): [True: 4, False: 271]
  ------------------
  184|      4|		return (0);
  185|       |
  186|    271|	bits_checked = 0;
  187|       |	/* First two bytes are the magic value */
  188|    271|	if (buffer[0] != 0x1F || buffer[1] != 0x9D)
  ------------------
  |  Branch (188:6): [True: 247, False: 24]
  |  Branch (188:27): [True: 4, False: 20]
  ------------------
  189|    251|		return (0);
  190|       |	/* Third byte holds compression parameters. */
  191|     20|	if (buffer[2] & 0x20) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (191:6): [True: 0, False: 20]
  ------------------
  192|      0|		return (0);
  193|     20|	if (buffer[2] & 0x40) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (193:6): [True: 0, False: 20]
  ------------------
  194|      0|		return (0);
  195|     20|	bits_checked += 18;
  196|       |
  197|     20|	return (bits_checked);
  198|     20|}
archive_read_support_filter_compress.c:compress_bidder_init:
  211|     20|{
  212|     20|	struct private_data *state;
  213|     20|	static const size_t out_block_size = 64 * 1024;
  214|     20|	void *out_block;
  215|     20|	int code;
  216|       |
  217|     20|	self->code = ARCHIVE_FILTER_COMPRESS;
  ------------------
  |  |  271|     20|#define	ARCHIVE_FILTER_COMPRESS	3
  ------------------
  218|     20|	self->name = "compress (.Z)";
  219|       |
  220|     20|	state = (struct private_data *)calloc(1, sizeof(*state));
  221|     20|	out_block = malloc(out_block_size);
  222|     20|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (222:6): [True: 0, False: 20]
  |  Branch (222:23): [True: 0, False: 20]
  ------------------
  223|      0|		free(out_block);
  224|      0|		free(state);
  225|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  226|      0|		    "Can't allocate data for %s decompression",
  227|      0|		    self->name);
  228|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  229|      0|	}
  230|       |
  231|     20|	self->data = state;
  232|     20|	state->out_block_size = out_block_size;
  233|     20|	state->out_block = out_block;
  234|     20|	self->vtable = &compress_reader_vtable;
  235|       |
  236|       |	/* XXX MOVE THE FOLLOWING OUT OF INIT() XXX */
  237|       |
  238|     20|	(void)getbits(self, 8); /* Skip first signature byte. */
  239|     20|	(void)getbits(self, 8); /* Skip second signature byte. */
  240|       |
  241|       |	/* Get compression parameters. */
  242|     20|	code = getbits(self, 8);
  243|     20|	if ((code & 0x1f) > 16) {
  ------------------
  |  Branch (243:6): [True: 0, False: 20]
  ------------------
  244|      0|		archive_set_error(&self->archive->archive, -1,
  245|      0|		    "Invalid compressed data");
  246|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  247|      0|	}
  248|     20|	state->maxcode_bits = code & 0x1f;
  249|     20|	state->maxcode = (1 << state->maxcode_bits);
  250|     20|	state->use_reset_code = code & 0x80;
  251|       |
  252|       |	/* Initialize decompressor. */
  253|     20|	state->free_ent = 256;
  254|     20|	state->stackp = state->stack;
  255|     20|	if (state->use_reset_code)
  ------------------
  |  Branch (255:6): [True: 14, False: 6]
  ------------------
  256|     14|		state->free_ent++;
  257|     20|	state->bits = 9;
  258|     20|	state->section_end_code = (1<<state->bits) - 1;
  259|     20|	state->oldcode = -1;
  260|  5.14k|	for (code = 255; code >= 0; code--) {
  ------------------
  |  Branch (260:19): [True: 5.12k, False: 20]
  ------------------
  261|  5.12k|		state->prefix[code] = 0;
  262|  5.12k|		state->suffix[code] = code;
  263|  5.12k|	}
  264|     20|	next_code(self);
  265|       |
  266|     20|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  267|     20|}
archive_read_support_filter_compress.c:compress_filter_read:
  275|    334|{
  276|    334|	struct private_data *state;
  277|    334|	unsigned char *p, *start, *end;
  278|    334|	int ret;
  279|       |
  280|    334|	state = (struct private_data *)self->data;
  281|    334|	if (state->end_of_stream) {
  ------------------
  |  Branch (281:6): [True: 17, False: 317]
  ------------------
  282|     17|		*pblock = NULL;
  283|     17|		return (0);
  284|     17|	}
  285|    317|	p = start = (unsigned char *)state->out_block;
  286|    317|	end = start + state->out_block_size;
  287|       |
  288|  32.8M|	while (p < end && !state->end_of_stream) {
  ------------------
  |  Branch (288:9): [True: 32.8M, False: 297]
  |  Branch (288:20): [True: 32.8M, False: 18]
  ------------------
  289|  32.8M|		if (state->stackp > state->stack) {
  ------------------
  |  Branch (289:7): [True: 20.0M, False: 12.7M]
  ------------------
  290|  20.0M|			*p++ = *--state->stackp;
  291|  20.0M|		} else {
  292|  12.7M|			ret = next_code(self);
  293|  12.7M|			if (ret == -1)
  ------------------
  |  Branch (293:8): [True: 18, False: 12.7M]
  ------------------
  294|     18|				state->end_of_stream = ret;
  295|  12.7M|			else if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|  12.7M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (295:13): [True: 2, False: 12.7M]
  ------------------
  296|      2|				return (ret);
  297|  12.7M|		}
  298|  32.8M|	}
  299|       |
  300|    315|	*pblock = start;
  301|    315|	return (p - start);
  302|    317|}
archive_read_support_filter_compress.c:compress_filter_close:
  309|     20|{
  310|     20|	struct private_data *state = (struct private_data *)self->data;
  311|       |
  312|     20|	free(state->out_block);
  313|     20|	free(state);
  314|     20|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  315|     20|}
archive_read_support_filter_compress.c:getbits:
  415|  13.8M|{
  416|  13.8M|	struct private_data *state = (struct private_data *)self->data;
  417|  13.8M|	int code;
  418|  13.8M|	ssize_t ret;
  419|  13.8M|	static const int mask[] = {
  420|  13.8M|		0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
  421|  13.8M|		0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
  422|  13.8M|	};
  423|       |
  424|  32.5M|	while (state->bits_avail < n) {
  ------------------
  |  Branch (424:9): [True: 18.7M, False: 13.8M]
  ------------------
  425|  18.7M|		if (state->avail_in <= 0) {
  ------------------
  |  Branch (425:7): [True: 274, False: 18.7M]
  ------------------
  426|    274|			if (state->consume_unnotified) {
  ------------------
  |  Branch (426:8): [True: 254, False: 20]
  ------------------
  427|    254|				__archive_read_filter_consume(self->upstream,
  428|    254|					state->consume_unnotified);
  429|    254|				state->consume_unnotified = 0;
  430|    254|			}
  431|    274|			state->next_in
  432|    274|			    = __archive_read_filter_ahead(self->upstream,
  433|    274|				1, &ret);
  434|    274|			if (ret == 0)
  ------------------
  |  Branch (434:8): [True: 18, False: 256]
  ------------------
  435|     18|				return (-1);
  436|    256|			if (ret < 0 || state->next_in == NULL)
  ------------------
  |  Branch (436:8): [True: 0, False: 256]
  |  Branch (436:19): [True: 0, False: 256]
  ------------------
  437|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  438|    256|			state->consume_unnotified = state->avail_in = ret;
  439|    256|		}
  440|  18.7M|		state->bit_buffer |= *state->next_in++ << state->bits_avail;
  441|  18.7M|		state->avail_in--;
  442|  18.7M|		state->bits_avail += 8;
  443|  18.7M|		state->bytes_in_section++;
  444|  18.7M|	}
  445|       |
  446|  13.8M|	code = state->bit_buffer;
  447|  13.8M|	state->bit_buffer >>= n;
  448|  13.8M|	state->bits_avail -= n;
  449|       |
  450|  13.8M|	return (code & mask[n]);
  451|  13.8M|}
archive_read_support_filter_compress.c:next_code:
  324|  12.8M|{
  325|  12.8M|	struct private_data *state = (struct private_data *)self->data;
  326|  12.8M|	int code, newcode;
  327|       |
  328|  12.8M|	static int debug_buff[1024];
  329|  12.8M|	static unsigned debug_index;
  330|       |
  331|  12.8M|	code = newcode = getbits(self, state->bits);
  332|  12.8M|	if (code < 0)
  ------------------
  |  Branch (332:6): [True: 17, False: 12.8M]
  ------------------
  333|     17|		return (code);
  334|       |
  335|  12.8M|	debug_buff[debug_index++] = code;
  336|  12.8M|	if (debug_index >= sizeof(debug_buff)/sizeof(debug_buff[0]))
  ------------------
  |  Branch (336:6): [True: 12.5k, False: 12.8M]
  ------------------
  337|  12.5k|		debug_index = 0;
  338|       |
  339|       |	/* If it's a reset code, reset the dictionary. */
  340|  12.8M|	if ((code == 256) && state->use_reset_code) {
  ------------------
  |  Branch (340:6): [True: 132k, False: 12.7M]
  |  Branch (340:23): [True: 131k, False: 436]
  ------------------
  341|       |		/*
  342|       |		 * The original 'compress' implementation blocked its
  343|       |		 * I/O in a manner that resulted in junk bytes being
  344|       |		 * inserted after every reset.  The next section skips
  345|       |		 * this junk.  (Yes, the number of *bytes* to skip is
  346|       |		 * a function of the current *bit* length.)
  347|       |		 */
  348|   131k|		int skip_bytes =  state->bits -
  349|   131k|		    (state->bytes_in_section % state->bits);
  350|   131k|		skip_bytes %= state->bits;
  351|   131k|		state->bits_avail = 0; /* Discard rest of this byte. */
  352|  1.05M|		while (skip_bytes-- > 0) {
  ------------------
  |  Branch (352:10): [True: 923k, False: 131k]
  ------------------
  353|   923k|			code = getbits(self, 8);
  354|   923k|			if (code < 0)
  ------------------
  |  Branch (354:8): [True: 1, False: 923k]
  ------------------
  355|      1|				return (code);
  356|   923k|		}
  357|       |		/* Now, actually do the reset. */
  358|   131k|		state->bytes_in_section = 0;
  359|   131k|		state->bits = 9;
  360|   131k|		state->section_end_code = (1 << state->bits) - 1;
  361|   131k|		state->free_ent = 257;
  362|   131k|		state->oldcode = -1;
  363|   131k|		return (next_code(self));
  364|   131k|	}
  365|       |
  366|  12.7M|	if (code > state->free_ent
  ------------------
  |  Branch (366:6): [True: 2, False: 12.7M]
  ------------------
  367|  12.7M|	    || (code == state->free_ent && state->oldcode < 0)) {
  ------------------
  |  Branch (367:10): [True: 466, False: 12.7M]
  |  Branch (367:37): [True: 4, False: 462]
  ------------------
  368|       |		/* An invalid code is a fatal error. */
  369|      6|		archive_set_error(&(self->archive->archive), -1,
  370|      6|		    "Invalid compressed data");
  371|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  372|      6|	}
  373|       |
  374|       |	/* Special case for KwKwK string. */
  375|  12.7M|	if (code >= state->free_ent) {
  ------------------
  |  Branch (375:6): [True: 462, False: 12.7M]
  ------------------
  376|    462|		*state->stackp++ = state->finbyte;
  377|    462|		code = state->oldcode;
  378|    462|	}
  379|       |
  380|       |	/* Generate output characters in reverse order. */
  381|  20.0M|	while (code >= 256) {
  ------------------
  |  Branch (381:9): [True: 7.29M, False: 12.7M]
  ------------------
  382|  7.29M|		*state->stackp++ = state->suffix[code];
  383|  7.29M|		code = state->prefix[code];
  384|  7.29M|	}
  385|  12.7M|	*state->stackp++ = state->finbyte = code;
  386|       |
  387|       |	/* Generate the new entry. */
  388|  12.7M|	code = state->free_ent;
  389|  12.7M|	if (code < state->maxcode && state->oldcode >= 0) {
  ------------------
  |  Branch (389:6): [True: 210k, False: 12.5M]
  |  Branch (389:31): [True: 210k, False: 104]
  ------------------
  390|   210k|		state->prefix[code] = state->oldcode;
  391|   210k|		state->suffix[code] = state->finbyte;
  392|   210k|		++state->free_ent;
  393|   210k|	}
  394|  12.7M|	if (state->free_ent > state->section_end_code) {
  ------------------
  |  Branch (394:6): [True: 110, False: 12.7M]
  ------------------
  395|    110|		state->bits++;
  396|    110|		state->bytes_in_section = 0;
  397|    110|		if (state->bits == state->maxcode_bits)
  ------------------
  |  Branch (397:7): [True: 75, False: 35]
  ------------------
  398|     75|			state->section_end_code = state->maxcode;
  399|     35|		else
  400|     35|			state->section_end_code = (1 << state->bits) - 1;
  401|    110|	}
  402|       |
  403|       |	/* Remember previous code. */
  404|  12.7M|	state->oldcode = newcode;
  405|  12.7M|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  12.7M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  406|  12.7M|}

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

archive_read_support_filter_gzip:
  102|    238|{
  103|    238|	struct archive_read *a = (struct archive_read *)_a;
  104|       |
  105|    238|	if (__archive_read_register_bidder(a, NULL, "gzip",
  ------------------
  |  Branch (105:6): [True: 0, False: 238]
  ------------------
  106|    238|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  107|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  108|       |
  109|       |	/* Signal the extent of gzip support with the return value here. */
  110|    238|#if HAVE_ZLIB_H
  111|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  112|       |#else
  113|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  114|       |	    "Using external gzip program");
  115|       |	return (ARCHIVE_WARN);
  116|       |#endif
  117|    238|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  237|    275|{
  238|    275|	int bits_checked;
  239|       |
  240|    275|	(void)self; /* UNUSED */
  241|       |
  242|    275|	if (peek_at_header(filter, &bits_checked, NULL))
  ------------------
  |  Branch (242:6): [True: 4, False: 271]
  ------------------
  243|      4|		return (bits_checked);
  244|    271|	return (0);
  245|    275|}
archive_read_support_filter_gzip.c:peek_at_header:
  134|    282|{
  135|    282|	const unsigned char *p;
  136|    282|	ssize_t avail, len;
  137|    282|	int bits = 0;
  138|    282|	int header_flags;
  139|       |#ifndef HAVE_ZLIB_H
  140|       |	(void)state; /* UNUSED */
  141|       |#endif
  142|       |
  143|       |	/* Start by looking at the first ten bytes of the header, which
  144|       |	 * is all fixed layout. */
  145|    282|	len = 10;
  146|    282|	p = __archive_read_filter_ahead(filter, len, &avail);
  147|    282|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (147:6): [True: 4, False: 278]
  |  Branch (147:19): [True: 0, False: 278]
  ------------------
  148|      4|		return (0);
  149|       |	/* We only support deflation- third byte must be 0x08. */
  150|    278|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (150:6): [True: 270, False: 8]
  ------------------
  151|    270|		return (0);
  152|      8|	bits += 24;
  153|      8|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (153:6): [True: 0, False: 8]
  ------------------
  154|      0|		return (0);
  155|      8|	bits += 3;
  156|      8|	header_flags = p[3];
  157|       |	/* Bytes 4-7 are mod time in little endian. */
  158|      8|#ifdef HAVE_ZLIB_H
  159|      8|	if (state)
  ------------------
  |  Branch (159:6): [True: 4, False: 4]
  ------------------
  160|      4|		state->mtime = archive_le32dec(p + 4);
  161|      8|#endif
  162|       |	/* Byte 8 is deflate flags. */
  163|       |	/* XXXX TODO: return deflate flags back to consume_header for use
  164|       |	   in initializing the decompressor. */
  165|       |	/* Byte 9 is OS. */
  166|       |
  167|       |	/* Optional extra data:  2 byte length plus variable body. */
  168|      8|	if (header_flags & 4) {
  ------------------
  |  Branch (168:6): [True: 0, False: 8]
  ------------------
  169|      0|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  170|      0|		if (p == NULL)
  ------------------
  |  Branch (170:7): [True: 0, False: 0]
  ------------------
  171|      0|			return (0);
  172|      0|		len += ((int)p[len + 1] << 8) | (int)p[len];
  173|      0|		len += 2;
  174|      0|	}
  175|       |
  176|       |	/* Null-terminated optional filename. */
  177|      8|	if (header_flags & 8) {
  ------------------
  |  Branch (177:6): [True: 0, False: 8]
  ------------------
  178|      0|#ifdef HAVE_ZLIB_H
  179|      0|		ssize_t file_start = len;
  180|      0|#endif
  181|      0|		do {
  182|      0|			++len;
  183|      0|			if (avail < len)
  ------------------
  |  Branch (183:8): [True: 0, False: 0]
  ------------------
  184|      0|				p = __archive_read_filter_ahead(filter,
  185|      0|				    len, &avail);
  186|      0|			if (p == NULL)
  ------------------
  |  Branch (186:8): [True: 0, False: 0]
  ------------------
  187|      0|				return (0);
  188|      0|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (188:12): [True: 0, False: 0]
  ------------------
  189|       |
  190|      0|#ifdef HAVE_ZLIB_H
  191|      0|		if (state) {
  ------------------
  |  Branch (191:7): [True: 0, False: 0]
  ------------------
  192|       |			/* Reset the name in case of repeat header reads. */
  193|      0|			free(state->name);
  194|      0|			state->name = strdup((const char *)&p[file_start]);
  195|      0|		}
  196|      0|#endif
  197|      0|	}
  198|       |
  199|       |	/* Null-terminated optional comment. */
  200|      8|	if (header_flags & 16) {
  ------------------
  |  Branch (200:6): [True: 0, False: 8]
  ------------------
  201|      0|		do {
  202|      0|			++len;
  203|      0|			if (avail < len)
  ------------------
  |  Branch (203:8): [True: 0, False: 0]
  ------------------
  204|      0|				p = __archive_read_filter_ahead(filter,
  205|      0|				    len, &avail);
  206|      0|			if (p == NULL)
  ------------------
  |  Branch (206:8): [True: 0, False: 0]
  ------------------
  207|      0|				return (0);
  208|      0|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (208:12): [True: 0, False: 0]
  ------------------
  209|      0|	}
  210|       |
  211|       |	/* Optional header CRC */
  212|      8|	if ((header_flags & 2)) {
  ------------------
  |  Branch (212:6): [True: 0, False: 8]
  ------------------
  213|      0|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  214|      0|		if (p == NULL)
  ------------------
  |  Branch (214:7): [True: 0, False: 0]
  ------------------
  215|      0|			return (0);
  216|       |#if 0
  217|       |	int hcrc = ((int)p[len + 1] << 8) | (int)p[len];
  218|       |	int crc = /* XXX TODO: Compute header CRC. */;
  219|       |	if (crc != hcrc)
  220|       |		return (0);
  221|       |	bits += 16;
  222|       |#endif
  223|      0|		len += 2;
  224|      0|	}
  225|       |
  226|      8|	if (pbits != NULL)
  ------------------
  |  Branch (226:6): [True: 4, False: 4]
  ------------------
  227|      4|		*pbits = bits;
  228|      8|	return (len);
  229|      8|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  302|      4|{
  303|      4|	struct private_data *state;
  304|      4|	static const size_t out_block_size = 64 * 1024;
  305|      4|	void *out_block;
  306|       |
  307|      4|	self->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  269|      4|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  308|      4|	self->name = "gzip";
  309|       |
  310|      4|	state = (struct private_data *)calloc(1, sizeof(*state));
  311|      4|	out_block = (unsigned char *)malloc(out_block_size);
  312|      4|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (312:6): [True: 0, False: 4]
  |  Branch (312:23): [True: 0, False: 4]
  ------------------
  313|      0|		free(out_block);
  314|      0|		free(state);
  315|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  316|      0|		    "Can't allocate data for gzip decompression");
  317|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  318|      0|	}
  319|       |
  320|      4|	self->data = state;
  321|      4|	state->out_block_size = out_block_size;
  322|      4|	state->out_block = out_block;
  323|      4|	self->vtable = &gzip_reader_vtable;
  324|       |
  325|      4|	state->in_stream = 0; /* We're not actually within a stream yet. */
  326|       |
  327|      4|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  328|      4|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  423|  8.37k|{
  424|  8.37k|	struct private_data *state;
  425|  8.37k|	size_t decompressed;
  426|  8.37k|	ssize_t avail_in, max_in;
  427|  8.37k|	int ret;
  428|       |
  429|  8.37k|	state = (struct private_data *)self->data;
  430|       |
  431|       |	/* Empty our output buffer. */
  432|  8.37k|	state->stream.next_out = state->out_block;
  433|  8.37k|	state->stream.avail_out = (uInt)state->out_block_size;
  434|       |
  435|       |	/* Try to fill the output buffer. */
  436|  16.7k|	while (state->stream.avail_out > 0 && !state->eof) {
  ------------------
  |  Branch (436:9): [True: 8.37k, False: 8.36k]
  |  Branch (436:40): [True: 8.37k, False: 3]
  ------------------
  437|       |		/* If we're not in a stream, read a header
  438|       |		 * and initialize the decompression library. */
  439|  8.37k|		if (!state->in_stream) {
  ------------------
  |  Branch (439:7): [True: 7, False: 8.36k]
  ------------------
  440|      7|			ret = consume_header(self);
  441|      7|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  191|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (441:8): [True: 3, False: 4]
  ------------------
  442|      3|				state->eof = 1;
  443|      3|				break;
  444|      3|			}
  445|      4|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (445:8): [True: 0, False: 4]
  ------------------
  446|      0|				return (ret);
  447|      4|		}
  448|       |
  449|       |		/* Peek at the next available data. */
  450|       |		/* ZLib treats stream.next_in as const but doesn't declare
  451|       |		 * it so, hence this ugly cast. */
  452|  8.36k|		state->stream.next_in = (unsigned char *)(uintptr_t)
  453|  8.36k|		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
  454|  8.36k|		if (state->stream.next_in == NULL) {
  ------------------
  |  Branch (454:7): [True: 1, False: 8.36k]
  ------------------
  455|      1|			archive_set_error(&self->archive->archive,
  456|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  457|      1|			    "truncated gzip input");
  458|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  459|      1|		}
  460|  8.36k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (460:7): [Folded - Ignored]
  ------------------
  461|      0|			max_in = SSIZE_MAX;
  462|  8.36k|		else
  463|  8.36k|			max_in = UINT_MAX;
  464|  8.36k|		if (avail_in > max_in)
  ------------------
  |  Branch (464:7): [True: 0, False: 8.36k]
  ------------------
  465|      0|			avail_in = max_in;
  466|  8.36k|		state->stream.avail_in = (uInt)avail_in;
  467|       |
  468|       |		/* Decompress and consume some of that data. */
  469|  8.36k|		ret = inflate(&(state->stream), 0);
  470|  8.36k|		switch (ret) {
  471|  8.36k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (471:3): [True: 8.36k, False: 3]
  ------------------
  472|  8.36k|			__archive_read_filter_consume(self->upstream,
  473|  8.36k|			    avail_in - state->stream.avail_in);
  474|  8.36k|			break;
  475|      3|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (475:3): [True: 3, False: 8.36k]
  ------------------
  476|      3|			__archive_read_filter_consume(self->upstream,
  477|      3|			    avail_in - state->stream.avail_in);
  478|       |			/* Consume the stream trailer; release the
  479|       |			 * decompression library. */
  480|      3|			ret = consume_trailer(self);
  481|      3|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  192|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (481:8): [True: 0, False: 3]
  ------------------
  482|      0|				return (ret);
  483|      3|			break;
  484|      3|		default:
  ------------------
  |  Branch (484:3): [True: 0, False: 8.36k]
  ------------------
  485|       |			/* Return an error. */
  486|      0|			archive_set_error(&self->archive->archive,
  487|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  488|      0|			    "gzip decompression failed");
  489|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  490|  8.36k|		}
  491|  8.36k|	}
  492|       |
  493|       |	/* We've read as much as we can. */
  494|  8.37k|	decompressed = state->stream.next_out - state->out_block;
  495|  8.37k|	state->total_out += decompressed;
  496|  8.37k|	if (decompressed == 0)
  ------------------
  |  Branch (496:6): [True: 3, False: 8.36k]
  ------------------
  497|      3|		*p = NULL;
  498|  8.36k|	else
  499|  8.36k|		*p = state->out_block;
  500|  8.37k|	return (decompressed);
  501|  8.37k|}
archive_read_support_filter_gzip.c:consume_header:
  332|      7|{
  333|      7|	struct private_data *state;
  334|      7|	ssize_t avail;
  335|      7|	size_t len;
  336|      7|	int ret;
  337|       |
  338|      7|	state = (struct private_data *)self->data;
  339|       |
  340|       |	/* If this is a real header, consume it. */
  341|      7|	len = peek_at_header(self->upstream, NULL, state);
  342|      7|	if (len == 0)
  ------------------
  |  Branch (342:6): [True: 3, False: 4]
  ------------------
  343|      3|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  344|      4|	__archive_read_filter_consume(self->upstream, len);
  345|       |
  346|       |	/* Initialize CRC accumulator. */
  347|      4|	state->crc = crc32(0L, NULL, 0);
  348|       |
  349|       |	/* Initialize compression library. */
  350|      4|	state->stream.next_in = (unsigned char *)(uintptr_t)
  351|      4|	    __archive_read_filter_ahead(self->upstream, 1, &avail);
  352|      4|	state->stream.avail_in = (uInt)avail;
  353|      4|	ret = inflateInit2(&(state->stream),
  354|      4|	    -15 /* Don't check for zlib header */);
  355|       |
  356|       |	/* Decipher the error code. */
  357|      4|	switch (ret) {
  358|      4|	case Z_OK:
  ------------------
  |  Branch (358:2): [True: 4, False: 0]
  ------------------
  359|      4|		state->in_stream = 1;
  360|      4|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  361|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (361:2): [True: 0, False: 4]
  ------------------
  362|      0|		archive_set_error(&self->archive->archive,
  363|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  364|      0|		    "Internal error initializing compression library: "
  365|      0|		    "invalid setup parameter");
  366|      0|		break;
  367|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (367:2): [True: 0, False: 4]
  ------------------
  368|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  369|      0|		    "Internal error initializing compression library: "
  370|      0|		    "out of memory");
  371|      0|		break;
  372|      0|	case Z_VERSION_ERROR:
  ------------------
  |  Branch (372:2): [True: 0, False: 4]
  ------------------
  373|      0|		archive_set_error(&self->archive->archive,
  374|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  375|      0|		    "Internal error initializing compression library: "
  376|      0|		    "invalid library version");
  377|      0|		break;
  378|      0|	default:
  ------------------
  |  Branch (378:2): [True: 0, False: 4]
  ------------------
  379|      0|		archive_set_error(&self->archive->archive,
  380|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  381|      0|		    "Internal error initializing compression library: "
  382|      0|		    " Zlib error %d", ret);
  383|      0|		break;
  384|      4|	}
  385|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  386|      4|}
archive_read_support_filter_gzip.c:consume_trailer:
  390|      3|{
  391|      3|	struct private_data *state;
  392|      3|	const unsigned char *p;
  393|      3|	ssize_t avail;
  394|       |
  395|      3|	state = (struct private_data *)self->data;
  396|       |
  397|      3|	state->in_stream = 0;
  398|      3|	switch (inflateEnd(&(state->stream))) {
  399|      3|	case Z_OK:
  ------------------
  |  Branch (399:2): [True: 3, False: 0]
  ------------------
  400|      3|		break;
  401|      0|	default:
  ------------------
  |  Branch (401:2): [True: 0, False: 3]
  ------------------
  402|      0|		archive_set_error(&self->archive->archive,
  403|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  404|      0|		    "Failed to clean up gzip decompressor");
  405|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  406|      3|	}
  407|       |
  408|       |	/* GZip trailer is a fixed 8 byte structure. */
  409|      3|	p = __archive_read_filter_ahead(self->upstream, 8, &avail);
  410|      3|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (410:6): [True: 0, False: 3]
  |  Branch (410:19): [True: 0, False: 3]
  ------------------
  411|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  412|       |
  413|       |	/* XXX TODO: Verify the length and CRC. */
  414|       |
  415|       |	/* We've verified the trailer, so consume it now. */
  416|      3|	__archive_read_filter_consume(self->upstream, 8);
  417|       |
  418|      3|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  419|      3|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  508|      4|{
  509|      4|	struct private_data *state;
  510|      4|	int ret;
  511|       |
  512|      4|	state = (struct private_data *)self->data;
  513|      4|	ret = ARCHIVE_OK;
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  514|       |
  515|      4|	if (state->in_stream) {
  ------------------
  |  Branch (515:6): [True: 1, False: 3]
  ------------------
  516|      1|		switch (inflateEnd(&(state->stream))) {
  517|      1|		case Z_OK:
  ------------------
  |  Branch (517:3): [True: 1, False: 0]
  ------------------
  518|      1|			break;
  519|      0|		default:
  ------------------
  |  Branch (519:3): [True: 0, False: 1]
  ------------------
  520|      0|			archive_set_error(&(self->archive->archive),
  521|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  522|      0|			    "Failed to clean up gzip compressor");
  523|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  524|      1|		}
  525|      1|	}
  526|       |
  527|      4|	free(state->name);
  528|      4|	free(state->out_block);
  529|      4|	free(state);
  530|      4|	return (ret);
  531|      4|}
archive_read_support_filter_gzip.c:gzip_read_header:
  272|      3|{
  273|      3|	struct private_data *state;
  274|       |
  275|      3|	state = (struct private_data *)self->data;
  276|       |
  277|       |	/* A mtime of 0 is considered invalid/missing. */
  278|      3|	if (state->mtime != 0)
  ------------------
  |  Branch (278:6): [True: 3, False: 0]
  ------------------
  279|      3|		archive_entry_set_mtime(entry, state->mtime, 0);
  280|       |
  281|       |	/* If the name is available, extract it. */
  282|      3|	if (state->name)
  ------------------
  |  Branch (282:6): [True: 0, False: 3]
  ------------------
  283|      0|		archive_entry_set_pathname(entry, state->name);
  284|       |
  285|      3|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  286|      3|}

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

archive_read_support_filter_lz4:
  115|    238|{
  116|    238|	struct archive_read *a = (struct archive_read *)_a;
  117|       |
  118|    238|	if (__archive_read_register_bidder(a, NULL, "lz4",
  ------------------
  |  Branch (118:6): [True: 0, False: 238]
  ------------------
  119|    238|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  120|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  121|       |
  122|    238|#if defined(HAVE_LIBLZ4)
  123|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  124|       |#else
  125|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  126|       |	    "Using external lz4 program");
  127|       |	return (ARCHIVE_WARN);
  128|       |#endif
  129|    238|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  141|    275|{
  142|    275|	const unsigned char *buffer;
  143|    275|	ssize_t avail;
  144|    275|	int bits_checked;
  145|    275|	uint32_t number;
  146|       |
  147|    275|	(void)self; /* UNUSED */
  148|       |
  149|       |	/* Minimal lz4 archive is 11 bytes. */
  150|    275|	buffer = __archive_read_filter_ahead(filter, 11, &avail);
  151|    275|	if (buffer == NULL)
  ------------------
  |  Branch (151:6): [True: 4, False: 271]
  ------------------
  152|      4|		return (0);
  153|       |
  154|       |	/* First four bytes must be LZ4 magic numbers. */
  155|    271|	bits_checked = 0;
  156|    271|	if ((number = archive_le32dec(buffer)) == LZ4_MAGICNUMBER) {
  ------------------
  |  |   51|    271|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (156:6): [True: 0, False: 271]
  ------------------
  157|      0|		unsigned char flag, BD;
  158|       |
  159|      0|		bits_checked += 32;
  160|       |		/* Next follows a stream descriptor. */
  161|       |		/* Descriptor Flags. */
  162|      0|		flag = buffer[4];
  163|       |		/* A version number must be "01". */
  164|      0|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (164:7): [True: 0, False: 0]
  ------------------
  165|      0|			return (0);
  166|       |		/* A reserved bit must be "0". */
  167|      0|		if (flag & 2)
  ------------------
  |  Branch (167:7): [True: 0, False: 0]
  ------------------
  168|      0|			return (0);
  169|      0|		bits_checked += 8;
  170|      0|		BD = buffer[5];
  171|       |		/* A block maximum size should be more than 3. */
  172|      0|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (172:7): [True: 0, False: 0]
  ------------------
  173|      0|			return (0);
  174|       |		/* Reserved bits must be "0". */
  175|      0|		if (BD & ~0x70)
  ------------------
  |  Branch (175:7): [True: 0, False: 0]
  ------------------
  176|      0|			return (0);
  177|      0|		bits_checked += 8;
  178|    271|	} else if (number == LZ4_LEGACY) {
  ------------------
  |  |   53|    271|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (178:13): [True: 0, False: 271]
  ------------------
  179|      0|		bits_checked += 32;
  180|      0|	}
  181|       |	
  182|    271|	return (bits_checked);
  183|    271|}

archive_read_support_filter_lzop:
  110|    238|{
  111|    238|	struct archive_read *a = (struct archive_read *)_a;
  112|       |
  113|    238|	if (__archive_read_register_bidder(a, NULL, NULL,
  ------------------
  |  Branch (113:6): [True: 0, False: 238]
  ------------------
  114|    238|				&lzop_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  115|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  116|       |
  117|       |	/* Signal the extent of lzop support with the return value here. */
  118|       |#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
  119|       |	return (ARCHIVE_OK);
  120|       |#else
  121|       |	/* Return ARCHIVE_WARN since this always uses an external program. */
  122|    238|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|    238|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  123|    238|	    "Using external lzop program for lzop decompression");
  124|    238|	return (ARCHIVE_WARN);
  ------------------
  |  |  194|    238|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  125|    238|#endif
  126|    238|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  134|    275|{
  135|    275|	const unsigned char *p;
  136|    275|	ssize_t avail;
  137|       |
  138|    275|	(void)self; /* UNUSED */
  139|       |
  140|    275|	p = __archive_read_filter_ahead(filter, LZOP_HEADER_MAGIC_LEN, &avail);
  ------------------
  |  |   68|    275|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  141|    275|	if (p == NULL || avail == 0)
  ------------------
  |  Branch (141:6): [True: 4, False: 271]
  |  Branch (141:19): [True: 0, False: 271]
  ------------------
  142|      4|		return (0);
  143|       |
  144|    271|	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   67|    271|#define LZOP_HEADER_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a"
  ------------------
              	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   68|    271|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  |  Branch (144:6): [True: 271, False: 0]
  ------------------
  145|    271|		return (0);
  146|       |
  147|      0|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      0|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  148|    271|}

archive_read_support_filter_rpm:
   86|    238|{
   87|    238|	struct archive_read *a = (struct archive_read *)_a;
   88|       |
   89|    238|	return __archive_read_register_bidder(a, NULL, "rpm",
   90|    238|			&rpm_bidder_vtable);
   91|    238|}
archive_read_support_filter_rpm.c:rpm_bidder_bid:
   96|    275|{
   97|    275|	const unsigned char *b;
   98|    275|	ssize_t avail;
   99|    275|	int bits_checked;
  100|       |
  101|    275|	(void)self; /* UNUSED */
  102|       |
  103|    275|	b = __archive_read_filter_ahead(filter, 8, &avail);
  104|    275|	if (b == NULL)
  ------------------
  |  Branch (104:6): [True: 4, False: 271]
  ------------------
  105|      4|		return (0);
  106|       |
  107|    271|	bits_checked = 0;
  108|       |	/*
  109|       |	 * Verify Header Magic Bytes : 0XED 0XAB 0XEE 0XDB
  110|       |	 */
  111|    271|	if (memcmp(b, "\xED\xAB\xEE\xDB", 4) != 0)
  ------------------
  |  Branch (111:6): [True: 266, False: 5]
  ------------------
  112|    266|		return (0);
  113|      5|	bits_checked += 32;
  114|       |	/*
  115|       |	 * Check major version.
  116|       |	 */
  117|      5|	if (b[4] != 3 && b[4] != 4)
  ------------------
  |  Branch (117:6): [True: 5, False: 0]
  |  Branch (117:19): [True: 0, False: 5]
  ------------------
  118|      0|		return (0);
  119|      5|	bits_checked += 8;
  120|       |	/*
  121|       |	 * Check package type; binary or source.
  122|       |	 */
  123|      5|	if (b[6] != 0)
  ------------------
  |  Branch (123:6): [True: 0, False: 5]
  ------------------
  124|      0|		return (0);
  125|      5|	bits_checked += 8;
  126|      5|	if (b[7] != 0 && b[7] != 1)
  ------------------
  |  Branch (126:6): [True: 5, False: 0]
  |  Branch (126:19): [True: 0, False: 5]
  ------------------
  127|      0|		return (0);
  128|      5|	bits_checked += 8;
  129|       |
  130|      5|	return (bits_checked);
  131|      5|}
archive_read_support_filter_rpm.c:rpm_bidder_init:
  141|      5|{
  142|      5|	struct rpm   *rpm;
  143|       |
  144|      5|	self->code = ARCHIVE_FILTER_RPM;
  ------------------
  |  |  276|      5|#define	ARCHIVE_FILTER_RPM	8
  ------------------
  145|      5|	self->name = "rpm";
  146|       |
  147|      5|	rpm = (struct rpm *)calloc(1, sizeof(*rpm));
  148|      5|	if (rpm == NULL) {
  ------------------
  |  Branch (148:6): [True: 0, False: 5]
  ------------------
  149|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  150|      0|		    "Can't allocate data for rpm");
  151|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  152|      0|	}
  153|       |
  154|      5|	self->data = rpm;
  155|      5|	rpm->state = ST_LEAD;
  156|      5|	self->vtable = &rpm_reader_vtable;
  157|       |
  158|      5|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  159|      5|}
archive_read_support_filter_rpm.c:rpm_filter_read:
  169|     11|{
  170|     11|	struct rpm *rpm;
  171|     11|	const unsigned char *b;
  172|     11|	ssize_t avail_in, total, used;
  173|     11|	size_t n;
  174|     11|	uint64_t section;
  175|     11|	uint64_t bytes;
  176|       |
  177|     11|	rpm = (struct rpm *)self->data;
  178|     11|	*buff = NULL;
  179|     11|	total = avail_in = 0;
  180|     11|	b = NULL;
  181|     11|	used = 0;
  182|     31|	do {
  183|     31|		if (b == NULL) {
  ------------------
  |  Branch (183:7): [True: 11, False: 20]
  ------------------
  184|     11|			b = __archive_read_filter_ahead(self->upstream, 1,
  185|     11|			    &avail_in);
  186|     11|			if (b == NULL) {
  ------------------
  |  Branch (186:8): [True: 1, False: 10]
  ------------------
  187|      1|				if (avail_in < 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 1]
  ------------------
  188|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  189|      1|				else
  190|      1|					break;
  191|      1|			}
  192|     11|		}
  193|       |
  194|     30|		switch (rpm->state) {
  ------------------
  |  Branch (194:11): [True: 0, False: 30]
  ------------------
  195|      5|		case ST_LEAD:
  ------------------
  |  Branch (195:3): [True: 5, False: 25]
  ------------------
  196|      5|			if (rpm->total_in + avail_in < RPM_LEAD_SIZE)
  ------------------
  |  |   56|      5|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  |  Branch (196:8): [True: 0, False: 5]
  ------------------
  197|      0|				used += avail_in;
  198|      5|			else {
  199|      5|				n = (size_t)(RPM_LEAD_SIZE - rpm->total_in);
  ------------------
  |  |   56|      5|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  200|      5|				used += n;
  201|      5|				b += n;
  202|      5|				rpm->state = ST_HEADER;
  203|      5|				rpm->hpos = 0;
  204|      5|				rpm->hlen = 0;
  205|      5|				rpm->first_header = 1;
  206|      5|			}
  207|      5|			break;
  208|     10|		case ST_HEADER:
  ------------------
  |  Branch (208:3): [True: 10, False: 20]
  ------------------
  209|     10|			n = rpm_limit_bytes(RPM_MIN_HEAD_SIZE - rpm->hpos,
  ------------------
  |  |   57|     10|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  210|     10|			    avail_in - used);
  211|     10|			memcpy(rpm->header+rpm->hpos, b, n);
  212|     10|			b += n;
  213|     10|			used += n;
  214|     10|			rpm->hpos += n;
  215|       |
  216|     10|			if (rpm->hpos == RPM_MIN_HEAD_SIZE) {
  ------------------
  |  |   57|     10|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  |  Branch (216:8): [True: 10, False: 0]
  ------------------
  217|     10|				if (rpm->header[0] != 0x8e ||
  ------------------
  |  Branch (217:9): [True: 5, False: 5]
  ------------------
  218|     10|				    rpm->header[1] != 0xad ||
  ------------------
  |  Branch (218:9): [True: 0, False: 5]
  ------------------
  219|     10|				    rpm->header[2] != 0xe8 ||
  ------------------
  |  Branch (219:9): [True: 0, False: 5]
  ------------------
  220|     10|				    rpm->header[3] != 0x01) {
  ------------------
  |  Branch (220:9): [True: 0, False: 5]
  ------------------
  221|      5|					if (rpm->first_header) {
  ------------------
  |  Branch (221:10): [True: 0, False: 5]
  ------------------
  222|      0|						archive_set_error(
  223|      0|						    &self->archive->archive,
  224|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  225|      0|						    "Unrecognized rpm header");
  226|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  227|      0|					}
  228|      5|					rpm->state = ST_ARCHIVE;
  229|      5|					*buff = rpm->header;
  230|      5|					total = RPM_MIN_HEAD_SIZE;
  ------------------
  |  |   57|      5|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  231|      5|					break;
  232|      5|				}
  233|       |				/* Calculate 'Header' length. */
  234|      5|				section = archive_be32dec(rpm->header+8);
  235|      5|				bytes = archive_be32dec(rpm->header+12);
  236|      5|				rpm->hlen = rpm->hpos + section * 16 + bytes;
  237|      5|				rpm->state = ST_HEADER_DATA;
  238|      5|				rpm->first_header = 0;
  239|      5|			}
  240|      5|			break;
  241|      5|		case ST_HEADER_DATA:
  ------------------
  |  Branch (241:3): [True: 5, False: 25]
  ------------------
  242|      5|			n = rpm_limit_bytes(rpm->hlen - rpm->hpos,
  243|      5|			    avail_in - used);
  244|      5|			b += n;
  245|      5|			used += n;
  246|      5|			rpm->hpos += n;
  247|      5|			if (rpm->hpos == rpm->hlen)
  ------------------
  |  Branch (247:8): [True: 5, False: 0]
  ------------------
  248|      5|				rpm->state = ST_PADDING;
  249|      5|			break;
  250|      5|		case ST_PADDING:
  ------------------
  |  Branch (250:3): [True: 5, False: 25]
  ------------------
  251|      5|			while (used < avail_in) {
  ------------------
  |  Branch (251:11): [True: 5, False: 0]
  ------------------
  252|      5|				if (*b != 0) {
  ------------------
  |  Branch (252:9): [True: 5, False: 0]
  ------------------
  253|       |					/* Read next header. */
  254|      5|					rpm->state = ST_HEADER;
  255|      5|					rpm->hpos = 0;
  256|      5|					rpm->hlen = 0;
  257|      5|					break;
  258|      5|				}
  259|      0|				b++;
  260|      0|				used++;
  261|      0|			}
  262|      5|			break;
  263|      5|		case ST_ARCHIVE:
  ------------------
  |  Branch (263:3): [True: 5, False: 25]
  ------------------
  264|      5|			*buff = b;
  265|      5|			total = avail_in;
  266|      5|			used = avail_in;
  267|      5|			break;
  268|     30|		}
  269|     30|		if (used == avail_in) {
  ------------------
  |  Branch (269:7): [True: 5, False: 25]
  ------------------
  270|      5|			rpm->total_in += used;
  271|      5|			__archive_read_filter_consume(self->upstream, used);
  272|      5|			b = NULL;
  273|      5|			used = 0;
  274|      5|		}
  275|     30|	} while (total == 0 && avail_in > 0);
  ------------------
  |  Branch (275:11): [True: 20, False: 10]
  |  Branch (275:25): [True: 20, False: 0]
  ------------------
  276|       |
  277|     11|	if (used > 0 && b != NULL) {
  ------------------
  |  Branch (277:6): [True: 5, False: 6]
  |  Branch (277:18): [True: 5, False: 0]
  ------------------
  278|      5|		rpm->total_in += used;
  279|      5|		__archive_read_filter_consume(self->upstream, used);
  280|      5|	}
  281|     11|	return (total);
  282|     11|}
archive_read_support_filter_rpm.c:rpm_limit_bytes:
  163|     15|{
  164|     15|	return (bytes > max ? max : (size_t)bytes);
  ------------------
  |  Branch (164:10): [True: 0, False: 15]
  ------------------
  165|     15|}
archive_read_support_filter_rpm.c:rpm_filter_close:
  286|      5|{
  287|      5|	struct rpm *rpm;
  288|       |
  289|      5|	rpm = (struct rpm *)self->data;
  290|      5|	free(rpm);
  291|       |
  292|      5|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  293|      5|}

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

archive_read_support_filter_xz:
  117|    238|{
  118|    238|	struct archive_read *a = (struct archive_read *)_a;
  119|       |
  120|    238|	if (__archive_read_register_bidder(a, NULL, "xz",
  ------------------
  |  Branch (120:6): [True: 0, False: 238]
  ------------------
  121|    238|				&xz_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  122|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  123|       |
  124|    238|#if HAVE_LZMA_H && HAVE_LIBLZMA
  125|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  126|       |#else
  127|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  128|       |	    "Using external xz program for xz decompression");
  129|       |	return (ARCHIVE_WARN);
  130|       |#endif
  131|    238|}
archive_read_support_filter_lzma:
  149|    238|{
  150|    238|	struct archive_read *a = (struct archive_read *)_a;
  151|       |
  152|    238|	if (__archive_read_register_bidder(a, NULL, "lzma",
  ------------------
  |  Branch (152:6): [True: 0, False: 238]
  ------------------
  153|    238|				&lzma_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  154|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  155|       |
  156|    238|#if HAVE_LZMA_H && HAVE_LIBLZMA
  157|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  158|       |#else
  159|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  160|       |	    "Using external lzma program for lzma decompression");
  161|       |	return (ARCHIVE_WARN);
  162|       |#endif
  163|    238|}
archive_read_support_filter_lzip:
  182|    238|{
  183|    238|	struct archive_read *a = (struct archive_read *)_a;
  184|       |
  185|    238|	if (__archive_read_register_bidder(a, NULL, "lzip",
  ------------------
  |  Branch (185:6): [True: 0, False: 238]
  ------------------
  186|    238|				&lzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  187|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  188|       |
  189|    238|#if HAVE_LZMA_H && HAVE_LIBLZMA
  190|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  191|       |#else
  192|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  193|       |	    "Using external lzip program for lzip decompression");
  194|       |	return (ARCHIVE_WARN);
  195|       |#endif
  196|    238|}
archive_read_support_filter_xz.c:xz_bidder_bid:
  204|    275|{
  205|    275|	const unsigned char *buffer;
  206|    275|	ssize_t avail;
  207|       |
  208|    275|	(void)self; /* UNUSED */
  209|       |
  210|    275|	buffer = __archive_read_filter_ahead(filter, 6, &avail);
  211|    275|	if (buffer == NULL)
  ------------------
  |  Branch (211:6): [True: 4, False: 271]
  ------------------
  212|      4|		return (0);
  213|       |
  214|       |	/*
  215|       |	 * Verify Header Magic Bytes : FD 37 7A 58 5A 00
  216|       |	 */
  217|    271|	if (memcmp(buffer, "\xFD\x37\x7A\x58\x5A\x00", 6) != 0)
  ------------------
  |  Branch (217:6): [True: 271, False: 0]
  ------------------
  218|    271|		return (0);
  219|       |
  220|      0|	return (48);
  221|    271|}
archive_read_support_filter_xz.c:lzip_has_member:
  344|    275|{
  345|    275|	const unsigned char *buffer;
  346|    275|	ssize_t avail;
  347|    275|	int bits_checked;
  348|    275|	int log2dic;
  349|       |
  350|    275|	buffer = __archive_read_filter_ahead(filter, 6, &avail);
  351|    275|	if (buffer == NULL)
  ------------------
  |  Branch (351:6): [True: 4, False: 271]
  ------------------
  352|      4|		return (0);
  353|       |
  354|       |	/*
  355|       |	 * Verify Header Magic Bytes : 4C 5A 49 50 (`LZIP')
  356|       |	 */
  357|    271|	bits_checked = 0;
  358|    271|	if (memcmp(buffer, "LZIP", 4) != 0)
  ------------------
  |  Branch (358:6): [True: 271, False: 0]
  ------------------
  359|    271|		return (0);
  360|      0|	bits_checked += 32;
  361|       |
  362|       |	/* A version number must be 0 or 1 */
  363|      0|	if (buffer[4] != 0 && buffer[4] != 1)
  ------------------
  |  Branch (363:6): [True: 0, False: 0]
  |  Branch (363:24): [True: 0, False: 0]
  ------------------
  364|      0|		return (0);
  365|      0|	bits_checked += 8;
  366|       |
  367|       |	/* Dictionary size. */
  368|      0|	log2dic = buffer[5] & 0x1f;
  369|      0|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (369:6): [True: 0, False: 0]
  |  Branch (369:22): [True: 0, False: 0]
  ------------------
  370|      0|		return (0);
  371|      0|	bits_checked += 8;
  372|       |
  373|      0|	return (bits_checked);
  374|      0|}
archive_read_support_filter_xz.c:lzma_bidder_bid:
  238|    275|{
  239|    275|	const unsigned char *buffer;
  240|    275|	ssize_t avail;
  241|    275|	uint32_t dicsize;
  242|    275|	uint64_t uncompressed_size;
  243|    275|	int bits_checked;
  244|       |
  245|    275|	(void)self; /* UNUSED */
  246|       |
  247|    275|	buffer = __archive_read_filter_ahead(filter, 14, &avail);
  248|    275|	if (buffer == NULL)
  ------------------
  |  Branch (248:6): [True: 4, False: 271]
  ------------------
  249|      4|		return (0);
  250|       |
  251|       |	/* First byte of raw LZMA stream is commonly 0x5d.
  252|       |	 * The first byte is a special number, which consists of
  253|       |	 * three parameters of LZMA compression, a number of literal
  254|       |	 * context bits(which is from 0 to 8, default is 3), a number
  255|       |	 * of literal pos bits(which is from 0 to 4, default is 0),
  256|       |	 * a number of pos bits(which is from 0 to 4, default is 2).
  257|       |	 * The first byte is made by
  258|       |	 * (pos bits * 5 + literal pos bit) * 9 + * literal contest bit,
  259|       |	 * and so the default value in this field is
  260|       |	 * (2 * 5 + 0) * 9 + 3 = 0x5d.
  261|       |	 * lzma of LZMA SDK has options to change those parameters.
  262|       |	 * It means a range of this field is from 0 to 224. And lzma of
  263|       |	 * XZ Utils with option -e records 0x5e in this field. */
  264|       |	/* NOTE: If this checking of the first byte increases false
  265|       |	 * recognition, we should allow only 0x5d and 0x5e for the first
  266|       |	 * byte of LZMA stream. */
  267|    271|	bits_checked = 0;
  268|    271|	if (buffer[0] > (4 * 5 + 4) * 9 + 8)
  ------------------
  |  Branch (268:6): [True: 13, False: 258]
  ------------------
  269|     13|		return (0);
  270|       |	/* Most likely value in the first byte of LZMA stream. */
  271|    258|	if (buffer[0] == 0x5d || buffer[0] == 0x5e)
  ------------------
  |  Branch (271:6): [True: 0, False: 258]
  |  Branch (271:27): [True: 0, False: 258]
  ------------------
  272|      0|		bits_checked += 8;
  273|       |
  274|       |	/* Sixth through fourteenth bytes are uncompressed size,
  275|       |	 * stored in little-endian order. `-1' means uncompressed
  276|       |	 * size is unknown and lzma of XZ Utils always records `-1'
  277|       |	 * in this field. */
  278|    258|	uncompressed_size = archive_le64dec(buffer+5);
  279|    258|	if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1))
  ------------------
  |  |  178|    258|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  |  Branch (279:6): [True: 0, False: 258]
  ------------------
  280|      0|		bits_checked += 64;
  281|       |
  282|       |	/* Second through fifth bytes are dictionary size, stored in
  283|       |	 * little-endian order. The minimum dictionary size is
  284|       |	 * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option
  285|       |	 * -d12 and the maximum dictionary size is 1 << 29(512MiB)
  286|       |	 * which the one uses with option -d29.
  287|       |	 * NOTE: A comment of LZMA SDK source code says this dictionary
  288|       |	 * range is from 1 << 12 to 1 << 30. */
  289|    258|	dicsize = archive_le32dec(buffer+1);
  290|    258|	switch (dicsize) {
  291|      0|	case 0x00001000:/* lzma of LZMA SDK option -d12. */
  ------------------
  |  Branch (291:2): [True: 0, False: 258]
  ------------------
  292|      0|	case 0x00002000:/* lzma of LZMA SDK option -d13. */
  ------------------
  |  Branch (292:2): [True: 0, False: 258]
  ------------------
  293|      0|	case 0x00004000:/* lzma of LZMA SDK option -d14. */
  ------------------
  |  Branch (293:2): [True: 0, False: 258]
  ------------------
  294|      0|	case 0x00008000:/* lzma of LZMA SDK option -d15. */
  ------------------
  |  Branch (294:2): [True: 0, False: 258]
  ------------------
  295|      0|	case 0x00010000:/* lzma of XZ Utils option -0 and -1.
  ------------------
  |  Branch (295:2): [True: 0, False: 258]
  ------------------
  296|       |			 * lzma of LZMA SDK option -d16. */
  297|      0|	case 0x00020000:/* lzma of LZMA SDK option -d17. */
  ------------------
  |  Branch (297:2): [True: 0, False: 258]
  ------------------
  298|      0|	case 0x00040000:/* lzma of LZMA SDK option -d18. */
  ------------------
  |  Branch (298:2): [True: 0, False: 258]
  ------------------
  299|      0|	case 0x00080000:/* lzma of XZ Utils option -2.
  ------------------
  |  Branch (299:2): [True: 0, False: 258]
  ------------------
  300|       |			 * lzma of LZMA SDK option -d19. */
  301|      0|	case 0x00100000:/* lzma of XZ Utils option -3.
  ------------------
  |  Branch (301:2): [True: 0, False: 258]
  ------------------
  302|       |			 * lzma of LZMA SDK option -d20. */
  303|      0|	case 0x00200000:/* lzma of XZ Utils option -4.
  ------------------
  |  Branch (303:2): [True: 0, False: 258]
  ------------------
  304|       |			 * lzma of LZMA SDK option -d21. */
  305|      0|	case 0x00400000:/* lzma of XZ Utils option -5.
  ------------------
  |  Branch (305:2): [True: 0, False: 258]
  ------------------
  306|       |			 * lzma of LZMA SDK option -d22. */
  307|      0|	case 0x00800000:/* lzma of XZ Utils option -6.
  ------------------
  |  Branch (307:2): [True: 0, False: 258]
  ------------------
  308|       |			 * lzma of LZMA SDK option -d23. */
  309|      0|	case 0x01000000:/* lzma of XZ Utils option -7.
  ------------------
  |  Branch (309:2): [True: 0, False: 258]
  ------------------
  310|       |			 * lzma of LZMA SDK option -d24. */
  311|      0|	case 0x02000000:/* lzma of XZ Utils option -8.
  ------------------
  |  Branch (311:2): [True: 0, False: 258]
  ------------------
  312|       |			 * lzma of LZMA SDK option -d25. */
  313|      0|	case 0x04000000:/* lzma of XZ Utils option -9.
  ------------------
  |  Branch (313:2): [True: 0, False: 258]
  ------------------
  314|       |			 * lzma of LZMA SDK option -d26. */
  315|      0|	case 0x08000000:/* lzma of LZMA SDK option -d27. */
  ------------------
  |  Branch (315:2): [True: 0, False: 258]
  ------------------
  316|      0|		bits_checked += 32;
  317|      0|		break;
  318|    258|	default:
  ------------------
  |  Branch (318:2): [True: 258, False: 0]
  ------------------
  319|       |		/* If a memory usage for encoding was not enough on
  320|       |		 * the platform where LZMA stream was made, lzma of
  321|       |		 * XZ Utils automatically decreased the dictionary
  322|       |		 * size to enough memory for encoding by 1Mi bytes
  323|       |		 * (1 << 20).*/
  324|    258|		if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 &&
  ------------------
  |  Branch (324:7): [True: 43, False: 215]
  |  Branch (324:32): [True: 4, False: 39]
  ------------------
  325|    258|		    (dicsize & ((1 << 20)-1)) == 0 &&
  ------------------
  |  Branch (325:7): [True: 0, False: 4]
  ------------------
  326|    258|		    bits_checked == 8 + 64) {
  ------------------
  |  Branch (326:7): [True: 0, False: 0]
  ------------------
  327|      0|			bits_checked += 32;
  328|      0|			break;
  329|      0|		}
  330|       |		/* Otherwise dictionary size is unlikely. But it is
  331|       |		 * possible that someone makes lzma stream with
  332|       |		 * liblzma/LZMA SDK in one's dictionary size. */
  333|    258|		return (0);
  334|    258|	}
  335|       |
  336|       |	/* TODO: The above test is still very weak.  It would be
  337|       |	 * good to do better. */
  338|       |
  339|      0|	return (bits_checked);
  340|    258|}
archive_read_support_filter_xz.c:lzip_bidder_bid:
  379|    275|{
  380|       |
  381|    275|	(void)self; /* UNUSED */
  382|    275|	return (lzip_has_member(filter));
  383|    275|}

archive_read_support_filter_zstd:
   88|    238|{
   89|    238|	struct archive_read *a = (struct archive_read *)_a;
   90|       |
   91|    238|	if (__archive_read_register_bidder(a, NULL, "zstd",
  ------------------
  |  Branch (91:6): [True: 0, False: 238]
  ------------------
   92|    238|				&zstd_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   93|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   94|       |
   95|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
   96|       |	return (ARCHIVE_OK);
   97|       |#else
   98|    238|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|    238|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   99|    238|	    "Using external zstd program for zstd decompression");
  100|    238|	return (ARCHIVE_WARN);
  ------------------
  |  |  194|    238|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  101|    238|#endif
  102|    238|}
archive_read_support_filter_zstd.c:zstd_bidder_bid:
  110|    275|{
  111|    275|	const unsigned char *buffer;
  112|    275|	ssize_t avail;
  113|    275|	unsigned prefix;
  114|       |
  115|       |	/* Zstd frame magic values */
  116|    275|	unsigned zstd_magic = 0xFD2FB528U;
  117|    275|	unsigned zstd_magic_skippable_start = 0x184D2A50U;
  118|    275|	unsigned zstd_magic_skippable_mask = 0xFFFFFFF0;
  119|       |
  120|    275|	(void) self; /* UNUSED */
  121|       |
  122|    275|	buffer = __archive_read_filter_ahead(filter, 4, &avail);
  123|    275|	if (buffer == NULL)
  ------------------
  |  Branch (123:6): [True: 4, False: 271]
  ------------------
  124|      4|		return (0);
  125|       |
  126|    271|	prefix = archive_le32dec(buffer);
  127|    271|	if (prefix == zstd_magic)
  ------------------
  |  Branch (127:6): [True: 0, False: 271]
  ------------------
  128|      0|		return (32);
  129|    271|	if ((prefix & zstd_magic_skippable_mask) == zstd_magic_skippable_start)
  ------------------
  |  Branch (129:6): [True: 0, False: 271]
  ------------------
  130|      0|		return (32);
  131|       |
  132|    271|	return (0);
  133|    271|}

archive_read_support_format_7zip:
  442|    238|{
  443|    238|	struct archive_read *a = (struct archive_read *)_a;
  444|    238|	struct _7zip *zip;
  445|    238|	int r;
  446|       |
  447|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  449|       |
  450|    238|	zip = calloc(1, sizeof(*zip));
  451|    238|	if (zip == NULL) {
  ------------------
  |  Branch (451:6): [True: 0, False: 238]
  ------------------
  452|      0|		archive_set_error(&a->archive, ENOMEM,
  453|      0|		    "Can't allocate 7zip data");
  454|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  455|      0|	}
  456|       |
  457|       |	/*
  458|       |	 * Until enough data has been read, we cannot tell about
  459|       |	 * any encrypted entries yet.
  460|       |	 */
  461|    238|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|    238|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  462|       |
  463|       |
  464|    238|	r = __archive_read_register_format(a,
  465|    238|	    zip,
  466|    238|	    "7zip",
  467|    238|	    archive_read_format_7zip_bid,
  468|    238|	    NULL,
  469|    238|	    archive_read_format_7zip_read_header,
  470|    238|	    archive_read_format_7zip_read_data,
  471|    238|	    archive_read_format_7zip_read_data_skip,
  472|    238|	    NULL,
  473|    238|	    archive_read_format_7zip_cleanup,
  474|    238|	    archive_read_support_format_7zip_capabilities,
  475|    238|	    archive_read_format_7zip_has_encrypted_entries);
  476|       |
  477|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (477:6): [True: 0, False: 238]
  ------------------
  478|      0|		free(zip);
  479|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  480|    238|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  484|     14|{
  485|     14|	(void)a; /* UNUSED */
  486|     14|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  357|     14|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  487|     14|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  358|     14|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  488|     14|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  493|      7|{
  494|      7|	if (_a && _a->format) {
  ------------------
  |  Branch (494:6): [True: 7, False: 0]
  |  Branch (494:12): [True: 7, False: 0]
  ------------------
  495|      7|		struct _7zip * zip = (struct _7zip *)_a->format->data;
  496|      7|		if (zip) {
  ------------------
  |  Branch (496:7): [True: 7, False: 0]
  ------------------
  497|      7|			return zip->has_encrypted_entries;
  498|      7|		}
  499|      7|	}
  500|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  501|      7|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  505|    236|{
  506|    236|	const char *p;
  507|       |
  508|       |	/* If someone has already bid more than 32, then avoid
  509|       |	   trashing the look-ahead buffers with a seek. */
  510|    236|	if (best_bid > 32)
  ------------------
  |  Branch (510:6): [True: 13, False: 223]
  ------------------
  511|     13|		return (-1);
  512|       |
  513|    223|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL)
  ------------------
  |  Branch (513:6): [True: 5, False: 218]
  ------------------
  514|      5|		return (0);
  515|       |
  516|       |	/* If first six bytes are the 7-Zip signature,
  517|       |	 * return the bid right now. */
  518|    218|	if (memcmp(p, _7ZIP_SIGNATURE, 6) == 0)
  ------------------
  |  |   59|    218|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (518:6): [True: 4, False: 214]
  ------------------
  519|      4|		return (48);
  520|       |
  521|       |	/*
  522|       |	 * It may a 7-Zip SFX archive file. If first two bytes are
  523|       |	 * 'M' and 'Z' available on Windows or first four bytes are
  524|       |	 * "\x7F\x45LF" available on posix like system, seek the 7-Zip
  525|       |	 * signature. Although we will perform a seek when reading
  526|       |	 * a header, what we do not use __archive_read_seek() here is
  527|       |	 * due to a bidding performance.
  528|       |	 */
  529|    214|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (529:7): [True: 24, False: 190]
  |  Branch (529:22): [True: 22, False: 2]
  |  Branch (529:38): [True: 3, False: 189]
  ------------------
  530|     25|		ssize_t offset = SFX_MIN_ADDR;
  ------------------
  |  |   60|     25|#define SFX_MIN_ADDR	0x27000
  ------------------
  531|     25|		ssize_t window = 4096;
  532|     25|		ssize_t bytes_avail;
  533|    149|		while (offset + window <= (SFX_MAX_ADDR)) {
  ------------------
  |  |   61|    149|#define SFX_MAX_ADDR	0x60000
  ------------------
  |  Branch (533:10): [True: 144, False: 5]
  ------------------
  534|    144|			const char *buff = __archive_read_ahead(a,
  535|    144|					offset + window, &bytes_avail);
  536|    144|			if (buff == NULL) {
  ------------------
  |  Branch (536:8): [True: 119, False: 25]
  ------------------
  537|       |				/* Remaining bytes are less than window. */
  538|    119|				window >>= 1;
  539|    119|				if (window < 0x40)
  ------------------
  |  Branch (539:9): [True: 17, False: 102]
  ------------------
  540|     17|					return (0);
  541|    102|				continue;
  542|    119|			}
  543|     25|			p = buff + offset;
  544|   604k|			while (p + 32 < buff + bytes_avail) {
  ------------------
  |  Branch (544:11): [True: 604k, False: 22]
  ------------------
  545|   604k|				int step = check_7zip_header_in_sfx(p);
  546|   604k|				if (step == 0)
  ------------------
  |  Branch (546:9): [True: 3, False: 604k]
  ------------------
  547|      3|					return (48);
  548|   604k|				p += step;
  549|   604k|			}
  550|     22|			offset = p - buff;
  551|     22|		}
  552|     25|	}
  553|    194|	return (0);
  554|    214|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  558|   626k|{
  559|   626k|	switch ((unsigned char)p[5]) {
  560|    200|	case 0x1C:
  ------------------
  |  Branch (560:2): [True: 200, False: 626k]
  ------------------
  561|    200|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   59|    200|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (561:7): [True: 168, False: 32]
  ------------------
  562|    168|			return (6);
  563|       |		/*
  564|       |		 * Test the CRC because its extraction code has 7-Zip
  565|       |		 * Magic Code, so we should do this in order not to
  566|       |		 * make a mis-detection.
  567|       |		 */
  568|     32|		if (crc32(0, (const unsigned char *)p + 12, 20)
  ------------------
  |  Branch (568:7): [True: 26, False: 6]
  ------------------
  569|     32|			!= archive_le32dec(p + 8))
  570|     26|			return (6);
  571|       |		/* Hit the header! */
  572|      6|		return (0);
  573|  7.13k|	case 0x37: return (5);
  ------------------
  |  Branch (573:2): [True: 7.13k, False: 619k]
  ------------------
  574|    120|	case 0x7A: return (4);
  ------------------
  |  Branch (574:2): [True: 120, False: 626k]
  ------------------
  575|    208|	case 0xBC: return (3);
  ------------------
  |  Branch (575:2): [True: 208, False: 626k]
  ------------------
  576|    228|	case 0xAF: return (2);
  ------------------
  |  Branch (576:2): [True: 228, False: 626k]
  ------------------
  577|    161|	case 0x27: return (1);
  ------------------
  |  Branch (577:2): [True: 161, False: 626k]
  ------------------
  578|   618k|	default: return (6);
  ------------------
  |  Branch (578:2): [True: 618k, False: 8.04k]
  ------------------
  579|   626k|	}
  580|   626k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  650|      8|{
  651|      8|	struct _7zip *zip = (struct _7zip *)a->format->data;
  652|      8|	struct _7zip_entry *zip_entry;
  653|      8|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  192|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  654|      8|	struct _7z_folder *folder = 0;
  655|      8|	uint64_t fidx = 0;
  656|       |
  657|       |	/*
  658|       |	 * It should be sufficient to call archive_read_next_header() for
  659|       |	 * a reader to determine if an entry is encrypted or not. If the
  660|       |	 * encryption of an entry is only detectable when calling
  661|       |	 * archive_read_data(), so be it. We'll do the same check there
  662|       |	 * as well.
  663|       |	 */
  664|      8|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|      8|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (664:6): [True: 7, False: 1]
  ------------------
  665|      7|		zip->has_encrypted_entries = 0;
  666|      7|	}
  667|       |
  668|      8|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  344|      8|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  669|      8|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (669:6): [True: 7, False: 1]
  ------------------
  670|      7|		a->archive.archive_format_name = "7-Zip";
  671|       |
  672|      8|	if (zip->entries == NULL) {
  ------------------
  |  Branch (672:6): [True: 7, False: 1]
  ------------------
  673|      7|		struct _7z_header_info header;
  674|       |
  675|      7|		memset(&header, 0, sizeof(header));
  676|      7|		r = slurp_central_directory(a, zip, &header);
  677|      7|		free_Header(&header);
  678|      7|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (678:7): [True: 5, False: 2]
  ------------------
  679|      5|			return (r);
  680|      2|		zip->entries_remaining = (size_t)zip->numFiles;
  681|      2|		zip->entry = zip->entries;
  682|      2|	} else {
  683|      1|		++zip->entry;
  684|      1|	}
  685|      3|	zip_entry = zip->entry;
  686|       |
  687|      3|	if (zip->entries_remaining <= 0 || zip_entry == NULL)
  ------------------
  |  Branch (687:6): [True: 1, False: 2]
  |  Branch (687:37): [True: 0, False: 2]
  ------------------
  688|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  689|      2|	--zip->entries_remaining;
  690|       |
  691|      2|	zip->entry_offset = 0;
  692|      2|	zip->end_of_entry = 0;
  693|      2|	zip->entry_crc32 = crc32(0, NULL, 0);
  694|       |
  695|       |	/* Setup a string conversion for a filename. */
  696|      2|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (696:6): [True: 2, False: 0]
  ------------------
  697|      2|		zip->sconv = archive_string_conversion_from_charset(
  698|      2|		    &a->archive, "UTF-16LE", 1);
  699|      2|		if (zip->sconv == NULL)
  ------------------
  |  Branch (699:7): [True: 0, False: 2]
  ------------------
  700|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  701|      2|	}
  702|       |
  703|       |	/* Figure out if the entry is encrypted by looking at the folder
  704|       |	   that is associated to the current 7zip entry. If the folder
  705|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  706|       |	   Hence the entry must also be encrypted. */
  707|      2|	if (zip_entry && zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (707:6): [True: 2, False: 0]
  |  Branch (707:19): [True: 2, False: 0]
  ------------------
  708|      2|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  709|      4|		for (fidx=0; folder && fidx<folder->numCoders; fidx++) {
  ------------------
  |  Branch (709:16): [True: 4, False: 0]
  |  Branch (709:26): [True: 2, False: 2]
  ------------------
  710|      2|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (710:11): [True: 2, False: 0]
  ------------------
  711|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |   74|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (711:5): [True: 0, False: 2]
  ------------------
  712|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |   75|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (712:5): [True: 0, False: 2]
  ------------------
  713|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |   76|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (713:5): [True: 0, False: 2]
  ------------------
  714|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  715|      0|					zip->has_encrypted_entries = 1;
  716|      0|					break;
  717|      0|				}
  718|      2|			}
  719|      2|		}
  720|      2|	}
  721|       |
  722|       |	/* Now that we've checked for encryption, if there were still no
  723|       |	 * encrypted entries found we can say for sure that there are none.
  724|       |	 */
  725|      2|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|      2|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (725:6): [True: 0, False: 2]
  ------------------
  726|      0|		zip->has_encrypted_entries = 0;
  727|      0|	}
  728|       |
  729|      2|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|      2|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (729:6): [True: 0, False: 2]
  ------------------
  730|      2|	    (const char *)zip_entry->utf16name,
  731|      2|	    zip_entry->name_len, zip->sconv) != 0) {
  732|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (732:7): [True: 0, False: 0]
  ------------------
  733|      0|			archive_set_error(&a->archive, ENOMEM,
  734|      0|			    "Can't allocate memory for Pathname");
  735|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  736|      0|		}
  737|      0|		archive_set_error(&a->archive,
  738|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  739|      0|		    "Pathname cannot be converted "
  740|      0|		    "from %s to current locale.",
  741|      0|		    archive_string_conversion_charset_name(zip->sconv));
  742|      0|		ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  743|      0|	}
  744|       |
  745|       |	/* Populate some additional entry fields: */
  746|      2|	archive_entry_set_mode(entry, zip_entry->mode);
  747|      2|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  221|      2|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (747:6): [True: 0, False: 2]
  ------------------
  748|      0|		archive_entry_set_mtime(entry, zip_entry->mtime,
  749|      0|			zip_entry->mtime_ns);
  750|      2|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  223|      2|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (750:6): [True: 1, False: 1]
  ------------------
  751|      1|		archive_entry_set_ctime(entry, zip_entry->ctime,
  752|      1|		    zip_entry->ctime_ns);
  753|      2|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  222|      2|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (753:6): [True: 0, False: 2]
  ------------------
  754|      0|		archive_entry_set_atime(entry, zip_entry->atime,
  755|      0|		    zip_entry->atime_ns);
  756|      2|	if (zip_entry->ssIndex != (uint32_t)-1) {
  ------------------
  |  Branch (756:6): [True: 2, False: 0]
  ------------------
  757|      2|		zip->entry_bytes_remaining =
  758|      2|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
  759|      2|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
  760|      2|	} else {
  761|      0|		zip->entry_bytes_remaining = 0;
  762|      0|		archive_entry_set_size(entry, 0);
  763|      0|	}
  764|       |
  765|       |	// These attributes are supported by the windows implementation of archive_write_disk.
  766|      2|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  121|      2|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  125|      2|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  129|      2|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  767|       |
  768|      2|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (768:6): [True: 0, False: 2]
  ------------------
  769|      0|		char *fflags_text, *ptr;
  770|       |		/* allocate for "rdonly,hidden,system," */
  771|      0|		fflags_text = malloc(22 * sizeof(char));
  772|      0|		if (fflags_text != NULL) {
  ------------------
  |  Branch (772:7): [True: 0, False: 0]
  ------------------
  773|      0|			ptr = fflags_text; 
  774|      0|			if (zip_entry->attr & FILE_ATTRIBUTE_READONLY) { 
  ------------------
  |  |  121|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (774:8): [True: 0, False: 0]
  ------------------
  775|      0| 			strcpy(ptr, "rdonly,"); 
  776|      0| 			ptr = ptr + 7; 
  777|      0| 		} 
  778|      0| 		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN) { 
  ------------------
  |  |  125|      0|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (778:8): [True: 0, False: 0]
  ------------------
  779|      0| 			strcpy(ptr, "hidden,"); 
  780|      0| 			ptr = ptr + 7; 
  781|      0| 		} 
  782|      0| 		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM) { 
  ------------------
  |  |  129|      0|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (782:8): [True: 0, False: 0]
  ------------------
  783|      0| 			strcpy(ptr, "system,"); 
  784|      0| 			ptr = ptr + 7; 
  785|      0| 		} 
  786|      0| 		if (ptr > fflags_text) { 
  ------------------
  |  Branch (786:8): [True: 0, False: 0]
  ------------------
  787|       | 			/* Delete trailing comma */ 
  788|      0| 			*(ptr - 1) = '\0'; 
  789|      0| 			archive_entry_copy_fflags_text(entry, 
  790|      0|				fflags_text); 
  791|      0| 		} 
  792|      0| 		free(fflags_text); 
  793|      0|		}
  794|      0|	}
  795|       |
  796|       |	/* If there's no body, force read_data() to return EOF immediately. */
  797|      2|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (797:6): [True: 0, False: 2]
  ------------------
  798|      0|		zip->end_of_entry = 1;
  799|       |
  800|      2|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  184|      2|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  186|      2|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (800:6): [True: 0, False: 2]
  ------------------
  801|      0|		unsigned char *symname = NULL;
  802|      0|		size_t symsize = 0;
  803|       |
  804|       |		/*
  805|       |		 * Symbolic-name is recorded as its contents. We have to
  806|       |		 * read the contents at this time.
  807|       |		 */
  808|      0|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (808:10): [True: 0, False: 0]
  ------------------
  809|      0|			const void *buff;
  810|      0|			unsigned char *mem;
  811|      0|			size_t size;
  812|      0|			int64_t offset;
  813|       |
  814|      0|			r = archive_read_format_7zip_read_data(a, &buff,
  815|      0|				&size, &offset);
  816|      0|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (816:8): [True: 0, False: 0]
  ------------------
  817|      0|				free(symname);
  818|      0|				return (r);
  819|      0|			}
  820|      0|			mem = realloc(symname, symsize + size + 1);
  821|      0|			if (mem == NULL) {
  ------------------
  |  Branch (821:8): [True: 0, False: 0]
  ------------------
  822|      0|				free(symname);
  823|      0|				archive_set_error(&a->archive, ENOMEM,
  824|      0|				    "Can't allocate memory for Symname");
  825|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  826|      0|			}
  827|      0|			symname = mem;
  828|      0|			memcpy(symname+symsize, buff, size);
  829|      0|			symsize += size;
  830|      0|		}
  831|      0|		if (symsize == 0) {
  ------------------
  |  Branch (831:7): [True: 0, False: 0]
  ------------------
  832|       |			/* If there is no symname, handle it as a regular
  833|       |			 * file. */
  834|      0|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  835|      0|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  836|      0|			archive_entry_set_mode(entry, zip_entry->mode);
  837|      0|		} else {
  838|      0|			symname[symsize] = '\0';
  839|      0|			archive_entry_copy_symlink(entry,
  840|      0|			    (const char *)symname);
  841|      0|		}
  842|      0|		free(symname);
  843|      0|		archive_entry_set_size(entry, 0);
  844|      0|	}
  845|       |
  846|       |	/* Set up a more descriptive format name. */
  847|      2|	snprintf(zip->format_name, sizeof(zip->format_name), "7-Zip");
  848|      2|	a->archive.archive_format_name = zip->format_name;
  849|       |
  850|      2|	return (ret);
  851|      2|}
archive_read_support_format_7zip.c:slurp_central_directory:
 2988|      7|{
 2989|      7|	const unsigned char *p;
 2990|      7|	uint64_t next_header_offset;
 2991|      7|	uint64_t next_header_size;
 2992|      7|	uint32_t next_header_crc;
 2993|      7|	ssize_t bytes_avail;
 2994|      7|	int check_header_crc, r;
 2995|       |
 2996|      7|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL)
  ------------------
  |  Branch (2996:6): [True: 0, False: 7]
  ------------------
 2997|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2998|       |
 2999|      7|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (2999:7): [True: 0, False: 7]
  |  Branch (2999:22): [True: 0, False: 0]
  |  Branch (2999:38): [True: 3, False: 4]
  ------------------
 3000|       |		/* This is an executable ? Must be self-extracting... */
 3001|      3|		r = skip_sfx(a, bytes_avail);
 3002|      3|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  194|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (3002:7): [True: 0, False: 3]
  ------------------
 3003|      0|			return (r);
 3004|      3|		if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL)
  ------------------
  |  Branch (3004:7): [True: 0, False: 3]
  ------------------
 3005|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3006|      3|	}
 3007|      7|	zip->seek_base += 32;
 3008|       |
 3009|      7|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   59|      7|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3009:6): [True: 0, False: 7]
  ------------------
 3010|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3011|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3012|      0|	}
 3013|       |
 3014|       |	/* CRC check. */
 3015|      7|	if (crc32(0, (const unsigned char *)p + 12, 20)
  ------------------
  |  Branch (3015:6): [True: 4, False: 3]
  ------------------
 3016|      7|	    != archive_le32dec(p + 8)) {
 3017|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3018|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3019|       |		return (ARCHIVE_FATAL);
 3020|       |#endif
 3021|      4|	}
 3022|       |
 3023|      7|	next_header_offset = archive_le64dec(p + 12);
 3024|      7|	next_header_size = archive_le64dec(p + 20);
 3025|      7|	next_header_crc = archive_le32dec(p + 28);
 3026|       |
 3027|      7|	if (next_header_size == 0)
  ------------------
  |  Branch (3027:6): [True: 0, False: 7]
  ------------------
 3028|       |		/* There is no entry in an archive file. */
 3029|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3030|       |
 3031|      7|	if (((int64_t)next_header_offset) < 0) {
  ------------------
  |  Branch (3031:6): [True: 0, False: 7]
  ------------------
 3032|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3033|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3034|      0|	}
 3035|      7|	__archive_read_consume(a, 32);
 3036|      7|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3036:6): [True: 7, False: 0]
  ------------------
 3037|      7|		if (bytes_avail >= (ssize_t)next_header_offset)
  ------------------
  |  Branch (3037:7): [True: 7, False: 0]
  ------------------
 3038|      7|			__archive_read_consume(a, next_header_offset);
 3039|      0|		else if (__archive_read_seek(a,
  ------------------
  |  Branch (3039:12): [True: 0, False: 0]
  ------------------
 3040|      0|		    next_header_offset + zip->seek_base, SEEK_SET) < 0)
 3041|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3042|      7|	}
 3043|      7|	zip->stream_offset = next_header_offset;
 3044|      7|	zip->header_offset = next_header_offset;
 3045|      7|	zip->header_bytes_remaining = next_header_size;
 3046|      7|	zip->header_crc32 = 0;
 3047|      7|	zip->header_is_encoded = 0;
 3048|      7|	zip->header_is_being_read = 1;
 3049|      7|	zip->has_encrypted_entries = 0;
 3050|      7|	check_header_crc = 1;
 3051|       |
 3052|      7|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3052:6): [True: 0, False: 7]
  ------------------
 3053|      0|		archive_set_error(&a->archive,
 3054|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3055|      0|		    "Truncated 7-Zip file body");
 3056|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3057|      0|	}
 3058|       |	/* Parse ArchiveProperties. */
 3059|      7|	switch (p[0]) {
 3060|      0|	case kEncodedHeader:
  ------------------
  |  |  115|      0|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3060:2): [True: 0, False: 7]
  ------------------
 3061|       |		/*
 3062|       |		 * The archive has an encoded header and we have to decode it
 3063|       |		 * in order to parse the header correctly.
 3064|       |		 */
 3065|      0|		r = decode_encoded_header_info(a, &(zip->si));
 3066|       |
 3067|       |		/* Check the EncodedHeader CRC.*/
 3068|      0|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3068:7): [True: 0, False: 0]
  |  Branch (3068:17): [True: 0, False: 0]
  ------------------
 3069|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3070|       |			archive_set_error(&a->archive, -1,
 3071|       |			    "Damaged 7-Zip archive");
 3072|       |			r = -1;
 3073|       |#endif
 3074|      0|		}
 3075|      0|		if (r == 0) {
  ------------------
  |  Branch (3075:7): [True: 0, False: 0]
  ------------------
 3076|      0|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3076:8): [True: 0, False: 0]
  ------------------
 3077|      0|				next_header_crc = zip->si.ci.folders[0].digest;
 3078|      0|			else
 3079|      0|				check_header_crc = 0;
 3080|      0|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3080:8): [True: 0, False: 0]
  ------------------
 3081|      0|				read_consume(a);
 3082|      0|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3083|      0|			if (r == 0) {
  ------------------
  |  Branch (3083:8): [True: 0, False: 0]
  ------------------
 3084|      0|				zip->header_bytes_remaining =
 3085|      0|					zip->folder_outbytes_remaining;
 3086|      0|				r = seek_pack(a);
 3087|      0|			}
 3088|      0|		}
 3089|       |		/* Clean up StreamsInfo. */
 3090|      0|		free_StreamsInfo(&(zip->si));
 3091|      0|		memset(&(zip->si), 0, sizeof(zip->si));
 3092|      0|		if (r < 0)
  ------------------
  |  Branch (3092:7): [True: 0, False: 0]
  ------------------
 3093|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3094|      0|		zip->header_is_encoded = 1;
 3095|      0|		zip->header_crc32 = 0;
 3096|       |		/* FALL THROUGH */
 3097|      7|	case kHeader:
  ------------------
  |  |   94|      7|#define kHeader			0x01
  ------------------
  |  Branch (3097:2): [True: 7, False: 0]
  ------------------
 3098|       |		/*
 3099|       |		 * Parse the header.
 3100|       |		 */
 3101|      7|		errno = 0;
 3102|      7|		r = read_Header(a, header, zip->header_is_encoded);
 3103|      7|		if (r < 0) {
  ------------------
  |  Branch (3103:7): [True: 5, False: 2]
  ------------------
 3104|      5|			if (errno == ENOMEM)
  ------------------
  |  Branch (3104:8): [True: 0, False: 5]
  ------------------
 3105|      0|				archive_set_error(&a->archive, -1,
 3106|      0|				    "Couldn't allocate memory");
 3107|      5|			else
 3108|      5|				archive_set_error(&a->archive, -1,
 3109|      5|				    "Damaged 7-Zip archive");
 3110|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3111|      5|		}
 3112|       |
 3113|       |		/*
 3114|       |		 *  Must be kEnd.
 3115|       |		 */
 3116|      2|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |   93|      2|#define kEnd			0x00
  ------------------
  |  Branch (3116:7): [True: 0, False: 2]
  |  Branch (3116:42): [True: 0, False: 2]
  ------------------
 3117|      0|			archive_set_error(&a->archive, -1,
 3118|      0|			    "Malformed 7-Zip archive");
 3119|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3120|      0|		}
 3121|       |
 3122|       |		/* Check the Header CRC.*/
 3123|      2|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3123:7): [True: 2, False: 0]
  |  Branch (3123:27): [True: 2, False: 0]
  ------------------
 3124|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3125|       |			archive_set_error(&a->archive, -1,
 3126|       |			    "Malformed 7-Zip archive");
 3127|       |			return (ARCHIVE_FATAL);
 3128|       |#endif
 3129|      2|		}
 3130|      2|		break;
 3131|      0|	default:
  ------------------
  |  Branch (3131:2): [True: 0, False: 7]
  ------------------
 3132|      0|		archive_set_error(&a->archive, -1,
 3133|      0|		    "Unexpected Property ID = %X", p[0]);
 3134|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3135|      7|	}
 3136|       |
 3137|       |	/* Clean up variables be used for decoding the archive header */
 3138|      2|	zip->pack_stream_remaining = 0;
 3139|      2|	zip->pack_stream_index = 0;
 3140|      2|	zip->folder_outbytes_remaining = 0;
 3141|      2|	zip->uncompressed_buffer_bytes_remaining = 0;
 3142|      2|	zip->pack_stream_bytes_unconsumed = 0;
 3143|      2|	zip->header_is_being_read = 0;
 3144|       |
 3145|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3146|      7|}
archive_read_support_format_7zip.c:skip_sfx:
  584|      3|{
  585|      3|	const void *h;
  586|      3|	const char *p, *q;
  587|      3|	size_t skip, offset;
  588|      3|	ssize_t bytes, window;
  589|       |
  590|       |	/*
  591|       |	 * If bytes_avail > SFX_MIN_ADDR we do not have to call
  592|       |	 * __archive_read_seek() at this time since we have
  593|       |	 * already had enough data.
  594|       |	 */
  595|      3|	if (bytes_avail > SFX_MIN_ADDR)
  ------------------
  |  |   60|      3|#define SFX_MIN_ADDR	0x27000
  ------------------
  |  Branch (595:6): [True: 3, False: 0]
  ------------------
  596|      3|		__archive_read_consume(a, SFX_MIN_ADDR);
  ------------------
  |  |   60|      3|#define SFX_MIN_ADDR	0x27000
  ------------------
  597|      0|	else if (__archive_read_seek(a, SFX_MIN_ADDR, SEEK_SET) < 0)
  ------------------
  |  |   60|      0|#define SFX_MIN_ADDR	0x27000
  ------------------
  |  Branch (597:11): [True: 0, False: 0]
  ------------------
  598|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  599|       |
  600|      3|	offset = 0;
  601|      3|	window = 1;
  602|      3|	while (offset + window <= SFX_MAX_ADDR - SFX_MIN_ADDR) {
  ------------------
  |  |   61|      3|#define SFX_MAX_ADDR	0x60000
  ------------------
              	while (offset + window <= SFX_MAX_ADDR - SFX_MIN_ADDR) {
  ------------------
  |  |   60|      3|#define SFX_MIN_ADDR	0x27000
  ------------------
  |  Branch (602:9): [True: 3, False: 0]
  ------------------
  603|      3|		h = __archive_read_ahead(a, window, &bytes);
  604|      3|		if (h == NULL) {
  ------------------
  |  Branch (604:7): [True: 0, False: 3]
  ------------------
  605|       |			/* Remaining bytes are less than window. */
  606|      0|			window >>= 1;
  607|      0|			if (window < 0x40)
  ------------------
  |  Branch (607:8): [True: 0, False: 0]
  ------------------
  608|      0|				goto fatal;
  609|      0|			continue;
  610|      0|		}
  611|      3|		if (bytes < 6) {
  ------------------
  |  Branch (611:7): [True: 0, False: 3]
  ------------------
  612|       |			/* This case might happen when window == 1. */
  613|      0|			window = 4096;
  614|      0|			continue;
  615|      0|		}
  616|      3|		p = (const char *)h;
  617|      3|		q = p + bytes;
  618|       |
  619|       |		/*
  620|       |		 * Scan ahead until we find something that looks
  621|       |		 * like the 7-Zip header.
  622|       |		 */
  623|  21.6k|		while (p + 32 < q) {
  ------------------
  |  Branch (623:10): [True: 21.6k, False: 0]
  ------------------
  624|  21.6k|			int step = check_7zip_header_in_sfx(p);
  625|  21.6k|			if (step == 0) {
  ------------------
  |  Branch (625:8): [True: 3, False: 21.6k]
  ------------------
  626|      3|				struct _7zip *zip =
  627|      3|				    (struct _7zip *)a->format->data;
  628|      3|				skip = p - (const char *)h;
  629|      3|				__archive_read_consume(a, skip);
  630|      3|				zip->seek_base = SFX_MIN_ADDR + offset + skip;
  ------------------
  |  |   60|      3|#define SFX_MIN_ADDR	0x27000
  ------------------
  631|      3|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  632|      3|			}
  633|  21.6k|			p += step;
  634|  21.6k|		}
  635|      0|		skip = p - (const char *)h;
  636|      0|		__archive_read_consume(a, skip);
  637|      0|		offset += skip;
  638|      0|		if (window == 1)
  ------------------
  |  Branch (638:7): [True: 0, False: 0]
  ------------------
  639|      0|			window = 4096;
  640|      0|	}
  641|      0|fatal:
  642|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  643|      0|	    "Couldn't find out 7-Zip header");
  644|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  645|      3|}
archive_read_support_format_7zip.c:header_bytes:
 2954|    353|{
 2955|    353|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2956|    353|	const unsigned char *p;
 2957|       |
 2958|    353|	if (zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (2958:6): [True: 0, False: 353]
  ------------------
 2959|      0|		return (NULL);
 2960|    353|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (2960:6): [True: 346, False: 7]
  ------------------
 2961|    346|		read_consume(a);
 2962|       |
 2963|    353|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (2963:6): [True: 353, False: 0]
  ------------------
 2964|    353|		p = __archive_read_ahead(a, rbytes, NULL);
 2965|    353|		if (p == NULL)
  ------------------
  |  Branch (2965:7): [True: 2, False: 351]
  ------------------
 2966|      2|			return (NULL);
 2967|    351|		zip->header_bytes_remaining -= rbytes;
 2968|    351|		zip->pack_stream_bytes_unconsumed = rbytes;
 2969|    351|	} else {
 2970|      0|		const void *buff;
 2971|      0|		ssize_t bytes;
 2972|       |
 2973|      0|		bytes = read_stream(a, &buff, rbytes, rbytes);
 2974|      0|		if (bytes <= 0)
  ------------------
  |  Branch (2974:7): [True: 0, False: 0]
  ------------------
 2975|      0|			return (NULL);
 2976|      0|		zip->header_bytes_remaining -= bytes;
 2977|      0|		p = buff;
 2978|      0|	}
 2979|       |
 2980|       |	/* Update checksum */
 2981|    351|	zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
 2982|    351|	return (p);
 2983|    353|}
archive_read_support_format_7zip.c:read_stream:
 3390|      2|{
 3391|      2|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3392|      2|	uint64_t skip_bytes = 0;
 3393|      2|	ssize_t r;
 3394|       |
 3395|      2|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3395:6): [True: 2, False: 0]
  ------------------
 3396|      2|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3396:7): [True: 0, False: 2]
  ------------------
 3397|      0|			r = extract_pack_stream(a, 0);
 3398|      0|			if (r < 0)
  ------------------
  |  Branch (3398:8): [True: 0, False: 0]
  ------------------
 3399|      0|				return (r);
 3400|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3401|      2|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3401:14): [True: 0, False: 2]
  ------------------
 3402|       |			/* Extract a remaining pack stream. */
 3403|      0|			r = extract_pack_stream(a, 0);
 3404|      0|			if (r < 0)
  ------------------
  |  Branch (3404:8): [True: 0, False: 0]
  ------------------
 3405|      0|				return (r);
 3406|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3407|      0|		}
 3408|      2|	} else
 3409|      0|		return (get_uncompressed_data(a, buff, size, minimum));
 3410|       |
 3411|       |	/*
 3412|       |	 * Current pack stream has been consumed.
 3413|       |	 */
 3414|      2|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3414:6): [True: 2, False: 0]
  ------------------
 3415|      2|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3415:7): [True: 0, False: 2]
  ------------------
 3416|       |			/* Invalid sequence. This might happen when
 3417|       |			 * reading a malformed archive. */
 3418|      0|			archive_set_error(&(a->archive),
 3419|      0|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3420|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3421|      0|		}
 3422|       |
 3423|       |		/*
 3424|       |		 * All current folder's pack streams have been
 3425|       |		 * consumed. Switch to next folder.
 3426|       |		 */
 3427|      2|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3427:7): [True: 2, False: 0]
  ------------------
 3428|      2|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3428:8): [True: 0, False: 2]
  ------------------
 3429|      2|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3429:11): [True: 0, False: 2]
  ------------------
 3430|      0|			zip->folder_index = zip->entry->folderIndex;
 3431|      0|			skip_bytes =
 3432|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3433|      0|		}
 3434|       |
 3435|      2|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3435:7): [True: 0, False: 2]
  ------------------
 3436|       |			/*
 3437|       |			 * We have consumed all folders and its pack streams.
 3438|       |			 */
 3439|      0|			*buff = NULL;
 3440|      0|			return (0);
 3441|      0|		}
 3442|      2|		r = setup_decode_folder(a,
 3443|      2|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3444|      2|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3444:7): [True: 0, False: 2]
  ------------------
 3445|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3446|       |
 3447|      2|		zip->folder_index++;
 3448|      2|	}
 3449|       |
 3450|       |	/*
 3451|       |	 * Switch to next pack stream.
 3452|       |	 */
 3453|      2|	r = seek_pack(a);
 3454|      2|	if (r < 0)
  ------------------
  |  Branch (3454:6): [True: 0, False: 2]
  ------------------
 3455|      0|		return (r);
 3456|       |
 3457|       |	/* Extract a new pack stream. */
 3458|      2|	r = extract_pack_stream(a, 0);
 3459|      2|	if (r < 0)
  ------------------
  |  Branch (3459:6): [True: 1, False: 1]
  ------------------
 3460|      1|		return (r);
 3461|       |
 3462|       |	/*
 3463|       |	 * Skip the bytes we already has skipped in skip_stream().
 3464|       |	 */
 3465|      1|	while (1) {
  ------------------
  |  Branch (3465:9): [Folded - Ignored]
  ------------------
 3466|      1|		ssize_t skipped;
 3467|       |
 3468|      1|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3468:7): [True: 0, False: 1]
  ------------------
 3469|      0|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3469:8): [True: 0, False: 0]
  ------------------
 3470|      0|				r = extract_pack_stream(a, 0);
 3471|      0|				if (r < 0)
  ------------------
  |  Branch (3471:9): [True: 0, False: 0]
  ------------------
 3472|      0|					return (r);
 3473|      0|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3473:15): [True: 0, False: 0]
  ------------------
 3474|       |				/* Extract a remaining pack stream. */
 3475|      0|				r = extract_pack_stream(a, 0);
 3476|      0|				if (r < 0)
  ------------------
  |  Branch (3476:9): [True: 0, False: 0]
  ------------------
 3477|      0|					return (r);
 3478|      0|			} else {
 3479|      0|				archive_set_error(&a->archive,
 3480|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3481|      0|				    "Truncated 7-Zip file body");
 3482|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3483|      0|			}
 3484|      0|		}
 3485|       |
 3486|      1|		if (!skip_bytes)
  ------------------
  |  Branch (3486:7): [True: 1, False: 0]
  ------------------
 3487|      1|			break;
 3488|       |
 3489|      0|		skipped = get_uncompressed_data(
 3490|      0|			a, buff, (size_t)skip_bytes, 0);
 3491|      0|		if (skipped < 0)
  ------------------
  |  Branch (3491:7): [True: 0, False: 0]
  ------------------
 3492|      0|			return (skipped);
 3493|      0|		skip_bytes -= skipped;
 3494|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3494:7): [True: 0, False: 0]
  ------------------
 3495|      0|			read_consume(a);
 3496|      0|	}
 3497|       |
 3498|      1|	return (get_uncompressed_data(a, buff, size, minimum));
 3499|      1|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3203|      2|{
 3204|      2|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3205|      2|	ssize_t bytes_avail;
 3206|      2|	int r;
 3207|       |
 3208|      2|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   67|      4|#define _7Z_COPY	0
  ------------------
  |  Branch (3208:6): [True: 1, False: 1]
  |  Branch (3208:32): [True: 1, False: 0]
  ------------------
 3209|      1|		if (minimum == 0)
  ------------------
  |  Branch (3209:7): [True: 1, False: 0]
  ------------------
 3210|      1|			minimum = 1;
 3211|      1|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3211:7): [True: 0, False: 1]
  ------------------
 3212|      1|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3212:10): [True: 0, False: 1]
  ------------------
 3213|      0|			archive_set_error(&a->archive,
 3214|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3215|      0|			    "Truncated 7-Zip file body");
 3216|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3217|      0|		}
 3218|      1|		if ((uint64_t)bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3218:7): [True: 1, False: 0]
  ------------------
 3219|      1|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3220|      1|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3221|      1|		if ((uint64_t)bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3221:7): [True: 1, False: 0]
  ------------------
 3222|      1|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3223|      1|		zip->folder_outbytes_remaining -= bytes_avail;
 3224|      1|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3225|      1|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3226|      1|	}
 3227|       |
 3228|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3229|      1|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3229:6): [True: 1, False: 0]
  ------------------
 3230|      1|		zip->uncompressed_buffer_size = UBUFF_SIZE;
  ------------------
  |  |  269|      1|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3231|      1|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3231:7): [True: 0, False: 1]
  ------------------
 3232|      0|			zip->uncompressed_buffer_size = minimum + 1023;
 3233|      0|			zip->uncompressed_buffer_size &= ~0x3ff;
 3234|      0|		}
 3235|      1|		zip->uncompressed_buffer =
 3236|      1|		    malloc(zip->uncompressed_buffer_size);
 3237|      1|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3237:7): [True: 0, False: 1]
  ------------------
 3238|      0|			archive_set_error(&a->archive, ENOMEM,
 3239|      0|			    "No memory for 7-Zip decompression");
 3240|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3241|      0|		}
 3242|      1|		zip->uncompressed_buffer_bytes_remaining = 0;
 3243|      1|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3243:13): [True: 0, False: 0]
  ------------------
 3244|      0|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3244:6): [True: 0, False: 0]
  ------------------
 3245|       |		/*
 3246|       |		 * Make sure the uncompressed buffer can have bytes
 3247|       |		 * at least `minimum' bytes.
 3248|       |		 * NOTE: This case happen when reading the header.
 3249|       |		 */
 3250|      0|		size_t used;
 3251|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3251:7): [True: 0, False: 0]
  ------------------
 3252|      0|			used = zip->uncompressed_buffer_pointer -
 3253|      0|				zip->uncompressed_buffer;
 3254|      0|		else
 3255|      0|			used = 0;
 3256|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3256:7): [True: 0, False: 0]
  ------------------
 3257|       |			/*
 3258|       |			 * Expand the uncompressed buffer up to
 3259|       |			 * the minimum size.
 3260|       |			 */
 3261|      0|			void *p;
 3262|      0|			size_t new_size;
 3263|       |
 3264|      0|			new_size = minimum + 1023;
 3265|      0|			new_size &= ~0x3ff;
 3266|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3267|      0|			if (p == NULL) {
  ------------------
  |  Branch (3267:8): [True: 0, False: 0]
  ------------------
 3268|      0|				archive_set_error(&a->archive, ENOMEM,
 3269|      0|				    "No memory for 7-Zip decompression");
 3270|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3271|      0|			}
 3272|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3273|      0|			zip->uncompressed_buffer_size = new_size;
 3274|      0|		}
 3275|       |		/*
 3276|       |		 * Move unconsumed bytes to the head.
 3277|       |		 */
 3278|      0|		if (used) {
  ------------------
  |  Branch (3278:7): [True: 0, False: 0]
  ------------------
 3279|      0|			memmove(zip->uncompressed_buffer,
 3280|      0|				zip->uncompressed_buffer + used,
 3281|      0|				zip->uncompressed_buffer_bytes_remaining);
 3282|      0|		}
 3283|      0|	} else
 3284|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 3285|      1|	zip->uncompressed_buffer_pointer = NULL;
 3286|      1|	for (;;) {
 3287|      1|		size_t bytes_in, bytes_out;
 3288|      1|		const void *buff_in;
 3289|      1|		unsigned char *buff_out;
 3290|      1|		int end_of_data;
 3291|       |
 3292|       |		/*
 3293|       |		 * Note: '1' here is a performance optimization.
 3294|       |		 * Recall that the decompression layer returns a count of
 3295|       |		 * available bytes; asking for more than that forces the
 3296|       |		 * decompressor to combine reads by copying data.
 3297|       |		 */
 3298|      1|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3299|      1|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3299:7): [True: 0, False: 1]
  ------------------
 3300|      0|			archive_set_error(&a->archive,
 3301|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3302|      0|			    "Truncated 7-Zip file body");
 3303|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3304|      0|		}
 3305|       |
 3306|      1|		buff_out = zip->uncompressed_buffer
 3307|      1|			+ zip->uncompressed_buffer_bytes_remaining;
 3308|      1|		bytes_out = zip->uncompressed_buffer_size
 3309|      1|			- zip->uncompressed_buffer_bytes_remaining;
 3310|      1|		bytes_in = bytes_avail;
 3311|      1|		if (bytes_in > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3311:7): [True: 1, False: 0]
  ------------------
 3312|      1|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3313|       |		/* Drive decompression. */
 3314|      1|		r = decompress(a, zip, buff_out, &bytes_out,
 3315|      1|			buff_in, &bytes_in);
 3316|      1|		switch (r) {
 3317|      0|		case ARCHIVE_OK:
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3317:3): [True: 0, False: 1]
  ------------------
 3318|      0|			end_of_data = 0;
 3319|      0|			break;
 3320|      0|		case ARCHIVE_EOF:
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3320:3): [True: 0, False: 1]
  ------------------
 3321|      0|			end_of_data = 1;
 3322|      0|			break;
 3323|      1|		default:
  ------------------
  |  Branch (3323:3): [True: 1, False: 0]
  ------------------
 3324|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3325|      1|		}
 3326|      0|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3327|      0|		if (bytes_out > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3327:7): [True: 0, False: 0]
  ------------------
 3328|      0|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3329|      0|		zip->folder_outbytes_remaining -= bytes_out;
 3330|      0|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3331|      0|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3332|       |
 3333|       |		/*
 3334|       |		 * Continue decompression until uncompressed_buffer is full.
 3335|       |		 */
 3336|      0|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3336:7): [True: 0, False: 0]
  ------------------
 3337|      0|		    zip->uncompressed_buffer_size)
 3338|      0|			break;
 3339|      0|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3339:7): [True: 0, False: 0]
  |  Branch (3339:33): [True: 0, False: 0]
  ------------------
 3340|      0|		    zip->uncompressed_buffer_bytes_remaining + 5 >
  ------------------
  |  Branch (3340:7): [True: 0, False: 0]
  ------------------
 3341|      0|		    zip->uncompressed_buffer_size)
 3342|      0|			break;
 3343|      0|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3343:7): [True: 0, False: 0]
  ------------------
 3344|      0|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3344:7): [True: 0, False: 0]
  ------------------
 3345|      0|			break;
 3346|      0|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3346:7): [True: 0, False: 0]
  |  Branch (3346:23): [True: 0, False: 0]
  |  Branch (3346:40): [True: 0, False: 0]
  ------------------
 3347|      0|			archive_set_error(&(a->archive),
 3348|      0|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3349|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3350|      0|		}
 3351|      0|		read_consume(a);
 3352|      0|	}
 3353|      0|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3353:6): [True: 0, False: 0]
  ------------------
 3354|      0|		archive_set_error(&(a->archive),
 3355|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3356|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3357|      0|	}
 3358|      0|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3359|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3360|      0|}
archive_read_support_format_7zip.c:decompress:
 1418|      1|{
 1419|      1|	const uint8_t *t_next_in;
 1420|      1|	uint8_t *t_next_out;
 1421|      1|	size_t o_avail_in, o_avail_out;
 1422|      1|	size_t t_avail_in, t_avail_out;
 1423|      1|	uint8_t *bcj2_next_out;
 1424|      1|	size_t bcj2_avail_out;
 1425|      1|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1426|       |
 1427|      1|	t_avail_in = o_avail_in = *used;
 1428|      1|	t_avail_out = o_avail_out = *outbytes;
 1429|      1|	t_next_in = b;
 1430|      1|	t_next_out = buff;
 1431|       |
 1432|      1|	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   69|      2|#define _7Z_LZMA2	0x21
  ------------------
              	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1432:6): [True: 0, False: 1]
  |  Branch (1432:33): [True: 0, False: 0]
  ------------------
 1433|      0|		int i;
 1434|       |
 1435|       |		/* Do not copy out the BCJ remaining bytes when the output
 1436|       |		 * buffer size is less than five bytes. */
 1437|      0|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1437:7): [True: 0, False: 0]
  |  Branch (1437:26): [True: 0, False: 0]
  |  Branch (1437:45): [True: 0, False: 0]
  ------------------
 1438|      0|			*used = 0;
 1439|      0|			*outbytes = 0;
 1440|      0|			return (ret);
 1441|      0|		}
 1442|      0|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1442:15): [True: 0, False: 0]
  |  Branch (1442:40): [True: 0, False: 0]
  ------------------
 1443|      0|			*t_next_out++ = zip->odd_bcj[i];
 1444|      0|			t_avail_out--;
 1445|      0|			zip->odd_bcj_size--;
 1446|      0|		}
 1447|      0|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1447:7): [True: 0, False: 0]
  |  Branch (1447:26): [True: 0, False: 0]
  ------------------
 1448|      0|			*used = o_avail_in - t_avail_in;
 1449|      0|			*outbytes = o_avail_out - t_avail_out;
 1450|      0|			if (o_avail_in == 0)
  ------------------
  |  Branch (1450:8): [True: 0, False: 0]
  ------------------
 1451|      0|				ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1452|      0|			return (ret);
 1453|      0|		}
 1454|      0|	}
 1455|       |
 1456|      1|	bcj2_next_out = t_next_out;
 1457|      1|	bcj2_avail_out = t_avail_out;
 1458|      1|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |   80|      1|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1458:6): [True: 0, False: 1]
  ------------------
 1459|       |		/*
 1460|       |		 * Decord a remaining decompressed main stream for BCJ2.
 1461|       |		 */
 1462|      0|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1462:7): [True: 0, False: 0]
  ------------------
 1463|      0|			ssize_t bytes;
 1464|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1465|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1466|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1466:8): [True: 0, False: 0]
  ------------------
 1467|      0|				archive_set_error(&(a->archive),
 1468|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1469|      0|				    "BCJ2 conversion Failed");
 1470|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1471|      0|			}
 1472|      0|			zip->main_stream_bytes_remaining -=
 1473|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1474|      0|			t_avail_out -= bytes;
 1475|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1475:8): [True: 0, False: 0]
  |  Branch (1475:27): [True: 0, False: 0]
  ------------------
 1476|      0|				*used = 0;
 1477|      0|				*outbytes = o_avail_out - t_avail_out;
 1478|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1478:9): [True: 0, False: 0]
  ------------------
 1479|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1479:9): [True: 0, False: 0]
  ------------------
 1480|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1481|      0|				return (ret);
 1482|      0|			}
 1483|      0|			t_next_out += bytes;
 1484|      0|			bcj2_next_out = t_next_out;
 1485|      0|			bcj2_avail_out = t_avail_out;
 1486|      0|		}
 1487|      0|		t_next_out = zip->tmp_stream_buff;
 1488|      0|		t_avail_out = zip->tmp_stream_buff_size;
 1489|      0|	}
 1490|       |
 1491|      1|	switch (zip->codec) {
 1492|      0|	case _7Z_COPY:
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (1492:2): [True: 0, False: 1]
  ------------------
 1493|      0|	{
 1494|      0|		size_t bytes =
 1495|      0|		    (t_avail_in > t_avail_out)?t_avail_out:t_avail_in;
  ------------------
  |  Branch (1495:7): [True: 0, False: 0]
  ------------------
 1496|       |
 1497|      0|		memcpy(t_next_out, t_next_in, bytes);
 1498|      0|		t_avail_in -= bytes;
 1499|      0|		t_avail_out -= bytes;
 1500|      0|		if (o_avail_in == 0)
  ------------------
  |  Branch (1500:7): [True: 0, False: 0]
  ------------------
 1501|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1502|      0|		break;
 1503|      0|	}
 1504|      0|#ifdef HAVE_LZMA_H
 1505|      1|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   68|      0|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   69|      1|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1505:2): [True: 0, False: 1]
  |  Branch (1505:17): [True: 1, False: 0]
  ------------------
 1506|      1|		zip->lzstream.next_in = t_next_in;
 1507|      1|		zip->lzstream.avail_in = t_avail_in;
 1508|      1|		zip->lzstream.next_out = t_next_out;
 1509|      1|		zip->lzstream.avail_out = t_avail_out;
 1510|       |
 1511|      1|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1512|      1|		switch (r) {
 1513|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1513:3): [True: 0, False: 1]
  ------------------
 1514|      0|			lzma_end(&(zip->lzstream));
 1515|      0|			zip->lzstream_valid = 0;
 1516|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1517|      0|			break;
 1518|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1518:3): [True: 0, False: 1]
  ------------------
 1519|      0|			break;
 1520|      1|		default:
  ------------------
  |  Branch (1520:3): [True: 1, False: 0]
  ------------------
 1521|      1|			archive_set_error(&(a->archive),
 1522|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1523|      1|				"Decompression failed(%d)",
 1524|      1|			    r);
 1525|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1526|      1|		}
 1527|      0|		t_avail_in = zip->lzstream.avail_in;
 1528|      0|		t_avail_out = zip->lzstream.avail_out;
 1529|      0|		break;
 1530|      0|#endif
 1531|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1532|      0|	case _7Z_BZ2:
  ------------------
  |  |   71|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1532:2): [True: 0, False: 1]
  ------------------
 1533|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1534|      0|		zip->bzstream.avail_in = (uint32_t)t_avail_in;
 1535|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1536|      0|		zip->bzstream.avail_out = (uint32_t)t_avail_out;
 1537|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1538|      0|		switch (r) {
 1539|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1539:3): [True: 0, False: 0]
  ------------------
 1540|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1541|      0|			case BZ_OK:
  ------------------
  |  Branch (1541:4): [True: 0, False: 0]
  ------------------
 1542|      0|				break;
 1543|      0|			default:
  ------------------
  |  Branch (1543:4): [True: 0, False: 0]
  ------------------
 1544|      0|				archive_set_error(&(a->archive),
 1545|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1546|      0|				    "Failed to clean up decompressor");
 1547|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1548|      0|			}
 1549|      0|			zip->bzstream_valid = 0;
 1550|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1551|      0|			break;
 1552|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1552:3): [True: 0, False: 0]
  ------------------
 1553|      0|			break;
 1554|      0|		default:
  ------------------
  |  Branch (1554:3): [True: 0, False: 0]
  ------------------
 1555|      0|			archive_set_error(&(a->archive),
 1556|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1557|      0|			    "bzip decompression failed");
 1558|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1559|      0|		}
 1560|      0|		t_avail_in = zip->bzstream.avail_in;
 1561|      0|		t_avail_out = zip->bzstream.avail_out;
 1562|      0|		break;
 1563|      0|#endif
 1564|      0|#ifdef HAVE_ZLIB_H
 1565|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   70|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1565:2): [True: 0, False: 1]
  ------------------
 1566|      0|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1567|      0|		zip->stream.avail_in = (uInt)t_avail_in;
 1568|      0|		zip->stream.next_out = t_next_out;
 1569|      0|		zip->stream.avail_out = (uInt)t_avail_out;
 1570|      0|		r = inflate(&(zip->stream), 0);
 1571|      0|		switch (r) {
 1572|      0|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1572:3): [True: 0, False: 0]
  ------------------
 1573|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1574|      0|			break;
 1575|      0|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1575:3): [True: 0, False: 0]
  ------------------
 1576|      0|			break;
 1577|      0|		default:
  ------------------
  |  Branch (1577:3): [True: 0, False: 0]
  ------------------
 1578|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1579|      0|			    "File decompression failed (%d)", r);
 1580|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1581|      0|		}
 1582|      0|		t_avail_in = zip->stream.avail_in;
 1583|      0|		t_avail_out = zip->stream.avail_out;
 1584|      0|		break;
 1585|      0|#endif
 1586|       |#ifdef HAVE_ZSTD_H
 1587|       |	case _7Z_ZSTD:
 1588|       |	{
 1589|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 }; // src, size, pos
 1590|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 }; // dst, size, pos
 1591|       |
 1592|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream, &output, &input);
 1593|       |		if (ZSTD_isError(zret)) {
 1594|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Zstd decompression failed: %s", ZSTD_getErrorName(zret));
 1595|       |			return ARCHIVE_FAILED;
 1596|       |		}
 1597|       |		t_avail_in -= input.pos;
 1598|       |		t_avail_out -= output.pos;
 1599|       |		break;
 1600|       |	}
 1601|       |#endif
 1602|      0|	case _7Z_PPMD:
  ------------------
  |  |   72|      0|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1602:2): [True: 0, False: 1]
  ------------------
 1603|      0|	{
 1604|      0|		uint64_t flush_bytes;
 1605|       |
 1606|      0|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1606:7): [True: 0, False: 0]
  |  Branch (1606:28): [True: 0, False: 0]
  ------------------
 1607|      0|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1607:7): [True: 0, False: 0]
  ------------------
 1608|      0|			archive_set_error(&(a->archive),
 1609|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1610|      0|			    "Decompression internal error");
 1611|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1612|      0|		}
 1613|      0|		zip->ppstream.next_in = t_next_in;
 1614|      0|		zip->ppstream.avail_in = t_avail_in;
 1615|      0|		zip->ppstream.stream_in = 0;
 1616|      0|		zip->ppstream.next_out = t_next_out;
 1617|      0|		zip->ppstream.avail_out = t_avail_out;
 1618|      0|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1618:7): [True: 0, False: 0]
  ------------------
 1619|      0|			zip->bytein.a = a;
 1620|      0|			zip->bytein.Read = &ppmd_read;
 1621|      0|			zip->range_dec.Stream = &zip->bytein;
 1622|      0|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1623|      0|				&(zip->range_dec));
 1624|      0|			if (r == 0) {
  ------------------
  |  Branch (1624:8): [True: 0, False: 0]
  ------------------
 1625|      0|				zip->ppmd7_stat = -1;
 1626|      0|				archive_set_error(&a->archive,
 1627|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1628|      0|				    "Failed to initialize PPMd range decoder");
 1629|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1630|      0|			}
 1631|      0|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1631:8): [True: 0, False: 0]
  ------------------
 1632|      0|				zip->ppmd7_stat = -1;
 1633|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1634|      0|			}
 1635|      0|			zip->ppmd7_stat = 1;
 1636|      0|		}
 1637|       |
 1638|      0|		if (t_avail_in == 0)
  ------------------
  |  Branch (1638:7): [True: 0, False: 0]
  ------------------
 1639|       |			/* XXX Flush out remaining decoded data XXX */
 1640|      0|			flush_bytes = zip->folder_outbytes_remaining;
 1641|      0|		else
 1642|      0|			flush_bytes = 0;
 1643|       |
 1644|      0|		do {
 1645|      0|			int sym;
 1646|       |
 1647|      0|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1648|      0|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1649|      0|			if (sym < 0) {
  ------------------
  |  Branch (1649:8): [True: 0, False: 0]
  ------------------
 1650|      0|				zip->ppmd7_stat = -1;
 1651|      0|				archive_set_error(&a->archive,
 1652|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1653|      0|				    "Failed to decode PPMd");
 1654|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1655|      0|			}
 1656|      0|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1656:8): [True: 0, False: 0]
  ------------------
 1657|      0|				zip->ppmd7_stat = -1;
 1658|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1659|      0|			}
 1660|      0|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1661|      0|			zip->ppstream.avail_out--;
 1662|      0|			zip->ppstream.total_out++;
 1663|      0|			if (flush_bytes)
  ------------------
  |  Branch (1663:8): [True: 0, False: 0]
  ------------------
 1664|      0|				flush_bytes--;
 1665|      0|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1665:12): [True: 0, False: 0]
  ------------------
 1666|      0|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1666:5): [True: 0, False: 0]
  |  Branch (1666:31): [True: 0, False: 0]
  ------------------
 1667|       |
 1668|      0|		t_avail_in = (size_t)zip->ppstream.avail_in;
 1669|      0|		t_avail_out = (size_t)zip->ppstream.avail_out;
 1670|      0|		break;
 1671|      0|	}
 1672|      0|	default:
  ------------------
  |  Branch (1672:2): [True: 0, False: 1]
  ------------------
 1673|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1674|      0|		    "Decompression internal error");
 1675|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1676|      1|	}
 1677|      0|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1677:6): [True: 0, False: 0]
  |  Branch (1677:27): [True: 0, False: 0]
  ------------------
 1678|      0|		return (ret);
 1679|       |
 1680|      0|	*used = o_avail_in - t_avail_in;
 1681|      0|	*outbytes = o_avail_out - t_avail_out;
 1682|       |
 1683|       |	/*
 1684|       |	 * Decord BCJ.
 1685|       |	 */
 1686|      0|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   69|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1686:6): [True: 0, False: 0]
  ------------------
 1687|      0|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1687:7): [True: 0, False: 0]
  ------------------
 1688|      0|			size_t l = x86_Convert(zip, buff, *outbytes);
 1689|       |
 1690|      0|			zip->odd_bcj_size = *outbytes - l;
 1691|      0|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1691:8): [True: 0, False: 0]
  |  Branch (1691:33): [True: 0, False: 0]
  ------------------
 1692|      0|		    	o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1692:8): [True: 0, False: 0]
  |  Branch (1692:22): [True: 0, False: 0]
  ------------------
 1693|      0|				memcpy(zip->odd_bcj, ((unsigned char *)buff) + l,
 1694|      0|			    	zip->odd_bcj_size);
 1695|      0|				*outbytes = l;
 1696|      0|			} else
 1697|      0|				zip->odd_bcj_size = 0;
 1698|      0|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |   83|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1698:14): [True: 0, False: 0]
  ------------------
 1699|      0|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1700|      0|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |   85|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1700:14): [True: 0, False: 0]
  ------------------
 1701|      0|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1702|      0|		}
 1703|      0|	}
 1704|       |
 1705|       |	/*
 1706|       |	 * Decord BCJ2 with a decompressed main stream.
 1707|       |	 */
 1708|      0|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1708:6): [True: 0, False: 0]
  ------------------
 1709|      0|		ssize_t bytes;
 1710|       |
 1711|      0|		zip->tmp_stream_bytes_avail =
 1712|      0|		    zip->tmp_stream_buff_size - t_avail_out;
 1713|      0|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (1713:7): [True: 0, False: 0]
  ------------------
 1714|      0|		      zip->main_stream_bytes_remaining)
 1715|      0|			zip->tmp_stream_bytes_avail =
 1716|      0|			    zip->main_stream_bytes_remaining;
 1717|      0|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 1718|      0|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 1719|      0|		if (bytes < 0) {
  ------------------
  |  Branch (1719:7): [True: 0, False: 0]
  ------------------
 1720|      0|			archive_set_error(&(a->archive),
 1721|      0|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion Failed");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1722|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1723|      0|		}
 1724|      0|		zip->main_stream_bytes_remaining -=
 1725|      0|		    zip->tmp_stream_bytes_avail
 1726|      0|		      - zip->tmp_stream_bytes_remaining;
 1727|      0|		bcj2_avail_out -= bytes;
 1728|      0|		*outbytes = o_avail_out - bcj2_avail_out;
 1729|      0|	}
 1730|       |
 1731|      0|	return (ret);
 1732|      0|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3151|      1|{
 3152|      1|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3153|      1|	ssize_t bytes_avail;
 3154|       |
 3155|      1|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   67|      2|#define _7Z_COPY	0
  ------------------
  |  Branch (3155:6): [True: 1, False: 0]
  |  Branch (3155:32): [True: 1, False: 0]
  ------------------
 3156|       |		/* Copy mode. */
 3157|       |
 3158|      1|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3159|      1|		if (*buff == NULL) {
  ------------------
  |  Branch (3159:7): [True: 0, False: 1]
  ------------------
 3160|      0|			archive_set_error(&a->archive,
 3161|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3162|      0|			    "Truncated 7-Zip file data");
 3163|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3164|      0|		}
 3165|      1|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3165:7): [True: 1, False: 0]
  ------------------
 3166|      1|		    zip->uncompressed_buffer_bytes_remaining)
 3167|      1|			bytes_avail = (ssize_t)
 3168|      1|			    zip->uncompressed_buffer_bytes_remaining;
 3169|      1|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3169:7): [True: 0, False: 1]
  ------------------
 3170|      0|			bytes_avail = (ssize_t)size;
 3171|       |
 3172|      1|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3173|      1|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3173:13): [True: 0, False: 0]
  ------------------
 3174|       |		/* Decompression has failed. */
 3175|      0|		archive_set_error(&(a->archive),
 3176|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3177|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3178|      0|	} else {
 3179|       |		/* Packed mode. */
 3180|      0|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3180:7): [True: 0, False: 0]
  ------------------
 3181|       |			/*
 3182|       |			 * If remaining uncompressed data size is less than
 3183|       |			 * the minimum size, fill the buffer up to the
 3184|       |			 * minimum size.
 3185|       |			 */
 3186|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3186:8): [True: 0, False: 0]
  ------------------
 3187|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3188|      0|		}
 3189|      0|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3189:7): [True: 0, False: 0]
  ------------------
 3190|      0|			bytes_avail = (ssize_t)
 3191|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3192|      0|		else
 3193|      0|			bytes_avail = (ssize_t)size;
 3194|      0|		*buff = zip->uncompressed_buffer_pointer;
 3195|      0|		zip->uncompressed_buffer_pointer += bytes_avail;
 3196|      0|	}
 3197|      1|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3198|      1|	return (bytes_avail);
 3199|      1|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2403|      7|{
 2404|      7|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2405|      7|	const unsigned char *p;
 2406|      7|	unsigned i;
 2407|       |
 2408|      7|	memset(si, 0, sizeof(*si));
 2409|       |
 2410|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2410:6): [True: 0, False: 7]
  ------------------
 2411|      0|		return (-1);
 2412|      7|	if (*p == kPackInfo) {
  ------------------
  |  |   99|      7|#define kPackInfo		0x06
  ------------------
  |  Branch (2412:6): [True: 7, False: 0]
  ------------------
 2413|      7|		uint64_t packPos;
 2414|       |
 2415|      7|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2415:7): [True: 0, False: 7]
  ------------------
 2416|      0|			return (-1);
 2417|       |
 2418|      7|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2418:7): [True: 0, False: 7]
  |  Branch (2418:35): [True: 0, False: 7]
  ------------------
 2419|      0|			return (-1);
 2420|       |		/*
 2421|       |		 * Calculate packed stream positions.
 2422|       |		 */
 2423|      7|		packPos = si->pi.pos;
 2424|     14|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2424:15): [True: 7, False: 7]
  ------------------
 2425|      7|			si->pi.positions[i] = packPos;
 2426|      7|			if (packPos > UINT64_MAX - si->pi.sizes[i])
  ------------------
  |  Branch (2426:8): [True: 0, False: 7]
  ------------------
 2427|      0|				return (-1);
 2428|      7|			packPos += si->pi.sizes[i];
 2429|      7|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2429:8): [True: 0, False: 7]
  ------------------
 2430|      0|				return (-1);
 2431|      7|		}
 2432|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2432:7): [True: 0, False: 7]
  ------------------
 2433|      0|			return (-1);
 2434|      7|	}
 2435|      7|	if (*p == kUnPackInfo) {
  ------------------
  |  |  100|      7|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2435:6): [True: 7, False: 0]
  ------------------
 2436|      7|		uint32_t packIndex;
 2437|      7|		struct _7z_folder *f;
 2438|       |
 2439|      7|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2439:7): [True: 0, False: 7]
  ------------------
 2440|      0|			return (-1);
 2441|       |
 2442|       |		/*
 2443|       |		 * Calculate packed stream indexes.
 2444|       |		 */
 2445|      7|		packIndex = 0;
 2446|      7|		f = si->ci.folders;
 2447|     14|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2447:15): [True: 7, False: 7]
  ------------------
 2448|      7|			f[i].packIndex = packIndex;
 2449|      7|			if (f[i].numPackedStreams > UINT32_MAX)
  ------------------
  |  Branch (2449:8): [True: 0, False: 7]
  ------------------
 2450|      0|				return (-1);
 2451|      7|			if (packIndex > UINT32_MAX - (uint32_t)f[i].numPackedStreams)
  ------------------
  |  Branch (2451:8): [True: 0, False: 7]
  ------------------
 2452|      0|				return (-1);
 2453|      7|			packIndex += (uint32_t)f[i].numPackedStreams;
 2454|      7|			if (packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2454:8): [True: 0, False: 7]
  ------------------
 2455|      0|				return (-1);
 2456|      7|		}
 2457|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2457:7): [True: 0, False: 7]
  ------------------
 2458|      0|			return (-1);
 2459|      7|	}
 2460|       |
 2461|      7|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  101|      7|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2461:6): [True: 7, False: 0]
  ------------------
 2462|      7|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2462:7): [True: 0, False: 7]
  ------------------
 2463|      7|		    si->ci.folders, (size_t)si->ci.numFolders) < 0)
 2464|      0|			return (-1);
 2465|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2465:7): [True: 0, False: 7]
  ------------------
 2466|      0|			return (-1);
 2467|      7|	}
 2468|       |
 2469|       |	/*
 2470|       |	 *  Must be kEnd.
 2471|       |	 */
 2472|      7|	if (*p != kEnd)
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (2472:6): [True: 0, False: 7]
  ------------------
 2473|      0|		return (-1);
 2474|      7|	return (0);
 2475|      7|}
archive_read_support_format_7zip.c:read_PackInfo:
 1882|      7|{
 1883|      7|	const unsigned char *p;
 1884|      7|	unsigned i;
 1885|       |
 1886|      7|	memset(pi, 0, sizeof(*pi));
 1887|       |
 1888|       |	/*
 1889|       |	 * Read PackPos.
 1890|       |	 */
 1891|      7|	if (parse_7zip_uint64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (1891:6): [True: 0, False: 7]
  ------------------
 1892|      0|		return (-1);
 1893|       |
 1894|       |	/*
 1895|       |	 * Read NumPackStreams.
 1896|       |	 */
 1897|      7|	if (parse_7zip_uint64(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (1897:6): [True: 0, False: 7]
  ------------------
 1898|      0|		return (-1);
 1899|      7|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (1899:6): [True: 0, False: 7]
  ------------------
 1900|      0|		return (-1);
 1901|      7|	if (UMAX_ENTRY < pi->numPackStreams)
  ------------------
  |  |  373|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (1901:6): [True: 0, False: 7]
  ------------------
 1902|      0|		return (-1);
 1903|       |
 1904|       |	/*
 1905|       |	 * Read PackSizes[num]
 1906|       |	 */
 1907|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1907:6): [True: 0, False: 7]
  ------------------
 1908|      0|		return (-1);
 1909|      7|	if (*p == kEnd)
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (1909:6): [True: 0, False: 7]
  ------------------
 1910|       |		/* PackSizes[num] are not present. */
 1911|      0|		return (0);
 1912|      7|	if (*p != kSize)
  ------------------
  |  |  102|      7|#define kSize			0x09
  ------------------
  |  Branch (1912:6): [True: 0, False: 7]
  ------------------
 1913|      0|		return (-1);
 1914|      7|	pi->sizes = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 1915|      7|	pi->positions = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 1916|      7|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (1916:6): [True: 0, False: 7]
  |  Branch (1916:27): [True: 0, False: 7]
  ------------------
 1917|      0|		return (-1);
 1918|       |
 1919|     14|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (1919:14): [True: 7, False: 7]
  ------------------
 1920|      7|		if (parse_7zip_uint64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (1920:7): [True: 0, False: 7]
  ------------------
 1921|      0|			return (-1);
 1922|      7|	}
 1923|       |
 1924|       |	/*
 1925|       |	 * Read PackStreamDigests[num]
 1926|       |	 */
 1927|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1927:6): [True: 0, False: 7]
  ------------------
 1928|      0|		return (-1);
 1929|      7|	if (*p == kEnd) {
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (1929:6): [True: 7, False: 0]
  ------------------
 1930|       |		/* PackStreamDigests[num] are not present. */
 1931|      7|		pi->digest.defineds =
 1932|      7|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.defineds));
 1933|      7|		pi->digest.digests =
 1934|      7|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.digests));
 1935|      7|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (1935:7): [True: 0, False: 7]
  |  Branch (1935:38): [True: 0, False: 7]
  ------------------
 1936|      0|			return (-1);
 1937|      7|		return (0);
 1938|      7|	}
 1939|       |
 1940|      0|	if (*p != kCRC)
  ------------------
  |  |  103|      0|#define kCRC			0x0A
  ------------------
  |  Branch (1940:6): [True: 0, False: 0]
  ------------------
 1941|      0|		return (-1);
 1942|       |
 1943|      0|	if (read_Digests(a, &(pi->digest), (size_t)pi->numPackStreams) < 0)
  ------------------
  |  Branch (1943:6): [True: 0, False: 0]
  ------------------
 1944|      0|		return (-1);
 1945|       |
 1946|       |	/*
 1947|       |	 *  Must be marked by kEnd.
 1948|       |	 */
 1949|      0|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1949:6): [True: 0, False: 0]
  ------------------
 1950|      0|		return (-1);
 1951|      0|	if (*p != kEnd)
  ------------------
  |  |   93|      0|#define kEnd			0x00
  ------------------
  |  Branch (1951:6): [True: 0, False: 0]
  ------------------
 1952|      0|		return (-1);
 1953|      0|	return (0);
 1954|      0|}
archive_read_support_format_7zip.c:parse_7zip_uint64:
 1783|     92|{
 1784|     92|	const unsigned char *p;
 1785|     92|	unsigned char avail, mask;
 1786|     92|	int i;
 1787|       |
 1788|     92|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1788:6): [True: 0, False: 92]
  ------------------
 1789|      0|		return (-1);
 1790|     92|	avail = *p;
 1791|     92|	mask = 0x80;
 1792|     92|	*val = 0;
 1793|    128|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1793:14): [True: 124, False: 4]
  ------------------
 1794|    124|		if (avail & mask) {
  ------------------
  |  Branch (1794:7): [True: 36, False: 88]
  ------------------
 1795|     36|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1795:8): [True: 0, False: 36]
  ------------------
 1796|      0|				return (-1);
 1797|     36|			*val |= ((uint64_t)*p) << (8 * i);
 1798|     36|			mask >>= 1;
 1799|     36|			continue;
 1800|     36|		}
 1801|     88|		*val += ((uint64_t)(avail & (mask -1))) << (8 * i);
 1802|     88|		break;
 1803|    124|	}
 1804|     92|	return (0);
 1805|     92|}
archive_read_support_format_7zip.c:read_Digests:
 1835|      7|{
 1836|      7|	const unsigned char *p;
 1837|      7|	unsigned i;
 1838|       |
 1839|      7|	if (num == 0)
  ------------------
  |  Branch (1839:6): [True: 0, False: 7]
  ------------------
 1840|      0|		return (-1);
 1841|      7|	memset(d, 0, sizeof(*d));
 1842|       |
 1843|      7|	d->defineds = malloc(num);
 1844|      7|	if (d->defineds == NULL)
  ------------------
  |  Branch (1844:6): [True: 0, False: 7]
  ------------------
 1845|      0|		return (-1);
 1846|       |	/*
 1847|       |	 * Read Bools.
 1848|       |	 */
 1849|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1849:6): [True: 0, False: 7]
  ------------------
 1850|      0|		return (-1);
 1851|      7|	if (*p == 0) {
  ------------------
  |  Branch (1851:6): [True: 0, False: 7]
  ------------------
 1852|      0|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (1852:7): [True: 0, False: 0]
  ------------------
 1853|      0|			return (-1);
 1854|      0|	} else
 1855|       |		/* All are defined */
 1856|      7|		memset(d->defineds, 1, num);
 1857|       |
 1858|      7|	d->digests = calloc(num, sizeof(*d->digests));
 1859|      7|	if (d->digests == NULL)
  ------------------
  |  Branch (1859:6): [True: 0, False: 7]
  ------------------
 1860|      0|		return (-1);
 1861|     14|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (1861:14): [True: 7, False: 7]
  ------------------
 1862|      7|		if (d->defineds[i]) {
  ------------------
  |  Branch (1862:7): [True: 7, False: 0]
  ------------------
 1863|      7|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (1863:8): [True: 0, False: 7]
  ------------------
 1864|      0|				return (-1);
 1865|      7|			d->digests[i] = archive_le32dec(p);
 1866|      7|		}
 1867|      7|	}
 1868|       |
 1869|      7|	return (0);
 1870|      7|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2131|      7|{
 2132|      7|	const unsigned char *p;
 2133|      7|	struct _7z_digests digest;
 2134|      7|	unsigned i;
 2135|       |
 2136|      7|	memset(ci, 0, sizeof(*ci));
 2137|      7|	memset(&digest, 0, sizeof(digest));
 2138|       |
 2139|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2139:6): [True: 0, False: 7]
  ------------------
 2140|      0|		goto failed;
 2141|      7|	if (*p != kFolder)
  ------------------
  |  |  104|      7|#define kFolder			0x0B
  ------------------
  |  Branch (2141:6): [True: 0, False: 7]
  ------------------
 2142|      0|		goto failed;
 2143|       |
 2144|       |	/*
 2145|       |	 * Read NumFolders.
 2146|       |	 */
 2147|      7|	if (parse_7zip_uint64(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2147:6): [True: 0, False: 7]
  ------------------
 2148|      0|		goto failed;
 2149|      7|	if (UMAX_ENTRY < ci->numFolders)
  ------------------
  |  |  373|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2149:6): [True: 0, False: 7]
  ------------------
 2150|      0|		return (-1);
 2151|       |
 2152|       |	/*
 2153|       |	 * Read External.
 2154|       |	 */
 2155|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2155:6): [True: 0, False: 7]
  ------------------
 2156|      0|		goto failed;
 2157|      7|	switch (*p) {
 2158|      7|	case 0:
  ------------------
  |  Branch (2158:2): [True: 7, False: 0]
  ------------------
 2159|      7|		ci->folders =
 2160|      7|			calloc((size_t)ci->numFolders, sizeof(*ci->folders));
 2161|      7|		if (ci->folders == NULL)
  ------------------
  |  Branch (2161:7): [True: 0, False: 7]
  ------------------
 2162|      0|			return (-1);
 2163|     14|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2163:15): [True: 7, False: 7]
  ------------------
 2164|      7|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2164:8): [True: 0, False: 7]
  ------------------
 2165|      0|				goto failed;
 2166|      7|		}
 2167|      7|		break;
 2168|      7|	case 1:
  ------------------
  |  Branch (2168:2): [True: 0, False: 7]
  ------------------
 2169|      0|		if (parse_7zip_uint64(a, &(ci->dataStreamIndex)) < 0)
  ------------------
  |  Branch (2169:7): [True: 0, False: 0]
  ------------------
 2170|      0|			return (-1);
 2171|      0|		if (UMAX_ENTRY < ci->dataStreamIndex)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2171:7): [True: 0, False: 0]
  ------------------
 2172|      0|			return (-1);
 2173|      0|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2173:7): [True: 0, False: 0]
  ------------------
 2174|      0|			archive_set_error(&a->archive, -1,
 2175|      0|			    "Malformed 7-Zip archive");
 2176|      0|			goto failed;
 2177|      0|		}
 2178|      0|		break;
 2179|      0|	default:
  ------------------
  |  Branch (2179:2): [True: 0, False: 7]
  ------------------
 2180|      0|		archive_set_error(&a->archive, -1,
 2181|      0|		    "Malformed 7-Zip archive");
 2182|      0|		goto failed;
 2183|      7|	}
 2184|       |
 2185|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2185:6): [True: 0, False: 7]
  ------------------
 2186|      0|		goto failed;
 2187|      7|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  105|      7|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2187:6): [True: 0, False: 7]
  ------------------
 2188|      0|		goto failed;
 2189|       |
 2190|     14|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2190:14): [True: 7, False: 7]
  ------------------
 2191|      7|		struct _7z_folder *folder = &(ci->folders[i]);
 2192|      7|		unsigned j;
 2193|       |
 2194|      7|		folder->unPackSize =
 2195|      7|		    calloc((size_t)folder->numOutStreams, sizeof(*folder->unPackSize));
 2196|      7|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2196:7): [True: 0, False: 7]
  ------------------
 2197|      0|			goto failed;
 2198|     14|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2198:15): [True: 7, False: 7]
  ------------------
 2199|      7|			if (parse_7zip_uint64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2199:8): [True: 0, False: 7]
  ------------------
 2200|      0|				goto failed;
 2201|      7|		}
 2202|      7|	}
 2203|       |
 2204|       |	/*
 2205|       |	 * Read CRCs.
 2206|       |	 */
 2207|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2207:6): [True: 0, False: 7]
  ------------------
 2208|      0|		goto failed;
 2209|      7|	if (*p == kEnd)
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (2209:6): [True: 7, False: 0]
  ------------------
 2210|      7|		return (0);
 2211|      0|	if (*p != kCRC)
  ------------------
  |  |  103|      0|#define kCRC			0x0A
  ------------------
  |  Branch (2211:6): [True: 0, False: 0]
  ------------------
 2212|      0|		goto failed;
 2213|      0|	if (read_Digests(a, &digest, (size_t)ci->numFolders) < 0)
  ------------------
  |  Branch (2213:6): [True: 0, False: 0]
  ------------------
 2214|      0|		goto failed;
 2215|      0|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2215:14): [True: 0, False: 0]
  ------------------
 2216|      0|		ci->folders[i].digest_defined = digest.defineds[i];
 2217|      0|		ci->folders[i].digest = digest.digests[i];
 2218|      0|	}
 2219|       |
 2220|       |	/*
 2221|       |	 *  Must be kEnd.
 2222|       |	 */
 2223|      0|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2223:6): [True: 0, False: 0]
  ------------------
 2224|      0|		goto failed;
 2225|      0|	if (*p != kEnd)
  ------------------
  |  |   93|      0|#define kEnd			0x00
  ------------------
  |  Branch (2225:6): [True: 0, False: 0]
  ------------------
 2226|      0|		goto failed;
 2227|      0|	free_Digest(&digest);
 2228|      0|	return (0);
 2229|      0|failed:
 2230|      0|	free_Digest(&digest);
 2231|      0|	return (-1);
 2232|      0|}
archive_read_support_format_7zip.c:read_Folder:
 1974|      7|{
 1975|      7|	struct _7zip *zip = (struct _7zip *)a->format->data;
 1976|      7|	const unsigned char *p;
 1977|      7|	uint64_t numInStreamsTotal = 0;
 1978|      7|	uint64_t numOutStreamsTotal = 0;
 1979|      7|	unsigned i;
 1980|       |
 1981|      7|	memset(f, 0, sizeof(*f));
 1982|       |
 1983|       |	/*
 1984|       |	 * Read NumCoders.
 1985|       |	 */
 1986|      7|	if (parse_7zip_uint64(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (1986:6): [True: 0, False: 7]
  ------------------
 1987|      0|		return (-1);
 1988|      7|	if (f->numCoders > 4)
  ------------------
  |  Branch (1988:6): [True: 0, False: 7]
  ------------------
 1989|       |		/* Too many coders. */
 1990|      0|		return (-1);
 1991|       |
 1992|      7|	f->coders = calloc((size_t)f->numCoders, sizeof(*f->coders));
 1993|      7|	if (f->coders == NULL)
  ------------------
  |  Branch (1993:6): [True: 0, False: 7]
  ------------------
 1994|      0|		return (-1);
 1995|     14|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (1995:14): [True: 7, False: 7]
  ------------------
 1996|      7|		size_t codec_size;
 1997|      7|		int simple, attr;
 1998|       |
 1999|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (1999:7): [True: 0, False: 7]
  ------------------
 2000|      0|			return (-1);
 2001|       |		/*
 2002|       |		 * 0:3 CodecIdSize
 2003|       |		 * 4:  0 - IsSimple
 2004|       |		 *     1 - Is not Simple
 2005|       |		 * 5:  0 - No Attributes
 2006|       |		 *     1 - There are Attributes;
 2007|       |		 * 7:  Must be zero.
 2008|       |		 */
 2009|      7|		codec_size = *p & 0xf;
 2010|      7|		simple = (*p & 0x10)?0:1;
  ------------------
  |  Branch (2010:12): [True: 0, False: 7]
  ------------------
 2011|      7|		attr = *p & 0x20;
 2012|      7|		if (*p & 0x80)
  ------------------
  |  Branch (2012:7): [True: 0, False: 7]
  ------------------
 2013|      0|			return (-1);/* Not supported. */
 2014|       |
 2015|       |		/*
 2016|       |		 * Read Decompression Method IDs.
 2017|       |		 */
 2018|      7|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2018:7): [True: 0, False: 7]
  ------------------
 2019|      0|			return (-1);
 2020|       |
 2021|      7|		f->coders[i].codec = decode_codec_id(p, codec_size);
 2022|       |
 2023|      7|		if (simple) {
  ------------------
  |  Branch (2023:7): [True: 7, False: 0]
  ------------------
 2024|      7|			f->coders[i].numInStreams = 1;
 2025|      7|			f->coders[i].numOutStreams = 1;
 2026|      7|		} else {
 2027|      0|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2027:8): [True: 0, False: 0]
  ------------------
 2028|      0|			    a, &(f->coders[i].numInStreams)) < 0)
 2029|      0|				return (-1);
 2030|      0|			if (UMAX_ENTRY < f->coders[i].numInStreams)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2030:8): [True: 0, False: 0]
  ------------------
 2031|      0|				return (-1);
 2032|      0|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2032:8): [True: 0, False: 0]
  ------------------
 2033|      0|			    a, &(f->coders[i].numOutStreams)) < 0)
 2034|      0|				return (-1);
 2035|      0|			if (UMAX_ENTRY < f->coders[i].numOutStreams)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2035:8): [True: 0, False: 0]
  ------------------
 2036|      0|				return (-1);
 2037|      0|		}
 2038|       |
 2039|      7|		if (attr) {
  ------------------
  |  Branch (2039:7): [True: 7, False: 0]
  ------------------
 2040|      7|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2040:8): [True: 0, False: 7]
  ------------------
 2041|      7|			    a, &(f->coders[i].propertiesSize)) < 0)
 2042|      0|				return (-1);
 2043|      7|			if (UMAX_ENTRY < f->coders[i].propertiesSize)
  ------------------
  |  |  373|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2043:8): [True: 0, False: 7]
  ------------------
 2044|      0|				return (-1);
 2045|      7|			if ((p = header_bytes(
  ------------------
  |  Branch (2045:8): [True: 0, False: 7]
  ------------------
 2046|      7|			    a, (size_t)f->coders[i].propertiesSize)) == NULL)
 2047|      0|				return (-1);
 2048|      7|			f->coders[i].properties =
 2049|      7|			    malloc((size_t)f->coders[i].propertiesSize);
 2050|      7|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2050:8): [True: 0, False: 7]
  ------------------
 2051|      0|				return (-1);
 2052|      7|			memcpy(f->coders[i].properties, p,
 2053|      7|			    (size_t)f->coders[i].propertiesSize);
 2054|      7|		}
 2055|       |
 2056|      7|		numInStreamsTotal += f->coders[i].numInStreams;
 2057|      7|		numOutStreamsTotal += f->coders[i].numOutStreams;
 2058|      7|	}
 2059|       |
 2060|      7|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2060:6): [True: 0, False: 7]
  ------------------
 2061|      7|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2061:6): [True: 0, False: 7]
  ------------------
 2062|      0|		return (-1);
 2063|       |
 2064|      7|	f->numBindPairs = numOutStreamsTotal - 1;
 2065|      7|	if (zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2065:6): [True: 0, False: 7]
  ------------------
 2066|      0|			return (-1);
 2067|      7|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2067:6): [True: 0, False: 7]
  ------------------
 2068|      0|		f->bindPairs =
 2069|      0|			calloc((size_t)f->numBindPairs, sizeof(*f->bindPairs));
 2070|      0|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2070:7): [True: 0, False: 0]
  ------------------
 2071|      0|			return (-1);
 2072|      0|	} else
 2073|      7|		f->bindPairs = NULL;
 2074|      7|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2074:14): [True: 0, False: 7]
  ------------------
 2075|      0|		if (parse_7zip_uint64(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2075:7): [True: 0, False: 0]
  ------------------
 2076|      0|			return (-1);
 2077|      0|		if (UMAX_ENTRY < f->bindPairs[i].inIndex)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2077:7): [True: 0, False: 0]
  ------------------
 2078|      0|			return (-1);
 2079|      0|		if (parse_7zip_uint64(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2079:7): [True: 0, False: 0]
  ------------------
 2080|      0|			return (-1);
 2081|      0|		if (UMAX_ENTRY < f->bindPairs[i].outIndex)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2081:7): [True: 0, False: 0]
  ------------------
 2082|      0|			return (-1);
 2083|      0|	}
 2084|       |
 2085|      7|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2086|      7|	f->packedStreams =
 2087|      7|	    calloc((size_t)f->numPackedStreams, sizeof(*f->packedStreams));
 2088|      7|	if (f->packedStreams == NULL)
  ------------------
  |  Branch (2088:6): [True: 0, False: 7]
  ------------------
 2089|      0|		return (-1);
 2090|      7|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2090:6): [True: 7, False: 0]
  ------------------
 2091|      7|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2091:15): [True: 7, False: 0]
  ------------------
 2092|      7|			unsigned j;
 2093|      7|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2093:16): [True: 0, False: 7]
  ------------------
 2094|      0|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2094:9): [True: 0, False: 0]
  ------------------
 2095|      0|					break;
 2096|      0|			}
 2097|      7|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2097:8): [True: 7, False: 0]
  ------------------
 2098|      7|				break;
 2099|      7|		}
 2100|      7|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2100:7): [True: 0, False: 7]
  ------------------
 2101|      0|			return (-1);
 2102|      7|		f->packedStreams[0] = i;
 2103|      7|	} else {
 2104|      0|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2104:15): [True: 0, False: 0]
  ------------------
 2105|      0|			if (parse_7zip_uint64(a, &(f->packedStreams[i])) < 0)
  ------------------
  |  Branch (2105:8): [True: 0, False: 0]
  ------------------
 2106|      0|				return (-1);
 2107|      0|			if (UMAX_ENTRY < f->packedStreams[i])
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2107:8): [True: 0, False: 0]
  ------------------
 2108|      0|				return (-1);
 2109|      0|		}
 2110|      0|	}
 2111|      7|	f->numInStreams = numInStreamsTotal;
 2112|      7|	f->numOutStreams = numOutStreamsTotal;
 2113|       |
 2114|      7|	return (0);
 2115|      7|}
archive_read_support_format_7zip.c:decode_codec_id:
 1039|      7|{
 1040|      7|	unsigned i;
 1041|      7|	unsigned long id = 0;
 1042|       |
 1043|     14|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1043:14): [True: 7, False: 7]
  ------------------
 1044|      7|		id <<= 8;
 1045|      7|		id += codecId[i];
 1046|      7|	}
 1047|      7|	return (id);
 1048|      7|}
archive_read_support_format_7zip.c:free_Digest:
 1828|    245|{
 1829|    245|	free(d->defineds);
 1830|    245|	free(d->digests);
 1831|    245|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2263|      7|{
 2264|      7|	const unsigned char *p;
 2265|      7|	uint64_t *usizes;
 2266|      7|	size_t unpack_streams;
 2267|      7|	int type;
 2268|      7|	unsigned i;
 2269|      7|	uint32_t numDigests;
 2270|       |
 2271|      7|	memset(ss, 0, sizeof(*ss));
 2272|       |
 2273|     14|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2273:14): [True: 7, False: 7]
  ------------------
 2274|      7|		f[i].numUnpackStreams = 1;
 2275|       |
 2276|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2276:6): [True: 0, False: 7]
  ------------------
 2277|      0|		return (-1);
 2278|      7|	type = *p;
 2279|       |
 2280|      7|	if (type == kNumUnPackStream) {
  ------------------
  |  |  106|      7|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2280:6): [True: 0, False: 7]
  ------------------
 2281|      0|		unpack_streams = 0;
 2282|      0|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2282:15): [True: 0, False: 0]
  ------------------
 2283|      0|			if (parse_7zip_uint64(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2283:8): [True: 0, False: 0]
  ------------------
 2284|      0|				return (-1);
 2285|      0|			if (UMAX_ENTRY < f[i].numUnpackStreams)
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2285:8): [True: 0, False: 0]
  ------------------
 2286|      0|				return (-1);
 2287|      0|			if (unpack_streams > SIZE_MAX - UMAX_ENTRY) {
  ------------------
  |  |  373|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2287:8): [True: 0, False: 0]
  ------------------
 2288|      0|				return (-1);
 2289|      0|			}
 2290|      0|			unpack_streams += (size_t)f[i].numUnpackStreams;
 2291|      0|		}
 2292|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2292:7): [True: 0, False: 0]
  ------------------
 2293|      0|			return (-1);
 2294|      0|		type = *p;
 2295|      0|	} else
 2296|      7|		unpack_streams = numFolders;
 2297|       |
 2298|      7|	ss->unpack_streams = unpack_streams;
 2299|      7|	if (unpack_streams) {
  ------------------
  |  Branch (2299:6): [True: 7, False: 0]
  ------------------
 2300|      7|		ss->unpackSizes = calloc(unpack_streams,
 2301|      7|		    sizeof(*ss->unpackSizes));
 2302|      7|		ss->digestsDefined = calloc(unpack_streams,
 2303|      7|		    sizeof(*ss->digestsDefined));
 2304|      7|		ss->digests = calloc(unpack_streams,
 2305|      7|		    sizeof(*ss->digests));
 2306|      7|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2306:7): [True: 0, False: 7]
  |  Branch (2306:34): [True: 0, False: 7]
  ------------------
 2307|      7|		    ss->digests == NULL)
  ------------------
  |  Branch (2307:7): [True: 0, False: 7]
  ------------------
 2308|      0|			return (-1);
 2309|      7|	}
 2310|       |
 2311|      7|	usizes = ss->unpackSizes;
 2312|     14|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2312:14): [True: 7, False: 7]
  ------------------
 2313|      7|		unsigned pack;
 2314|      7|		uint64_t size, sum;
 2315|       |
 2316|      7|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2316:7): [True: 0, False: 7]
  ------------------
 2317|      0|			continue;
 2318|       |
 2319|      7|		sum = 0;
 2320|      7|		if (type == kSize) {
  ------------------
  |  |  102|      7|#define kSize			0x09
  ------------------
  |  Branch (2320:7): [True: 0, False: 7]
  ------------------
 2321|      0|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2321:19): [True: 0, False: 0]
  ------------------
 2322|      0|				if (parse_7zip_uint64(a, usizes) < 0)
  ------------------
  |  Branch (2322:9): [True: 0, False: 0]
  ------------------
 2323|      0|					return (-1);
 2324|      0|				if (*usizes > UINT64_MAX - sum)
  ------------------
  |  Branch (2324:9): [True: 0, False: 0]
  ------------------
 2325|      0|					return (-1);
 2326|      0|				sum += *usizes++;
 2327|      0|			}
 2328|      0|		}
 2329|      7|		size = folder_uncompressed_size(&f[i]);
 2330|      7|		if (size < sum)
  ------------------
  |  Branch (2330:7): [True: 0, False: 7]
  ------------------
 2331|      0|			return (-1);
 2332|      7|		*usizes++ = size - sum;
 2333|      7|	}
 2334|       |
 2335|      7|	if (type == kSize) {
  ------------------
  |  |  102|      7|#define kSize			0x09
  ------------------
  |  Branch (2335:6): [True: 0, False: 7]
  ------------------
 2336|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2336:7): [True: 0, False: 0]
  ------------------
 2337|      0|			return (-1);
 2338|      0|		type = *p;
 2339|      0|	}
 2340|       |
 2341|     14|	for (i = 0; i < unpack_streams; i++) {
  ------------------
  |  Branch (2341:14): [True: 7, False: 7]
  ------------------
 2342|      7|		ss->digestsDefined[i] = 0;
 2343|      7|		ss->digests[i] = 0;
 2344|      7|	}
 2345|       |
 2346|      7|	numDigests = 0;
 2347|     14|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2347:14): [True: 7, False: 7]
  ------------------
 2348|      7|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2348:7): [True: 0, False: 7]
  |  Branch (2348:37): [True: 7, False: 0]
  ------------------
 2349|      7|			numDigests += (uint32_t)f[i].numUnpackStreams;
 2350|      7|	}
 2351|       |
 2352|      7|	if (type == kCRC) {
  ------------------
  |  |  103|      7|#define kCRC			0x0A
  ------------------
  |  Branch (2352:6): [True: 7, False: 0]
  ------------------
 2353|      7|		struct _7z_digests tmpDigests;
 2354|      7|		unsigned char *digestsDefined = ss->digestsDefined;
 2355|      7|		uint32_t * digests = ss->digests;
 2356|      7|		int di = 0;
 2357|       |
 2358|      7|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2359|      7|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2359:7): [True: 0, False: 7]
  ------------------
 2360|      0|			free_Digest(&tmpDigests);
 2361|      0|			return (-1);
 2362|      0|		}
 2363|     14|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2363:15): [True: 7, False: 7]
  ------------------
 2364|      7|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2364:8): [True: 7, False: 0]
  |  Branch (2364:38): [True: 0, False: 7]
  ------------------
 2365|      0|				*digestsDefined++ = 1;
 2366|      0|				*digests++ = f[i].digest;
 2367|      7|			} else {
 2368|      7|				unsigned j;
 2369|       |
 2370|     14|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2370:17): [True: 7, False: 7]
  ------------------
 2371|      7|				    j++, di++) {
 2372|      7|					*digestsDefined++ =
 2373|      7|					    tmpDigests.defineds[di];
 2374|      7|					*digests++ =
 2375|      7|					    tmpDigests.digests[di];
 2376|      7|				}
 2377|      7|			}
 2378|      7|		}
 2379|      7|		free_Digest(&tmpDigests);
 2380|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2380:7): [True: 0, False: 7]
  ------------------
 2381|      0|			return (-1);
 2382|      7|		type = *p;
 2383|      7|	}
 2384|       |
 2385|       |	/*
 2386|       |	 *  Must be kEnd.
 2387|       |	 */
 2388|      7|	if (type != kEnd)
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (2388:6): [True: 0, False: 7]
  ------------------
 2389|      0|		return (-1);
 2390|      7|	return (0);
 2391|      7|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2236|      9|{
 2237|      9|	int n = (int)f->numOutStreams;
 2238|      9|	unsigned pairs = (unsigned)f->numBindPairs;
 2239|       |
 2240|      9|	while (--n >= 0) {
  ------------------
  |  Branch (2240:9): [True: 9, False: 0]
  ------------------
 2241|      9|		unsigned i;
 2242|      9|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2242:15): [True: 0, False: 9]
  ------------------
 2243|      0|			if (f->bindPairs[i].outIndex == (uint64_t)n)
  ------------------
  |  Branch (2243:8): [True: 0, False: 0]
  ------------------
 2244|      0|				break;
 2245|      0|		}
 2246|      9|		if (i >= pairs)
  ------------------
  |  Branch (2246:7): [True: 9, False: 0]
  ------------------
 2247|      9|			return (f->unPackSize[n]);
 2248|      9|	}
 2249|      0|	return (0);
 2250|      9|}
archive_read_support_format_7zip.c:read_consume:
  975|    347|{
  976|    347|	struct _7zip *zip = (struct _7zip *)a->format->data;
  977|       |
  978|    347|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (978:6): [True: 347, False: 0]
  ------------------
  979|    347|		__archive_read_consume(a, zip->pack_stream_bytes_unconsumed);
  980|    347|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
  981|    347|		zip->pack_stream_bytes_unconsumed = 0;
  982|    347|	}
  983|    347|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3504|      2|{
 3505|      2|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3506|      2|	const struct _7z_coder *coder1, *coder2;
 3507|      2|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3507:22): [True: 0, False: 2]
  ------------------
 3508|      2|	unsigned i;
 3509|      2|	int r, found_bcj2 = 0;
 3510|       |
 3511|       |	/*
 3512|       |	 * Release the memory which the previous folder used for BCJ2.
 3513|       |	 */
 3514|      8|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3514:14): [True: 6, False: 2]
  ------------------
 3515|      6|		free(zip->sub_stream_buff[i]);
 3516|      6|		zip->sub_stream_buff[i] = NULL;
 3517|      6|	}
 3518|       |
 3519|       |	/*
 3520|       |	 * Initialize a stream reader.
 3521|       |	 */
 3522|      2|	zip->pack_stream_remaining = (unsigned)folder->numPackedStreams;
 3523|      2|	zip->pack_stream_index = (unsigned)folder->packIndex;
 3524|      2|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3525|      2|	zip->uncompressed_buffer_bytes_remaining = 0;
 3526|       |
 3527|       |	/*
 3528|       |	 * Check coder types.
 3529|       |	 */
 3530|      4|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3530:14): [True: 2, False: 2]
  ------------------
 3531|      2|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3531:10): [True: 2, False: 0]
  ------------------
 3532|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |   74|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3532:4): [True: 0, False: 2]
  ------------------
 3533|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |   75|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3533:4): [True: 0, False: 2]
  ------------------
 3534|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |   76|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3534:4): [True: 0, False: 2]
  ------------------
 3535|       |				/* For entry that is associated with this folder, mark
 3536|       |				   it as encrypted (data+metadata). */
 3537|      0|				zip->has_encrypted_entries = 1;
 3538|      0|				if (a->entry) {
  ------------------
  |  Branch (3538:9): [True: 0, False: 0]
  ------------------
 3539|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 3540|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 3541|      0|				}
 3542|      0|				archive_set_error(&(a->archive),
 3543|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3544|      0|					"The %s is encrypted, "
 3545|      0|					"but currently not supported", cname);
 3546|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3547|      0|			}
 3548|      0|			case _7Z_X86_BCJ2: {
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3548:4): [True: 0, False: 2]
  ------------------
 3549|      0|				found_bcj2++;
 3550|      0|				break;
 3551|      0|			}
 3552|      2|		}
 3553|      2|	}
 3554|       |	/* Now that we've checked for encryption, if there were still no
 3555|       |	 * encrypted entries found we can say for sure that there are none.
 3556|       |	 */
 3557|      2|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|      2|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3557:6): [True: 0, False: 2]
  ------------------
 3558|      0|		zip->has_encrypted_entries = 0;
 3559|      0|	}
 3560|       |
 3561|      2|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3561:7): [True: 0, False: 2]
  |  Branch (3561:32): [True: 0, False: 0]
  |  Branch (3561:48): [True: 0, False: 2]
  ------------------
 3562|      0|		archive_set_error(&(a->archive),
 3563|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3564|      0|		    "The %s is encoded with many filters, "
 3565|      0|		    "but currently not supported", cname);
 3566|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3567|      0|	}
 3568|      2|	coder1 = &(folder->coders[0]);
 3569|      2|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3569:6): [True: 0, False: 2]
  ------------------
 3570|      0|		coder2 = &(folder->coders[1]);
 3571|      2|	else
 3572|      2|		coder2 = NULL;
 3573|       |
 3574|      2|	if (found_bcj2) {
  ------------------
  |  Branch (3574:6): [True: 0, False: 2]
  ------------------
 3575|       |		/*
 3576|       |		 * Preparation to decode BCJ2.
 3577|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 3578|       |		 * as far as I know, two types of the storage form.
 3579|       |		 */
 3580|      0|		const struct _7z_coder *fc = folder->coders;
 3581|      0|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3582|      0|		const struct _7z_coder *scoder[3] =
 3583|      0|			{&coder_copy, &coder_copy, &coder_copy};
 3584|      0|		const void *buff;
 3585|      0|		ssize_t bytes;
 3586|      0|		unsigned char *b[3] = {NULL, NULL, NULL};
 3587|      0|		uint64_t sunpack[3] ={-1, -1, -1};
 3588|      0|		size_t s[3] = {0, 0, 0};
 3589|      0|		int idx[3] = {0, 1, 2};
 3590|       |
 3591|      0|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3591:7): [True: 0, False: 0]
  |  Branch (3591:33): [True: 0, False: 0]
  ------------------
 3592|      0|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3592:7): [True: 0, False: 0]
  |  Branch (3592:36): [True: 0, False: 0]
  ------------------
 3593|      0|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3593:7): [True: 0, False: 0]
  ------------------
 3594|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3595|      0|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3595:8): [True: 0, False: 0]
  ------------------
 3596|       |				/* The form made by 7zr */
 3597|      0|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3598|      0|				scoder[1] = &(fc[1]);
 3599|      0|				scoder[2] = &(fc[0]);
 3600|      0|				sunpack[1] = folder->unPackSize[1];
 3601|      0|				sunpack[2] = folder->unPackSize[0];
 3602|      0|				coder1 = &(fc[2]);
 3603|      0|			} else {
 3604|       |				/*
 3605|       |				 * NOTE: Some patterns do not work.
 3606|       |				 * work:
 3607|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 3608|       |				 *       -m3=(any)
 3609|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 3610|       |				 *       -m3=COPY
 3611|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 3612|       |				 *       -m3=COPY
 3613|       |				 * not work:
 3614|       |				 *  other patterns.
 3615|       |				 *
 3616|       |				 * We have to handle this like `pipe' or
 3617|       |				 * our libarchive7s filter frame work,
 3618|       |				 * decoding the BCJ2 main stream sequentially,
 3619|       |				 * m3 -> m2 -> m1 -> BCJ2.
 3620|       |				 *
 3621|       |				 */
 3622|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3622:9): [True: 0, False: 0]
  ------------------
 3623|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3623:9): [True: 0, False: 0]
  ------------------
 3624|      0|					coder1 = &(folder->coders[2]);
 3625|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3625:14): [True: 0, False: 0]
  ------------------
 3626|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3626:9): [True: 0, False: 0]
  ------------------
 3627|      0|					coder1 = &(folder->coders[1]);
 3628|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3628:14): [True: 0, False: 0]
  ------------------
 3629|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   67|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3629:9): [True: 0, False: 0]
  ------------------
 3630|      0|					coder1 = &(folder->coders[0]);
 3631|      0|				else {
 3632|      0|					archive_set_error(&(a->archive),
 3633|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3634|      0|					    "Unsupported form of "
 3635|      0|					    "BCJ2 streams");
 3636|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3637|      0|				}
 3638|      0|			}
 3639|      0|			coder2 = &(fc[3]);
 3640|      0|			zip->main_stream_bytes_remaining =
 3641|      0|				(size_t)folder->unPackSize[2];
 3642|      0|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3642:14): [True: 0, False: 0]
  |  Branch (3642:32): [True: 0, False: 0]
  ------------------
 3643|      0|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (3643:7): [True: 0, False: 0]
  ------------------
 3644|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (3644:7): [True: 0, False: 0]
  |  Branch (3644:36): [True: 0, False: 0]
  ------------------
 3645|       |			/* Source type 0 made by 7z */
 3646|      0|			zip->main_stream_bytes_remaining =
 3647|      0|				(size_t)folder->unPackSize[0];
 3648|      0|		} else {
 3649|       |			/* We got an unexpected form. */
 3650|      0|			archive_set_error(&(a->archive),
 3651|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3652|      0|			    "Unsupported form of BCJ2 streams");
 3653|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3654|      0|		}
 3655|       |
 3656|       |		/* Skip the main stream at this time. */
 3657|      0|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3657:7): [True: 0, False: 0]
  ------------------
 3658|      0|			return (r);
 3659|      0|		zip->pack_stream_bytes_unconsumed =
 3660|      0|		    (size_t)zip->pack_stream_inbytes_remaining;
 3661|      0|		read_consume(a);
 3662|       |
 3663|       |		/* Read following three sub streams. */
 3664|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3664:15): [True: 0, False: 0]
  ------------------
 3665|      0|			const struct _7z_coder *coder = scoder[i];
 3666|       |
 3667|      0|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (3667:8): [True: 0, False: 0]
  ------------------
 3668|      0|				free(b[0]); free(b[1]); free(b[2]);
 3669|      0|				return (r);
 3670|      0|			}
 3671|       |
 3672|      0|			if (sunpack[i] == (uint64_t)-1)
  ------------------
  |  Branch (3672:8): [True: 0, False: 0]
  ------------------
 3673|      0|				zip->folder_outbytes_remaining =
 3674|      0|				    zip->pack_stream_inbytes_remaining;
 3675|      0|			else
 3676|      0|				zip->folder_outbytes_remaining = sunpack[i];
 3677|       |
 3678|      0|			r = init_decompression(a, zip, coder, NULL);
 3679|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3679:8): [True: 0, False: 0]
  ------------------
 3680|      0|				free(b[0]); free(b[1]); free(b[2]);
 3681|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3682|      0|			}
 3683|       |
 3684|       |			/* Allocate memory for the decoded data of a sub
 3685|       |			 * stream. */
 3686|      0|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 3687|      0|			if (b[i] == NULL) {
  ------------------
  |  Branch (3687:8): [True: 0, False: 0]
  ------------------
 3688|      0|				free(b[0]); free(b[1]); free(b[2]);
 3689|      0|				archive_set_error(&a->archive, ENOMEM,
 3690|      0|				    "No memory for 7-Zip decompression");
 3691|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3692|      0|			}
 3693|       |
 3694|       |			/* Extract a sub stream. */
 3695|      0|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3695:11): [True: 0, False: 0]
  ------------------
 3696|      0|				r = (int)extract_pack_stream(a, 0);
 3697|      0|				if (r < 0) {
  ------------------
  |  Branch (3697:9): [True: 0, False: 0]
  ------------------
 3698|      0|					free(b[0]); free(b[1]); free(b[2]);
 3699|      0|					return (r);
 3700|      0|				}
 3701|      0|				bytes = get_uncompressed_data(a, &buff,
 3702|      0|				    zip->uncompressed_buffer_bytes_remaining,
 3703|      0|				    0);
 3704|      0|				if (bytes < 0) {
  ------------------
  |  Branch (3704:9): [True: 0, False: 0]
  ------------------
 3705|      0|					free(b[0]); free(b[1]); free(b[2]);
 3706|      0|					return ((int)bytes);
 3707|      0|				}
 3708|      0|				memcpy(b[i]+s[i], buff, bytes);
 3709|      0|				s[i] += bytes;
 3710|      0|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3710:9): [True: 0, False: 0]
  ------------------
 3711|      0|					read_consume(a);
 3712|      0|			}
 3713|      0|		}
 3714|       |
 3715|       |		/* Set the sub streams to the right place. */
 3716|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3716:15): [True: 0, False: 0]
  ------------------
 3717|      0|			zip->sub_stream_buff[i] = b[idx[i]];
 3718|      0|			zip->sub_stream_size[i] = s[idx[i]];
 3719|      0|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 3720|      0|		}
 3721|       |
 3722|       |		/* Allocate memory used for decoded main stream bytes. */
 3723|      0|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (3723:7): [True: 0, False: 0]
  ------------------
 3724|      0|			zip->tmp_stream_buff_size = 32 * 1024;
 3725|      0|			zip->tmp_stream_buff =
 3726|      0|			    malloc(zip->tmp_stream_buff_size);
 3727|      0|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (3727:8): [True: 0, False: 0]
  ------------------
 3728|      0|				archive_set_error(&a->archive, ENOMEM,
 3729|      0|				    "No memory for 7-Zip decompression");
 3730|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3731|      0|			}
 3732|      0|		}
 3733|      0|		zip->tmp_stream_bytes_avail = 0;
 3734|      0|		zip->tmp_stream_bytes_remaining = 0;
 3735|      0|		zip->odd_bcj_size = 0;
 3736|      0|		zip->bcj2_outPos = 0;
 3737|       |
 3738|       |		/*
 3739|       |		 * Reset a stream reader in order to read the main stream
 3740|       |		 * of BCJ2.
 3741|       |		 */
 3742|      0|		zip->pack_stream_remaining = 1;
 3743|      0|		zip->pack_stream_index = (unsigned)folder->packIndex;
 3744|      0|		zip->folder_outbytes_remaining =
 3745|      0|		    folder_uncompressed_size(folder);
 3746|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 3747|      0|	}
 3748|       |
 3749|       |	/*
 3750|       |	 * Initialize the decompressor for the new folder's pack streams.
 3751|       |	 */
 3752|      2|	r = init_decompression(a, zip, coder1, coder2);
 3753|      2|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3753:6): [True: 0, False: 2]
  ------------------
 3754|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3755|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3756|      2|}
archive_read_support_format_7zip.c:init_decompression:
 1087|      2|{
 1088|      2|	int r;
 1089|       |
 1090|      2|	zip->codec = coder1->codec;
 1091|      2|	zip->codec2 = -1;
 1092|       |
 1093|      2|	switch (zip->codec) {
 1094|      1|	case _7Z_COPY:
  ------------------
  |  |   67|      1|#define _7Z_COPY	0
  ------------------
  |  Branch (1094:2): [True: 1, False: 1]
  ------------------
 1095|      1|	case _7Z_BZ2:
  ------------------
  |  |   71|      1|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1095:2): [True: 0, False: 2]
  ------------------
 1096|      1|	case _7Z_DEFLATE:
  ------------------
  |  |   70|      1|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1096:2): [True: 0, False: 2]
  ------------------
 1097|      1|	case _7Z_ZSTD:
  ------------------
  |  |   88|      1|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1097:2): [True: 0, False: 2]
  ------------------
 1098|      1|	case _7Z_PPMD:
  ------------------
  |  |   72|      1|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1098:2): [True: 0, False: 2]
  ------------------
 1099|      1|		if (coder2 != NULL) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 1]
  ------------------
 1100|      0|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1100:8): [True: 0, False: 0]
  ------------------
 1101|      0|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1101:8): [True: 0, False: 0]
  ------------------
 1102|      0|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |   83|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1102:8): [True: 0, False: 0]
  ------------------
 1103|      0|			    coder2->codec != _7Z_ARM64) {
  ------------------
  |  |   85|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1103:8): [True: 0, False: 0]
  ------------------
 1104|      0|				archive_set_error(&a->archive,
 1105|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1106|      0|				    "Unsupported filter %lx for %lx",
 1107|      0|				    coder2->codec, coder1->codec);
 1108|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1109|      0|			}
 1110|      0|			zip->codec2 = coder2->codec;
 1111|      0|			zip->bcj_state = 0;
 1112|      0|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1112:8): [True: 0, False: 0]
  ------------------
 1113|      0|				x86_Init(zip);
 1114|      0|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |   83|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1114:13): [True: 0, False: 0]
  ------------------
 1115|      0|				arm_Init(zip);
 1116|      0|		}
 1117|      1|		break;
 1118|      1|	default:
  ------------------
  |  Branch (1118:2): [True: 1, False: 1]
  ------------------
 1119|      1|		break;
 1120|      2|	}
 1121|       |
 1122|      2|	switch (zip->codec) {
 1123|      1|	case _7Z_COPY:
  ------------------
  |  |   67|      1|#define _7Z_COPY	0
  ------------------
  |  Branch (1123:2): [True: 1, False: 1]
  ------------------
 1124|      1|		break;
 1125|       |
 1126|      1|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   68|      0|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   69|      1|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1126:2): [True: 0, False: 2]
  |  Branch (1126:17): [True: 1, False: 1]
  ------------------
 1127|      1|#ifdef HAVE_LZMA_H
 1128|      1|#if LZMA_VERSION_MAJOR >= 5
 1129|       |/* Effectively disable the limiter. */
 1130|      1|#define LZMA_MEMLIMIT   UINT64_MAX
 1131|       |#else
 1132|       |/* NOTE: This needs to check memory size which running system has. */
 1133|       |#define LZMA_MEMLIMIT   (1U << 30)
 1134|       |#endif
 1135|      1|	{
 1136|      1|		lzma_options_delta delta_opt;
 1137|      1|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1138|      1|		int fi = 0;
 1139|       |
 1140|      1|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1140:7): [True: 0, False: 1]
  ------------------
 1141|      0|			lzma_end(&(zip->lzstream));
 1142|      0|			zip->lzstream_valid = 0;
 1143|      0|		}
 1144|       |
 1145|       |		/*
 1146|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1147|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1148|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1149|       |		 * and so liblzma cannot know the end of the compressed data
 1150|       |		 * without EOPM. So consequently liblzma will not return last
 1151|       |		 * three or four bytes of uncompressed data because
 1152|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1153|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1154|       |		 * or know the uncompressed data size, liblzma will flush out
 1155|       |		 * the remaining that three or four bytes of uncompressed
 1156|       |		 * data. That is why we have to use our converting program
 1157|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1158|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1159|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1160|       |		 * there is no way to do that.
 1161|       |		 * Discussion about this can be found at XZ Utils forum.
 1162|       |		 */
 1163|      1|		if (coder2 != NULL) {
  ------------------
  |  Branch (1163:7): [True: 0, False: 1]
  ------------------
 1164|      0|			zip->codec2 = coder2->codec;
 1165|       |
 1166|      0|			filters[fi].options = NULL;
 1167|      0|			switch (zip->codec2) {
 1168|      0|			case _7Z_X86:
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1168:4): [True: 0, False: 0]
  ------------------
 1169|      0|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   69|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1169:9): [True: 0, False: 0]
  ------------------
 1170|      0|					filters[fi].id = LZMA_FILTER_X86;
 1171|      0|					fi++;
 1172|      0|				} else
 1173|       |					/* Use our filter. */
 1174|      0|					x86_Init(zip);
 1175|      0|				break;
 1176|      0|			case _7Z_X86_BCJ2:
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1176:4): [True: 0, False: 0]
  ------------------
 1177|       |				/* Use our filter. */
 1178|      0|				zip->bcj_state = 0;
 1179|      0|				break;
 1180|      0|			case _7Z_DELTA:
  ------------------
  |  |   73|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1180:4): [True: 0, False: 0]
  ------------------
 1181|      0|				if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1181:9): [True: 0, False: 0]
  ------------------
 1182|      0|					archive_set_error(&a->archive,
 1183|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1184|      0|					    "Invalid Delta parameter");
 1185|      0|					return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1186|      0|				}
 1187|      0|				filters[fi].id = LZMA_FILTER_DELTA;
 1188|      0|				memset(&delta_opt, 0, sizeof(delta_opt));
 1189|      0|				delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1190|      0|				delta_opt.dist =
 1191|      0|				    (uint32_t)coder2->properties[0] + 1;
 1192|      0|				filters[fi].options = &delta_opt;
 1193|      0|				fi++;
 1194|      0|				break;
 1195|       |			/* Following filters have not been tested yet. */
 1196|      0|			case _7Z_POWERPC:
  ------------------
  |  |   81|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1196:4): [True: 0, False: 0]
  ------------------
 1197|      0|				filters[fi].id = LZMA_FILTER_POWERPC;
 1198|      0|				fi++;
 1199|      0|				break;
 1200|      0|			case _7Z_IA64:
  ------------------
  |  |   82|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1200:4): [True: 0, False: 0]
  ------------------
 1201|      0|				filters[fi].id = LZMA_FILTER_IA64;
 1202|      0|				fi++;
 1203|      0|				break;
 1204|      0|			case _7Z_ARM:
  ------------------
  |  |   83|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1204:4): [True: 0, False: 0]
  ------------------
 1205|      0|				filters[fi].id = LZMA_FILTER_ARM;
 1206|      0|				fi++;
 1207|      0|				break;
 1208|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |   84|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1208:4): [True: 0, False: 0]
  ------------------
 1209|      0|				filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1210|      0|				fi++;
 1211|      0|				break;
 1212|       |#ifdef LZMA_FILTER_ARM64
 1213|       |			case _7Z_ARM64:
 1214|       |				filters[fi].id = LZMA_FILTER_ARM64;
 1215|       |				fi++;
 1216|       |				break;
 1217|       |#endif
 1218|      0|			case _7Z_SPARC:
  ------------------
  |  |   86|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1218:4): [True: 0, False: 0]
  ------------------
 1219|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1220|      0|				fi++;
 1221|      0|				break;
 1222|      0|			default:
  ------------------
  |  Branch (1222:4): [True: 0, False: 0]
  ------------------
 1223|      0|				archive_set_error(&a->archive,
 1224|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1225|      0|				    "Unexpected codec ID: %lX", zip->codec2);
 1226|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1227|      0|			}
 1228|      0|		}
 1229|       |
 1230|      1|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   69|      1|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1230:7): [True: 1, False: 0]
  ------------------
 1231|      1|			filters[fi].id = LZMA_FILTER_LZMA2;
 1232|      0|		else
 1233|      0|			filters[fi].id = LZMA_FILTER_LZMA1;
 1234|      1|		filters[fi].options = NULL;
 1235|      1|		ff = &filters[fi];
 1236|      1|		r = lzma_properties_decode(&filters[fi], NULL,
 1237|      1|		    coder1->properties, (size_t)coder1->propertiesSize);
 1238|      1|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1238:7): [True: 0, False: 1]
  ------------------
 1239|      0|			set_error(a, r);
 1240|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1241|      0|		}
 1242|      1|		fi++;
 1243|       |
 1244|      1|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1245|      1|		filters[fi].options = NULL;
 1246|      1|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1247|      1|		free(ff->options);
 1248|      1|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1248:7): [True: 0, False: 1]
  ------------------
 1249|      0|			set_error(a, r);
 1250|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1251|      0|		}
 1252|      1|		zip->lzstream_valid = 1;
 1253|      1|		zip->lzstream.total_in = 0;
 1254|      1|		zip->lzstream.total_out = 0;
 1255|      1|		break;
 1256|      1|	}
 1257|       |#else
 1258|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1259|       |		    "LZMA codec is unsupported");
 1260|       |		return (ARCHIVE_FAILED);
 1261|       |#endif
 1262|      0|	case _7Z_BZ2:
  ------------------
  |  |   71|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1262:2): [True: 0, False: 2]
  ------------------
 1263|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1264|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1264:7): [True: 0, False: 0]
  ------------------
 1265|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1266|      0|			zip->bzstream_valid = 0;
 1267|      0|		}
 1268|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1269|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1269:7): [True: 0, False: 0]
  ------------------
 1270|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1271|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1271:7): [True: 0, False: 0]
  ------------------
 1272|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1273|      0|			const char *detail = NULL;
 1274|      0|			switch (r) {
  ------------------
  |  Branch (1274:12): [True: 0, False: 0]
  ------------------
 1275|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1275:4): [True: 0, False: 0]
  ------------------
 1276|      0|				detail = "invalid setup parameter";
 1277|      0|				break;
 1278|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1278:4): [True: 0, False: 0]
  ------------------
 1279|      0|				err = ENOMEM;
 1280|      0|				detail = "out of memory";
 1281|      0|				break;
 1282|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1282:4): [True: 0, False: 0]
  ------------------
 1283|      0|				detail = "mis-compiled library";
 1284|      0|				break;
 1285|      0|			}
 1286|      0|			archive_set_error(&a->archive, err,
 1287|      0|			    "Internal error initializing decompressor: %s",
 1288|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1288:8): [True: 0, False: 0]
  ------------------
 1289|      0|			zip->bzstream_valid = 0;
 1290|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1291|      0|		}
 1292|      0|		zip->bzstream_valid = 1;
 1293|      0|		zip->bzstream.total_in_lo32 = 0;
 1294|      0|		zip->bzstream.total_in_hi32 = 0;
 1295|      0|		zip->bzstream.total_out_lo32 = 0;
 1296|      0|		zip->bzstream.total_out_hi32 = 0;
 1297|      0|		break;
 1298|       |#else
 1299|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1300|       |		    "BZ2 codec is unsupported");
 1301|       |		return (ARCHIVE_FAILED);
 1302|       |#endif
 1303|      0|	case _7Z_ZSTD:
  ------------------
  |  |   88|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1303:2): [True: 0, False: 2]
  ------------------
 1304|      0|	{
 1305|       |#if defined(HAVE_ZSTD_H)
 1306|       |		if (zip->zstdstream_valid) {
 1307|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1308|       |			zip->zstdstream_valid = 0;
 1309|       |		}
 1310|       |		zip->zstd_dstream = ZSTD_createDStream();
 1311|       |		zip->zstdstream_valid = 1;
 1312|       |		break;
 1313|       |#else
 1314|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1315|      0|			"ZSTD codec is unsupported");
 1316|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1317|      0|#endif
 1318|      0|	}
 1319|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   70|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1319:2): [True: 0, False: 2]
  ------------------
 1320|      0|#ifdef HAVE_ZLIB_H
 1321|      0|		if (zip->stream_valid)
  ------------------
  |  Branch (1321:7): [True: 0, False: 0]
  ------------------
 1322|      0|			r = inflateReset(&(zip->stream));
 1323|      0|		else
 1324|      0|			r = inflateInit2(&(zip->stream),
 1325|      0|			    -15 /* Don't check for zlib header */);
 1326|      0|		if (r != Z_OK) {
  ------------------
  |  Branch (1326:7): [True: 0, False: 0]
  ------------------
 1327|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1328|      0|			    "Couldn't initialize zlib stream.");
 1329|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1330|      0|		}
 1331|      0|		zip->stream_valid = 1;
 1332|      0|		zip->stream.total_in = 0;
 1333|      0|		zip->stream.total_out = 0;
 1334|      0|		break;
 1335|       |#else
 1336|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1337|       |		    "DEFLATE codec is unsupported");
 1338|       |		return (ARCHIVE_FAILED);
 1339|       |#endif
 1340|      0|	case _7Z_PPMD:
  ------------------
  |  |   72|      0|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1340:2): [True: 0, False: 2]
  ------------------
 1341|      0|	{
 1342|      0|		unsigned order;
 1343|      0|		uint32_t msize;
 1344|       |
 1345|      0|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1345:7): [True: 0, False: 0]
  ------------------
 1346|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1347|      0|			    &zip->ppmd7_context);
 1348|      0|			zip->ppmd7_valid = 0;
 1349|      0|		}
 1350|       |
 1351|      0|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1351:7): [True: 0, False: 0]
  ------------------
 1352|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1353|      0|			    "Malformed PPMd parameter");
 1354|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1355|      0|		}
 1356|      0|		order = coder1->properties[0];
 1357|      0|		msize = archive_le32dec(&(coder1->properties[1]));
 1358|      0|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|      0|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|      0|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1358:7): [True: 0, False: 0]
  |  Branch (1358:34): [True: 0, False: 0]
  ------------------
 1359|      0|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|      0|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|      0|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1359:7): [True: 0, False: 0]
  |  Branch (1359:37): [True: 0, False: 0]
  ------------------
 1360|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1361|      0|			    "Malformed PPMd parameter");
 1362|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1363|      0|		}
 1364|      0|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1365|      0|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1366|      0|			&zip->ppmd7_context, msize);
 1367|      0|		if (r == 0) {
  ------------------
  |  Branch (1367:7): [True: 0, False: 0]
  ------------------
 1368|      0|			archive_set_error(&a->archive, ENOMEM,
 1369|      0|			    "Coludn't allocate memory for PPMd");
 1370|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1371|      0|		}
 1372|      0|		__archive_ppmd7_functions.Ppmd7_Init(
 1373|      0|			&zip->ppmd7_context, order);
 1374|      0|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1375|      0|			&zip->range_dec);
 1376|      0|		zip->ppmd7_valid = 1;
 1377|      0|		zip->ppmd7_stat = 0;
 1378|      0|		zip->ppstream.overconsumed = 0;
 1379|      0|		zip->ppstream.total_in = 0;
 1380|      0|		zip->ppstream.total_out = 0;
 1381|      0|		break;
 1382|      0|	}
 1383|      0|	case _7Z_X86:
  ------------------
  |  |   79|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1383:2): [True: 0, False: 2]
  ------------------
 1384|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |   80|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1384:2): [True: 0, False: 2]
  ------------------
 1385|      0|	case _7Z_POWERPC:
  ------------------
  |  |   81|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1385:2): [True: 0, False: 2]
  ------------------
 1386|      0|	case _7Z_IA64:
  ------------------
  |  |   82|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1386:2): [True: 0, False: 2]
  ------------------
 1387|      0|	case _7Z_ARM:
  ------------------
  |  |   83|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1387:2): [True: 0, False: 2]
  ------------------
 1388|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |   84|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1388:2): [True: 0, False: 2]
  ------------------
 1389|      0|	case _7Z_ARM64:
  ------------------
  |  |   85|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1389:2): [True: 0, False: 2]
  ------------------
 1390|      0|	case _7Z_SPARC:
  ------------------
  |  |   86|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1390:2): [True: 0, False: 2]
  ------------------
 1391|      0|	case _7Z_DELTA:
  ------------------
  |  |   73|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1391:2): [True: 0, False: 2]
  ------------------
 1392|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1393|      0|		    "Unexpected codec ID: %lX", zip->codec);
 1394|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1395|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |   74|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1395:2): [True: 0, False: 2]
  ------------------
 1396|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |   75|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1396:2): [True: 0, False: 2]
  ------------------
 1397|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |   76|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1397:2): [True: 0, False: 2]
  ------------------
 1398|      0|		if (a->entry) {
  ------------------
  |  Branch (1398:7): [True: 0, False: 0]
  ------------------
 1399|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1400|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1401|      0|			zip->has_encrypted_entries = 1;
 1402|      0|		}
 1403|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1404|      0|		    "Crypto codec not supported yet (ID: 0x%lX)", zip->codec);
 1405|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1406|      0|	default:
  ------------------
  |  Branch (1406:2): [True: 0, False: 2]
  ------------------
 1407|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1408|      0|		    "Unknown codec ID: %lX", zip->codec);
 1409|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1410|      2|	}
 1411|       |
 1412|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1413|      2|}
archive_read_support_format_7zip.c:seek_pack:
 3364|      2|{
 3365|      2|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3366|      2|	int64_t pack_offset;
 3367|       |
 3368|      2|	if (zip->pack_stream_remaining <= 0) {
  ------------------
  |  Branch (3368:6): [True: 0, False: 2]
  ------------------
 3369|      0|		archive_set_error(&(a->archive),
 3370|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3371|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3372|      0|	}
 3373|      2|	zip->pack_stream_inbytes_remaining =
 3374|      2|	    zip->si.pi.sizes[zip->pack_stream_index];
 3375|      2|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3376|      2|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3376:6): [True: 2, False: 0]
  ------------------
 3377|      2|		if (0 > __archive_read_seek(a, pack_offset + zip->seek_base,
  ------------------
  |  Branch (3377:7): [True: 0, False: 2]
  ------------------
 3378|      2|		    SEEK_SET))
 3379|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3380|      2|		zip->stream_offset = pack_offset;
 3381|      2|	}
 3382|      2|	zip->pack_stream_index++;
 3383|      2|	zip->pack_stream_remaining--;
 3384|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3385|      2|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2395|    238|{
 2396|    238|	free_PackInfo(&(si->pi));
 2397|    238|	free_CodersInfo(&(si->ci));
 2398|    238|	free_SubStreamsInfo(&(si->ss));
 2399|    238|}
archive_read_support_format_7zip.c:free_PackInfo:
 1874|    238|{
 1875|    238|	free(pi->sizes);
 1876|    238|	free(pi->positions);
 1877|    238|	free_Digest(&(pi->digest));
 1878|    238|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2119|    238|{
 2120|    238|	unsigned i;
 2121|       |
 2122|    238|	if (ci->folders) {
  ------------------
  |  Branch (2122:6): [True: 7, False: 231]
  ------------------
 2123|     14|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2123:15): [True: 7, False: 7]
  ------------------
 2124|      7|			free_Folder(&(ci->folders[i]));
 2125|      7|		free(ci->folders);
 2126|      7|	}
 2127|    238|}
archive_read_support_format_7zip.c:free_Folder:
 1958|      7|{
 1959|      7|	unsigned i;
 1960|       |
 1961|      7|	if (f->coders) {
  ------------------
  |  Branch (1961:6): [True: 7, False: 0]
  ------------------
 1962|     14|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (1962:15): [True: 7, False: 7]
  ------------------
 1963|      7|			free(f->coders[i].properties);
 1964|      7|		}
 1965|      7|		free(f->coders);
 1966|      7|	}
 1967|      7|	free(f->bindPairs);
 1968|      7|	free(f->packedStreams);
 1969|      7|	free(f->unPackSize);
 1970|      7|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2254|    238|{
 2255|    238|	free(ss->unpackSizes);
 2256|    238|	free(ss->digestsDefined);
 2257|    238|	free(ss->digests);
 2258|    238|}
archive_read_support_format_7zip.c:read_Header:
 2489|      7|{
 2490|      7|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2491|      7|	const unsigned char *p;
 2492|      7|	struct _7z_folder *folders;
 2493|      7|	struct _7z_stream_info *si = &(zip->si);
 2494|      7|	struct _7zip_entry *entries;
 2495|      7|	uint32_t folderIndex, indexInFolder;
 2496|      7|	unsigned i;
 2497|      7|	int eindex, empty_streams, sindex;
 2498|       |
 2499|      7|	if (check_header_id) {
  ------------------
  |  Branch (2499:6): [True: 0, False: 7]
  ------------------
 2500|       |		/*
 2501|       |		 * Read Header.
 2502|       |		 */
 2503|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|			return (-1);
 2505|      0|		if (*p != kHeader)
  ------------------
  |  |   94|      0|#define kHeader			0x01
  ------------------
  |  Branch (2505:7): [True: 0, False: 0]
  ------------------
 2506|      0|			return (-1);
 2507|      0|	}
 2508|       |
 2509|       |	/*
 2510|       |	 * Read ArchiveProperties.
 2511|       |	 */
 2512|      7|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2512:6): [True: 0, False: 7]
  ------------------
 2513|      0|		return (-1);
 2514|      7|	if (*p == kArchiveProperties) {
  ------------------
  |  |   95|      7|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2514:6): [True: 0, False: 7]
  ------------------
 2515|      0|		for (;;) {
 2516|      0|			uint64_t size;
 2517|      0|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2517:8): [True: 0, False: 0]
  ------------------
 2518|      0|				return (-1);
 2519|      0|			if (*p == 0)
  ------------------
  |  Branch (2519:8): [True: 0, False: 0]
  ------------------
 2520|      0|				break;
 2521|      0|			if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2521:8): [True: 0, False: 0]
  ------------------
 2522|      0|				return (-1);
 2523|      0|		}
 2524|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2524:7): [True: 0, False: 0]
  ------------------
 2525|      0|			return (-1);
 2526|      0|	}
 2527|       |
 2528|       |	/*
 2529|       |	 * Read MainStreamsInfo.
 2530|       |	 */
 2531|      7|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |   97|      7|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2531:6): [True: 7, False: 0]
  ------------------
 2532|      7|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2532:7): [True: 0, False: 7]
  ------------------
 2533|      0|			return (-1);
 2534|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2534:7): [True: 0, False: 7]
  ------------------
 2535|      0|			return (-1);
 2536|      7|	}
 2537|      7|	if (*p == kEnd)
  ------------------
  |  |   93|      7|#define kEnd			0x00
  ------------------
  |  Branch (2537:6): [True: 0, False: 7]
  ------------------
 2538|      0|		return (0);
 2539|       |
 2540|       |	/*
 2541|       |	 * Read FilesInfo.
 2542|       |	 */
 2543|      7|	if (*p != kFilesInfo)
  ------------------
  |  |   98|      7|#define kFilesInfo		0x05
  ------------------
  |  Branch (2543:6): [True: 0, False: 7]
  ------------------
 2544|      0|		return (-1);
 2545|       |
 2546|      7|	if (parse_7zip_uint64(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2546:6): [True: 0, False: 7]
  ------------------
 2547|      0|		return (-1);
 2548|      7|	if (UMAX_ENTRY < zip->numFiles)
  ------------------
  |  |  373|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2548:6): [True: 0, False: 7]
  ------------------
 2549|      0|		return (-1);
 2550|       |
 2551|      7|	zip->entries = calloc((size_t)zip->numFiles, sizeof(*zip->entries));
 2552|      7|	if (zip->entries == NULL)
  ------------------
  |  Branch (2552:6): [True: 0, False: 7]
  ------------------
 2553|      0|		return (-1);
 2554|      7|	entries = zip->entries;
 2555|       |
 2556|      7|	empty_streams = 0;
 2557|     37|	for (;;) {
 2558|     37|		int type;
 2559|     37|		uint64_t size;
 2560|     37|		size_t ll;
 2561|       |
 2562|     37|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2562:7): [True: 0, False: 37]
  ------------------
 2563|      0|			return (-1);
 2564|     37|		type = *p;
 2565|     37|		if (type == kEnd)
  ------------------
  |  |   93|     37|#define kEnd			0x00
  ------------------
  |  Branch (2565:7): [True: 2, False: 35]
  ------------------
 2566|      2|			break;
 2567|       |
 2568|     35|		if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2568:7): [True: 0, False: 35]
  ------------------
 2569|      0|			return (-1);
 2570|     35|		if (zip->header_bytes_remaining < size)
  ------------------
  |  Branch (2570:7): [True: 0, False: 35]
  ------------------
 2571|      0|			return (-1);
 2572|     35|		ll = (size_t)size;
 2573|       |
 2574|     35|		switch (type) {
 2575|      0|		case kEmptyStream:
  ------------------
  |  |  107|      0|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2575:3): [True: 0, False: 35]
  ------------------
 2576|      0|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2576:8): [True: 0, False: 0]
  ------------------
 2577|      0|				return (-1);
 2578|      0|			h->emptyStreamBools = calloc((size_t)zip->numFiles,
 2579|      0|			    sizeof(*h->emptyStreamBools));
 2580|      0|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2580:8): [True: 0, False: 0]
  ------------------
 2581|      0|				return (-1);
 2582|      0|			if (read_Bools(
  ------------------
  |  Branch (2582:8): [True: 0, False: 0]
  ------------------
 2583|      0|			    a, h->emptyStreamBools, (size_t)zip->numFiles) < 0)
 2584|      0|				return (-1);
 2585|      0|			empty_streams = 0;
 2586|      0|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2586:16): [True: 0, False: 0]
  ------------------
 2587|      0|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2587:9): [True: 0, False: 0]
  ------------------
 2588|      0|					empty_streams++;
 2589|      0|			}
 2590|      0|			break;
 2591|      1|		case kEmptyFile:
  ------------------
  |  |  108|      1|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2591:3): [True: 1, False: 34]
  ------------------
 2592|      1|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2592:8): [True: 1, False: 0]
  ------------------
 2593|       |				/* Unexcepted sequence. Skip this. */
 2594|      1|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2594:9): [True: 0, False: 1]
  ------------------
 2595|      0|					return (-1);
 2596|      1|				break;
 2597|      1|			}
 2598|      0|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2598:8): [True: 0, False: 0]
  ------------------
 2599|      0|				return (-1);
 2600|      0|			h->emptyFileBools = calloc(empty_streams,
 2601|      0|			    sizeof(*h->emptyFileBools));
 2602|      0|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2602:8): [True: 0, False: 0]
  ------------------
 2603|      0|				return (-1);
 2604|      0|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2604:8): [True: 0, False: 0]
  ------------------
 2605|      0|				return (-1);
 2606|      0|			break;
 2607|      0|		case kAnti:
  ------------------
  |  |  109|      0|#define kAnti			0x10
  ------------------
  |  Branch (2607:3): [True: 0, False: 35]
  ------------------
 2608|      0|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2608:8): [True: 0, False: 0]
  ------------------
 2609|       |				/* Unexcepted sequence. Skip this. */
 2610|      0|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2610:9): [True: 0, False: 0]
  ------------------
 2611|      0|					return (-1);
 2612|      0|				break;
 2613|      0|			}
 2614|      0|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2614:8): [True: 0, False: 0]
  ------------------
 2615|      0|				return (-1);
 2616|      0|			h->antiBools = calloc(empty_streams,
 2617|      0|			    sizeof(*h->antiBools));
 2618|      0|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2618:8): [True: 0, False: 0]
  ------------------
 2619|      0|				return (-1);
 2620|      0|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2620:8): [True: 0, False: 0]
  ------------------
 2621|      0|				return (-1);
 2622|      0|			break;
 2623|      1|		case kCTime:
  ------------------
  |  |  111|      1|#define kCTime			0x12
  ------------------
  |  Branch (2623:3): [True: 1, False: 34]
  ------------------
 2624|      1|		case kATime:
  ------------------
  |  |  112|      1|#define kATime			0x13
  ------------------
  |  Branch (2624:3): [True: 0, False: 35]
  ------------------
 2625|      1|		case kMTime:
  ------------------
  |  |  113|      1|#define kMTime			0x14
  ------------------
  |  Branch (2625:3): [True: 0, False: 35]
  ------------------
 2626|      1|			if (read_Times(a, h, type) < 0)
  ------------------
  |  Branch (2626:8): [True: 0, False: 1]
  ------------------
 2627|      0|				return (-1);
 2628|      1|			break;
 2629|      5|		case kName:
  ------------------
  |  |  110|      5|#define kName			0x11
  ------------------
  |  Branch (2629:3): [True: 5, False: 30]
  ------------------
 2630|      5|		{
 2631|      5|			unsigned char *np;
 2632|      5|			size_t nl, nb;
 2633|       |
 2634|       |			/* Skip one byte. */
 2635|      5|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2635:8): [True: 0, False: 5]
  ------------------
 2636|      0|				return (-1);
 2637|      5|			ll--;
 2638|       |
 2639|      5|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2639:8): [True: 0, False: 5]
  |  Branch (2639:20): [True: 3, False: 2]
  ------------------
 2640|      3|				return (-1);
 2641|       |
 2642|      2|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2642:8): [True: 0, False: 2]
  ------------------
 2643|      0|				return (-1);
 2644|      2|			zip->entry_names = malloc(ll);
 2645|      2|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2645:8): [True: 0, False: 2]
  ------------------
 2646|      0|				return (-1);
 2647|      2|			np = zip->entry_names;
 2648|      2|			nb = ll;
 2649|       |			/*
 2650|       |			 * Copy whole file names.
 2651|       |			 * NOTE: This loop prevents from expanding
 2652|       |			 * the uncompressed buffer in order not to
 2653|       |			 * use extra memory resource.
 2654|       |			 */
 2655|      9|			while (nb) {
  ------------------
  |  Branch (2655:11): [True: 9, False: 0]
  ------------------
 2656|      9|				size_t b;
 2657|      9|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  269|      9|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2657:9): [True: 9, False: 0]
  ------------------
 2658|      9|					b = UBUFF_SIZE;
  ------------------
  |  |  269|      9|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2659|      0|				else
 2660|      0|					b = nb;
 2661|      9|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2661:9): [True: 2, False: 7]
  ------------------
 2662|      2|					return (-1);
 2663|      7|				memcpy(np, p, b);
 2664|      7|				np += b;
 2665|      7|				nb -= b;
 2666|      7|			}
 2667|      0|			np = zip->entry_names;
 2668|      0|			nl = ll;
 2669|       |
 2670|      0|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2670:16): [True: 0, False: 0]
  ------------------
 2671|      0|				entries[i].utf16name = np;
 2672|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 2673|       |				entries[i].wname = (wchar_t *)np;
 2674|       |#endif
 2675|       |
 2676|       |				/* Find a terminator. */
 2677|      0|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2677:12): [True: 0, False: 0]
  |  Branch (2677:24): [True: 0, False: 0]
  |  Branch (2677:33): [True: 0, False: 0]
  ------------------
 2678|      0|					np += 2;
 2679|      0|					nl -= 2;
 2680|      0|				}
 2681|      0|				if (nl < 2)
  ------------------
  |  Branch (2681:9): [True: 0, False: 0]
  ------------------
 2682|      0|					return (-1);/* Terminator not found */
 2683|      0|				entries[i].name_len = np - entries[i].utf16name;
 2684|      0|				np += 2;
 2685|      0|				nl -= 2;
 2686|      0|			}
 2687|      0|			break;
 2688|      0|		}
 2689|      0|		case kAttributes:
  ------------------
  |  |  114|      0|#define kAttributes		0x15
  ------------------
  |  Branch (2689:3): [True: 0, False: 35]
  ------------------
 2690|      0|		{
 2691|      0|			int allAreDefined;
 2692|       |
 2693|      0|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (2693:8): [True: 0, False: 0]
  ------------------
 2694|      0|				return (-1);
 2695|      0|			allAreDefined = *p;
 2696|      0|			if (h->attrBools != NULL)
  ------------------
  |  Branch (2696:8): [True: 0, False: 0]
  ------------------
 2697|      0|				return (-1);
 2698|      0|			h->attrBools = calloc((size_t)zip->numFiles,
 2699|      0|			    sizeof(*h->attrBools));
 2700|      0|			if (h->attrBools == NULL)
  ------------------
  |  Branch (2700:8): [True: 0, False: 0]
  ------------------
 2701|      0|				return (-1);
 2702|      0|			if (allAreDefined)
  ------------------
  |  Branch (2702:8): [True: 0, False: 0]
  ------------------
 2703|      0|				memset(h->attrBools, 1, (size_t)zip->numFiles);
 2704|      0|			else {
 2705|      0|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (2705:9): [True: 0, False: 0]
  ------------------
 2706|      0|				      (size_t)zip->numFiles) < 0)
 2707|      0|					return (-1);
 2708|      0|			}
 2709|      0|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2709:16): [True: 0, False: 0]
  ------------------
 2710|      0|				if (h->attrBools[i]) {
  ------------------
  |  Branch (2710:9): [True: 0, False: 0]
  ------------------
 2711|      0|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2711:10): [True: 0, False: 0]
  ------------------
 2712|      0|						return (-1);
 2713|      0|					entries[i].attr = archive_le32dec(p);
 2714|      0|				}
 2715|      0|			}
 2716|      0|			break;
 2717|      0|		}
 2718|      3|		case kDummy:
  ------------------
  |  |  116|      3|#define kDummy			0x19
  ------------------
  |  Branch (2718:3): [True: 3, False: 32]
  ------------------
 2719|      3|			if (ll == 0)
  ------------------
  |  Branch (2719:8): [True: 0, False: 3]
  ------------------
 2720|      0|				break;
 2721|      3|			__LA_FALLTHROUGH;
 2722|     28|		default:
  ------------------
  |  Branch (2722:3): [True: 25, False: 10]
  ------------------
 2723|     28|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2723:8): [True: 0, False: 28]
  ------------------
 2724|      0|				return (-1);
 2725|     28|			break;
 2726|     35|		}
 2727|     35|	}
 2728|       |
 2729|       |	/*
 2730|       |	 * Set up entry's attributes.
 2731|       |	 */
 2732|      2|	folders = si->ci.folders;
 2733|      2|	eindex = sindex = 0;
 2734|      2|	folderIndex = indexInFolder = 0;
 2735|      4|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2735:14): [True: 2, False: 2]
  ------------------
 2736|      2|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (2736:7): [True: 2, False: 0]
  |  Branch (2736:38): [True: 0, False: 0]
  ------------------
 2737|      2|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  225|      2|#define HAS_STREAM	(1<<4)
  ------------------
 2738|       |		/* The high 16 bits of attributes is a posix file mode. */
 2739|      2|		entries[i].mode = entries[i].attr >> 16;
 2740|       |
 2741|      2|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  140|      2|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (2741:7): [True: 2, False: 0]
  ------------------
 2742|       |			// Only windows permissions specified for this entry. Translate to
 2743|       |			// reasonable corresponding unix permissions.
 2744|       |
 2745|      2|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  133|      2|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (2745:8): [True: 0, False: 2]
  ------------------
 2746|      0|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  121|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (2746:9): [True: 0, False: 0]
  ------------------
 2747|       |					// Read-only directory.
 2748|      0|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2749|      0|				} else {
 2750|       |					// Read-write directory.
 2751|      0|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2752|      0|				}
 2753|      2|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  121|      2|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (2753:15): [True: 0, False: 2]
  ------------------
 2754|       |				// Readonly file.
 2755|      0|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2756|      2|			} else {
 2757|       |				// Assume read-write file.
 2758|      2|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  185|      2|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2759|      2|			}
 2760|      2|		}
 2761|       |
 2762|      2|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  225|      2|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (2762:7): [True: 2, False: 0]
  ------------------
 2763|      2|			if ((size_t)sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (2763:8): [True: 0, False: 2]
  ------------------
 2764|      0|				return (-1);
 2765|      2|			if (entries[i].mode == 0)
  ------------------
  |  Branch (2765:8): [True: 0, False: 2]
  ------------------
 2766|      0|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2767|      2|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (2767:8): [True: 2, False: 0]
  ------------------
 2768|      2|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  224|      2|#define CRC32_IS_SET	(1<<3)
  ------------------
 2769|      2|			entries[i].ssIndex = sindex;
 2770|      2|			sindex++;
 2771|      2|		} else {
 2772|      0|			int dir;
 2773|      0|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2773:8): [True: 0, False: 0]
  ------------------
 2774|      0|				dir = 1;
 2775|      0|			else {
 2776|      0|				if (h->emptyFileBools[eindex])
  ------------------
  |  Branch (2776:9): [True: 0, False: 0]
  ------------------
 2777|      0|					dir = 0;
 2778|      0|				else
 2779|      0|					dir = 1;
 2780|      0|				eindex++;
 2781|      0|			}
 2782|      0|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (2782:8): [True: 0, False: 0]
  ------------------
 2783|      0|				if (dir)
  ------------------
  |  Branch (2783:9): [True: 0, False: 0]
  ------------------
 2784|      0|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2785|      0|				else
 2786|      0|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2787|      0|			} else if (dir &&
  ------------------
  |  Branch (2787:15): [True: 0, False: 0]
  ------------------
 2788|      0|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2788:8): [True: 0, False: 0]
  ------------------
 2789|      0|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 2790|      0|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2791|      0|			}
 2792|      0|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2792:8): [True: 0, False: 0]
  ------------------
 2793|      0|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (2793:8): [True: 0, False: 0]
  ------------------
 2794|      0|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (2794:9): [True: 0, False: 0]
  ------------------
 2795|      0|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (2795:9): [True: 0, False: 0]
  ------------------
 2796|      0|				entries[i].utf16name[entries[i].name_len] = '/';
 2797|      0|				entries[i].utf16name[entries[i].name_len+1] = 0;
 2798|      0|				entries[i].name_len += 2;
 2799|      0|			}
 2800|      0|			entries[i].ssIndex = -1;
 2801|      0|		}
 2802|      2|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  121|      2|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (2802:7): [True: 0, False: 2]
  ------------------
 2803|      0|			entries[i].mode &= ~0222;/* Read only. */
 2804|       |
 2805|      2|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  225|      2|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (2805:7): [True: 0, False: 2]
  |  Branch (2805:45): [True: 0, False: 0]
  ------------------
 2806|       |			/*
 2807|       |			 * The entry is an empty file or a directory file,
 2808|       |			 * those both have no contents.
 2809|       |			 */
 2810|      0|			entries[i].folderIndex = -1;
 2811|      0|			continue;
 2812|      0|		}
 2813|      2|		if (indexInFolder == 0) {
  ------------------
  |  Branch (2813:7): [True: 2, False: 0]
  ------------------
 2814|      2|			for (;;) {
 2815|      2|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (2815:9): [True: 0, False: 2]
  ------------------
 2816|      0|					return (-1);
 2817|      2|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (2817:9): [True: 2, False: 0]
  ------------------
 2818|      2|					break;
 2819|      0|				folderIndex++;
 2820|      0|			}
 2821|      2|		}
 2822|      2|		entries[i].folderIndex = folderIndex;
 2823|      2|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  225|      2|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (2823:7): [True: 0, False: 2]
  ------------------
 2824|      0|			continue;
 2825|      2|		indexInFolder++;
 2826|      2|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (2826:7): [True: 2, False: 0]
  ------------------
 2827|      2|			folderIndex++;
 2828|      2|			indexInFolder = 0;
 2829|      2|		}
 2830|      2|	}
 2831|       |
 2832|      2|	return (0);
 2833|      2|}
archive_read_support_format_7zip.c:read_Times:
 2854|      1|{
 2855|      1|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2856|      1|	const unsigned char *p;
 2857|      1|	struct _7zip_entry *entries = zip->entries;
 2858|      1|	unsigned char *timeBools;
 2859|      1|	int allAreDefined;
 2860|      1|	unsigned i;
 2861|       |
 2862|      1|	timeBools = calloc((size_t)zip->numFiles, sizeof(*timeBools));
 2863|      1|	if (timeBools == NULL)
  ------------------
  |  Branch (2863:6): [True: 0, False: 1]
  ------------------
 2864|      0|		return (-1);
 2865|       |
 2866|       |	/* Read allAreDefined. */
 2867|      1|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2867:6): [True: 0, False: 1]
  ------------------
 2868|      0|		goto failed;
 2869|      1|	allAreDefined = *p;
 2870|      1|	if (allAreDefined)
  ------------------
  |  Branch (2870:6): [True: 1, False: 0]
  ------------------
 2871|      1|		memset(timeBools, 1, (size_t)zip->numFiles);
 2872|      0|	else {
 2873|      0|		if (read_Bools(a, timeBools, (size_t)zip->numFiles) < 0)
  ------------------
  |  Branch (2873:7): [True: 0, False: 0]
  ------------------
 2874|      0|			goto failed;
 2875|      0|	}
 2876|       |
 2877|       |	/* Read external. */
 2878|      1|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2878:6): [True: 0, False: 1]
  ------------------
 2879|      0|		goto failed;
 2880|      1|	if (*p) {
  ------------------
  |  Branch (2880:6): [True: 1, False: 0]
  ------------------
 2881|      1|		if (parse_7zip_uint64(a, &(h->dataIndex)) < 0)
  ------------------
  |  Branch (2881:7): [True: 0, False: 1]
  ------------------
 2882|      0|			goto failed;
 2883|      1|		if (UMAX_ENTRY < h->dataIndex)
  ------------------
  |  |  373|      1|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  179|      1|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2883:7): [True: 0, False: 1]
  ------------------
 2884|      0|			goto failed;
 2885|      1|	}
 2886|       |
 2887|      2|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2887:14): [True: 1, False: 1]
  ------------------
 2888|      1|		if (!timeBools[i])
  ------------------
  |  Branch (2888:7): [True: 0, False: 1]
  ------------------
 2889|      0|			continue;
 2890|      1|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (2890:7): [True: 0, False: 1]
  ------------------
 2891|      0|			goto failed;
 2892|      1|		switch (type) {
  ------------------
  |  Branch (2892:11): [True: 0, False: 1]
  ------------------
 2893|      1|		case kCTime:
  ------------------
  |  |  111|      1|#define kCTime			0x12
  ------------------
  |  Branch (2893:3): [True: 1, False: 0]
  ------------------
 2894|      1|			fileTimeToUtc(archive_le64dec(p),
 2895|      1|			    &(entries[i].ctime),
 2896|      1|			    &(entries[i].ctime_ns));
 2897|      1|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  223|      1|#define CTIME_IS_SET	(1<<2)
  ------------------
 2898|      1|			break;
 2899|      0|		case kATime:
  ------------------
  |  |  112|      0|#define kATime			0x13
  ------------------
  |  Branch (2899:3): [True: 0, False: 1]
  ------------------
 2900|      0|			fileTimeToUtc(archive_le64dec(p),
 2901|      0|			    &(entries[i].atime),
 2902|      0|			    &(entries[i].atime_ns));
 2903|      0|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  222|      0|#define ATIME_IS_SET	(1<<1)
  ------------------
 2904|      0|			break;
 2905|      0|		case kMTime:
  ------------------
  |  |  113|      0|#define kMTime			0x14
  ------------------
  |  Branch (2905:3): [True: 0, False: 1]
  ------------------
 2906|      0|			fileTimeToUtc(archive_le64dec(p),
 2907|      0|			    &(entries[i].mtime),
 2908|      0|			    &(entries[i].mtime_ns));
 2909|      0|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  221|      0|#define MTIME_IS_SET	(1<<0)
  ------------------
 2910|      0|			break;
 2911|      1|		}
 2912|      1|	}
 2913|       |
 2914|      1|	free(timeBools);
 2915|      1|	return (0);
 2916|      0|failed:
 2917|      0|	free(timeBools);
 2918|      0|	return (-1);
 2919|      1|}
archive_read_support_format_7zip.c:fileTimeToUtc:
 2838|      1|{
 2839|       |
 2840|      1|	if (fileTime >= EPOC_TIME) {
  ------------------
  |  | 2835|      1|#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
  |  |  ------------------
  |  |  |  |  179|      1|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2840:6): [True: 1, False: 0]
  ------------------
 2841|      1|		fileTime -= EPOC_TIME;
  ------------------
  |  | 2835|      1|#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
  |  |  ------------------
  |  |  |  |  179|      1|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
 2842|       |		/* milli seconds base */
 2843|      1|		*timep = (time_t)(fileTime / 10000000);
 2844|       |		/* nano seconds base */
 2845|      1|		*ns = (long)(fileTime % 10000000) * 100;
 2846|      1|	} else {
 2847|      0|		*timep = 0;
 2848|      0|		*ns = 0;
 2849|      0|	}
 2850|      1|}
archive_read_support_format_7zip.c:free_Header:
 2479|      7|{
 2480|      7|	free(h->emptyStreamBools);
 2481|      7|	free(h->emptyFileBools);
 2482|      7|	free(h->antiBools);
 2483|      7|	free(h->attrBools);
 2484|      7|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
  856|      2|{
  857|      2|	struct _7zip *zip;
  858|      2|	ssize_t bytes;
  859|      2|	int ret = ARCHIVE_OK;
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  860|       |
  861|      2|	zip = (struct _7zip *)(a->format->data);
  862|       |
  863|      2|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|      2|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (863:6): [True: 0, False: 2]
  ------------------
  864|      0|		zip->has_encrypted_entries = 0;
  865|      0|	}
  866|       |
  867|      2|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (867:6): [True: 0, False: 2]
  ------------------
  868|      0|		read_consume(a);
  869|       |
  870|      2|	*offset = zip->entry_offset;
  871|      2|	*size = 0;
  872|      2|	*buff = NULL;
  873|       |	/*
  874|       |	 * If we hit end-of-entry last time, clean up and return
  875|       |	 * ARCHIVE_EOF this time.
  876|       |	 */
  877|      2|	if (zip->end_of_entry)
  ------------------
  |  Branch (877:6): [True: 0, False: 2]
  ------------------
  878|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  879|       |
  880|      2|	size_t bytes_to_read = 16 * 1024 * 1024;  // Don't try to read more than 16 MB at a time
  881|      2|	if ((uint64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (881:6): [True: 1, False: 1]
  ------------------
  882|      1|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
  883|      1|	}
  884|      2|	bytes = read_stream(a, buff, bytes_to_read, 0);
  885|      2|	if (bytes < 0)
  ------------------
  |  Branch (885:6): [True: 1, False: 1]
  ------------------
  886|      1|		return ((int)bytes);
  887|      1|	if (bytes == 0) {
  ------------------
  |  Branch (887:6): [True: 0, False: 1]
  ------------------
  888|      0|		archive_set_error(&a->archive,
  889|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  890|      0|		    "Truncated 7-Zip file body");
  891|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  892|      0|	}
  893|      1|	zip->entry_bytes_remaining -= bytes;
  894|      1|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (894:6): [True: 1, False: 0]
  ------------------
  895|      1|		zip->end_of_entry = 1;
  896|       |
  897|       |	/* Update checksum */
  898|      1|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  224|      1|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (898:6): [True: 1, False: 0]
  |  Branch (898:42): [True: 1, False: 0]
  ------------------
  899|      1|		zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
  900|      1|		    (unsigned)bytes);
  901|       |
  902|       |	/* If we hit the end, swallow any end-of-data marker. */
  903|      1|	if (zip->end_of_entry) {
  ------------------
  |  Branch (903:6): [True: 1, False: 0]
  ------------------
  904|       |		/* Check computed CRC against file contents. */
  905|      1|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  224|      1|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (905:7): [True: 1, False: 0]
  ------------------
  906|      1|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (906:4): [True: 1, False: 0]
  ------------------
  907|      1|		    zip->entry_crc32) {
  908|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  909|      1|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
  910|      1|			    (unsigned long)zip->entry_crc32,
  911|      1|			    (unsigned long)zip->si.ss.digests[
  912|      1|			    		zip->entry->ssIndex]);
  913|      1|			ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  914|      1|		}
  915|      1|	}
  916|       |
  917|      1|	*size = bytes;
  918|      1|	*offset = zip->entry_offset;
  919|      1|	zip->entry_offset += bytes;
  920|       |
  921|      1|	return (ret);
  922|      1|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
  926|      1|{
  927|      1|	struct _7zip *zip;
  928|      1|	int64_t bytes_skipped;
  929|       |
  930|      1|	zip = (struct _7zip *)(a->format->data);
  931|       |
  932|      1|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (932:6): [True: 1, False: 0]
  ------------------
  933|      1|		read_consume(a);
  934|       |
  935|       |	/* If we've already read to end of data, we're done. */
  936|      1|	if (zip->end_of_entry)
  ------------------
  |  Branch (936:6): [True: 1, False: 0]
  ------------------
  937|      1|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  938|       |
  939|       |	/*
  940|       |	 * If the length is at the beginning, we can skip the
  941|       |	 * compressed data much more quickly.
  942|       |	 */
  943|      0|	bytes_skipped = skip_stream(a, (size_t)zip->entry_bytes_remaining);
  944|      0|	if (bytes_skipped < 0)
  ------------------
  |  Branch (944:6): [True: 0, False: 0]
  ------------------
  945|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  946|      0|	zip->entry_bytes_remaining = 0;
  947|       |
  948|       |	/* This entry is finished and done. */
  949|      0|	zip->end_of_entry = 1;
  950|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  951|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
  955|    238|{
  956|    238|	struct _7zip *zip;
  957|       |
  958|    238|	zip = (struct _7zip *)(a->format->data);
  959|    238|	free_StreamsInfo(&(zip->si));
  960|    238|	free(zip->entries);
  961|    238|	free(zip->entry_names);
  962|    238|	free_decompression(a, zip);
  963|    238|	free(zip->uncompressed_buffer);
  964|    238|	free(zip->sub_stream_buff[0]);
  965|    238|	free(zip->sub_stream_buff[1]);
  966|    238|	free(zip->sub_stream_buff[2]);
  967|    238|	free(zip->tmp_stream_buff);
  968|    238|	free(zip);
  969|    238|	(a->format->data) = NULL;
  970|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  971|    238|}
archive_read_support_format_7zip.c:free_decompression:
 1736|    238|{
 1737|    238|	int r = ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1738|       |
 1739|       |#if !defined(HAVE_ZLIB_H) &&\
 1740|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 1741|       |	(void)a;/* UNUSED */
 1742|       |#endif
 1743|    238|#ifdef HAVE_LZMA_H
 1744|    238|	if (zip->lzstream_valid)
  ------------------
  |  Branch (1744:6): [True: 1, False: 237]
  ------------------
 1745|      1|		lzma_end(&(zip->lzstream));
 1746|    238|#endif
 1747|    238|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1748|    238|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (1748:6): [True: 0, False: 238]
  ------------------
 1749|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (1749:7): [True: 0, False: 0]
  ------------------
 1750|      0|			archive_set_error(&a->archive,
 1751|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1752|      0|			    "Failed to clean up bzip2 decompressor");
 1753|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1754|      0|		}
 1755|      0|		zip->bzstream_valid = 0;
 1756|      0|	}
 1757|    238|#endif
 1758|    238|#ifdef HAVE_ZLIB_H
 1759|    238|	if (zip->stream_valid) {
  ------------------
  |  Branch (1759:6): [True: 0, False: 238]
  ------------------
 1760|      0|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (1760:7): [True: 0, False: 0]
  ------------------
 1761|      0|			archive_set_error(&a->archive,
 1762|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1763|      0|			    "Failed to clean up zlib decompressor");
 1764|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1765|      0|		}
 1766|      0|		zip->stream_valid = 0;
 1767|      0|	}
 1768|    238|#endif
 1769|       |#ifdef HAVE_ZSTD_H
 1770|       |	if (zip->zstdstream_valid)
 1771|       |		ZSTD_freeDStream(zip->zstd_dstream);
 1772|       |#endif
 1773|    238|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1773:6): [True: 0, False: 238]
  ------------------
 1774|      0|		__archive_ppmd7_functions.Ppmd7_Free(
 1775|      0|			&zip->ppmd7_context);
 1776|      0|		zip->ppmd7_valid = 0;
 1777|      0|	}
 1778|    238|	return (r);
 1779|    238|}

archive_read_support_format_all:
   33|    238|{
   34|    238|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
   35|    238|	    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|    238|	archive_read_support_format_ar(a);
   57|    238|	archive_read_support_format_cpio(a);
   58|    238|	archive_read_support_format_empty(a);
   59|    238|	archive_read_support_format_lha(a);
   60|    238|	archive_read_support_format_mtree(a);
   61|    238|	archive_read_support_format_tar(a);
   62|    238|	archive_read_support_format_xar(a);
   63|    238|	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|    238|	archive_read_support_format_7zip(a);
   72|    238|	archive_read_support_format_cab(a);
   73|    238|	archive_read_support_format_rar(a);
   74|    238|	archive_read_support_format_rar5(a);
   75|    238|	archive_read_support_format_iso9660(a);
   76|       |	/* Seek is really bad, since it forces the read-ahead
   77|       |	 * logic to discard buffered data. */
   78|    238|	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|       |	 * compression should enable those individually so they can
   84|       |	 * verify the level of support. */
   85|       |	/* Clear any warning messages set by the above functions. */
   86|    238|	archive_clear_error(a);
   87|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|    238|}

archive_read_support_format_ar:
   98|    238|{
   99|    238|	struct archive_read *a = (struct archive_read *)_a;
  100|    238|	struct ar *ar;
  101|    238|	int r;
  102|       |
  103|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  104|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  105|       |
  106|    238|	ar = (struct ar *)calloc(1, sizeof(*ar));
  107|    238|	if (ar == NULL) {
  ------------------
  |  Branch (107:6): [True: 0, False: 238]
  ------------------
  108|      0|		archive_set_error(&a->archive, ENOMEM,
  109|      0|		    "Can't allocate ar data");
  110|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  111|      0|	}
  112|    238|	ar->strtab = NULL;
  113|       |
  114|    238|	r = __archive_read_register_format(a,
  115|    238|	    ar,
  116|    238|	    "ar",
  117|    238|	    archive_read_format_ar_bid,
  118|    238|	    NULL,
  119|    238|	    archive_read_format_ar_read_header,
  120|    238|	    archive_read_format_ar_read_data,
  121|    238|	    archive_read_format_ar_skip,
  122|    238|	    NULL,
  123|    238|	    archive_read_format_ar_cleanup,
  124|    238|	    NULL,
  125|    238|	    NULL);
  126|       |
  127|    238|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 238]
  ------------------
  128|      0|		free(ar);
  129|      0|		return (r);
  130|      0|	}
  131|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  132|    238|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  136|    238|{
  137|    238|	struct ar *ar;
  138|       |
  139|    238|	ar = (struct ar *)(a->format->data);
  140|    238|	free(ar->strtab);
  141|    238|	free(ar);
  142|    238|	(a->format->data) = NULL;
  143|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  144|    238|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  148|    236|{
  149|    236|	const void *h;
  150|       |
  151|    236|	(void)best_bid; /* UNUSED */
  152|       |
  153|       |	/*
  154|       |	 * Verify the 8-byte file signature.
  155|       |	 * TODO: Do we need to check more than this?
  156|       |	 */
  157|    236|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (157:6): [True: 2, False: 234]
  ------------------
  158|      2|		return (-1);
  159|    234|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (159:6): [True: 0, False: 234]
  ------------------
  160|      0|		return (64);
  161|      0|	}
  162|    234|	return (-1);
  163|    234|}

archive_read_support_format_cab:
  351|    238|{
  352|    238|	struct archive_read *a = (struct archive_read *)_a;
  353|    238|	struct cab *cab;
  354|    238|	int r;
  355|       |
  356|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  357|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cab");
  358|       |
  359|    238|	cab = (struct cab *)calloc(1, sizeof(*cab));
  360|    238|	if (cab == NULL) {
  ------------------
  |  Branch (360:6): [True: 0, False: 238]
  ------------------
  361|      0|		archive_set_error(&a->archive, ENOMEM,
  362|      0|		    "Can't allocate CAB data");
  363|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  364|      0|	}
  365|    238|	archive_string_init(&cab->ws);
  ------------------
  |  |   71|    238|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  366|    238|	archive_wstring_ensure(&cab->ws, 256);
  367|       |
  368|    238|	r = __archive_read_register_format(a,
  369|    238|	    cab,
  370|    238|	    "cab",
  371|    238|	    archive_read_format_cab_bid,
  372|    238|	    archive_read_format_cab_options,
  373|    238|	    archive_read_format_cab_read_header,
  374|    238|	    archive_read_format_cab_read_data,
  375|    238|	    archive_read_format_cab_read_data_skip,
  376|    238|	    NULL,
  377|    238|	    archive_read_format_cab_cleanup,
  378|    238|	    NULL,
  379|    238|	    NULL);
  380|       |
  381|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (381:6): [True: 0, False: 238]
  ------------------
  382|      0|		free(cab);
  383|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  384|    238|}
archive_read_support_format_cab.c:archive_read_format_cab_bid:
  411|    236|{
  412|    236|	const char *p;
  413|    236|	ssize_t bytes_avail, offset, window;
  414|       |
  415|       |	/* If there's already a better bid than we can ever
  416|       |	   make, don't bother testing. */
  417|    236|	if (best_bid > 64)
  ------------------
  |  Branch (417:6): [True: 2, False: 234]
  ------------------
  418|      2|		return (-1);
  419|       |
  420|    234|	if ((p = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (420:6): [True: 5, False: 229]
  ------------------
  421|      5|		return (-1);
  422|       |
  423|    229|	if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (423:6): [True: 2, False: 227]
  ------------------
  424|      2|		return (64);
  425|       |
  426|       |	/*
  427|       |	 * Attempt to handle self-extracting archives
  428|       |	 * by noting a PE header and searching forward
  429|       |	 * up to 128k for a 'MSCF' marker.
  430|       |	 */
  431|    227|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (431:6): [True: 22, False: 205]
  |  Branch (431:21): [True: 22, False: 0]
  ------------------
  432|     22|		offset = 0;
  433|     22|		window = 4096;
  434|     42|		while (offset < (1024 * 128)) {
  ------------------
  |  Branch (434:10): [True: 22, False: 20]
  ------------------
  435|     22|			const char *h = __archive_read_ahead(a, offset + window,
  436|     22|			    &bytes_avail);
  437|     22|			if (h == NULL) {
  ------------------
  |  Branch (437:8): [True: 0, False: 22]
  ------------------
  438|       |				/* Remaining bytes are less than window. */
  439|      0|				window >>= 1;
  440|      0|				if (window < 128)
  ------------------
  |  Branch (440:9): [True: 0, False: 0]
  ------------------
  441|      0|					return (0);
  442|      0|				continue;
  443|      0|			}
  444|     22|			p = h + offset;
  445|  1.53M|			while (p + 8 < h + bytes_avail) {
  ------------------
  |  Branch (445:11): [True: 1.53M, False: 20]
  ------------------
  446|  1.53M|				int next;
  447|  1.53M|				if ((next = find_cab_magic(p)) == 0)
  ------------------
  |  Branch (447:9): [True: 2, False: 1.53M]
  ------------------
  448|      2|					return (64);
  449|  1.53M|				p += next;
  450|  1.53M|			}
  451|     20|			offset = p - h;
  452|     20|		}
  453|     22|	}
  454|    225|	return (0);
  455|    227|}
archive_read_support_format_cab.c:find_cab_magic:
  388|  1.57M|{
  389|  1.57M|	switch (p[4]) {
  390|  54.6k|	case 0:
  ------------------
  |  Branch (390:2): [True: 54.6k, False: 1.51M]
  ------------------
  391|       |		/*
  392|       |		 * Note: Self-Extraction program has 'MSCF' string in their
  393|       |		 * program. If we were finding 'MSCF' string only, we got
  394|       |		 * wrong place for Cabinet header, thus, we have to check
  395|       |		 * following four bytes which are reserved and must be set
  396|       |		 * to zero.
  397|       |		 */
  398|  54.6k|		if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (398:7): [True: 4, False: 54.6k]
  ------------------
  399|      4|			return 0;
  400|  54.6k|		return 5;
  401|   172k|	case 'F': return 1;
  ------------------
  |  Branch (401:2): [True: 172k, False: 1.40M]
  ------------------
  402|  2.01k|	case 'C': return 2;
  ------------------
  |  Branch (402:2): [True: 2.01k, False: 1.57M]
  ------------------
  403|   115k|	case 'S': return 3;
  ------------------
  |  Branch (403:2): [True: 115k, False: 1.45M]
  ------------------
  404|  1.50k|	case 'M': return 4;
  ------------------
  |  Branch (404:2): [True: 1.50k, False: 1.57M]
  ------------------
  405|  1.22M|	default:  return 5;
  ------------------
  |  Branch (405:2): [True: 1.22M, False: 345k]
  ------------------
  406|  1.57M|	}
  407|  1.57M|}
archive_read_support_format_cab.c:archive_read_format_cab_read_header:
  885|      4|{
  886|      4|	struct cab *cab;
  887|      4|	struct cfheader *hd;
  888|      4|	struct cffolder *prev_folder;
  889|      4|	struct cffile *file;
  890|      4|	struct archive_string_conv *sconv;
  891|      4|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  892|       |	
  893|      4|	cab = (struct cab *)(a->format->data);
  894|      4|	if (cab->found_header == 0) {
  ------------------
  |  Branch (894:6): [True: 4, False: 0]
  ------------------
  895|      4|		err = cab_read_header(a); 
  896|      4|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  194|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (896:7): [True: 2, False: 2]
  ------------------
  897|      2|			return (err);
  898|       |		/* We've found the header. */
  899|      2|		cab->found_header = 1;
  900|      2|	}
  901|      2|	hd = &cab->cfheader;
  902|       |
  903|      2|	if (hd->file_index >= hd->file_count) {
  ------------------
  |  Branch (903:6): [True: 0, False: 2]
  ------------------
  904|      0|		cab->end_of_archive = 1;
  905|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  906|      0|	}
  907|      2|	file = &hd->file_array[hd->file_index++];
  908|       |
  909|      2|	cab->end_of_entry = 0;
  910|      2|	cab->end_of_entry_cleanup = 0;
  911|      2|	cab->entry_compressed_bytes_read = 0;
  912|      2|	cab->entry_uncompressed_bytes_read = 0;
  913|      2|	cab->entry_unconsumed = 0;
  914|      2|	cab->entry_cffile = file;
  915|       |
  916|       |	/*
  917|       |	 * Choose a proper folder.
  918|       |	 */
  919|      2|	prev_folder = cab->entry_cffolder;
  920|      2|	switch (file->folder) {
  921|      0|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (921:2): [True: 0, False: 2]
  ------------------
  922|      0|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (922:2): [True: 0, False: 2]
  ------------------
  923|      0|		cab->entry_cffolder = &hd->folder_array[0];
  924|      0|		break;
  925|      0|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (925:2): [True: 0, False: 2]
  ------------------
  926|      0|		cab->entry_cffolder = &hd->folder_array[hd->folder_count-1];
  927|      0|		break;
  928|      2|	default:
  ------------------
  |  Branch (928:2): [True: 2, False: 0]
  ------------------
  929|      2|		cab->entry_cffolder = &hd->folder_array[file->folder];
  930|      2|		break;
  931|      2|	}
  932|       |	/* If a cffolder of this file is changed, reset a cfdata to read
  933|       |	 * file contents from next cfdata. */
  934|      2|	if (prev_folder != cab->entry_cffolder)
  ------------------
  |  Branch (934:6): [True: 2, False: 0]
  ------------------
  935|      2|		cab->entry_cfdata = NULL;
  936|       |
  937|       |	/* If a pathname is UTF-8, prepare a string conversion object
  938|       |	 * for UTF-8 and use it. */
  939|      2|	if (file->attr & ATTR_NAME_IS_UTF) {
  ------------------
  |  |  238|      2|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (939:6): [True: 2, False: 0]
  ------------------
  940|      2|		if (cab->sconv_utf8 == NULL) {
  ------------------
  |  Branch (940:7): [True: 2, False: 0]
  ------------------
  941|      2|			cab->sconv_utf8 =
  942|      2|			    archive_string_conversion_from_charset(
  943|      2|				&(a->archive), "UTF-8", 1);
  944|      2|			if (cab->sconv_utf8 == NULL)
  ------------------
  |  Branch (944:8): [True: 0, False: 2]
  ------------------
  945|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  946|      2|		}
  947|      2|		sconv = cab->sconv_utf8;
  948|      2|	} else if (cab->sconv != NULL) {
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|       |		/* Choose the conversion specified by the option. */
  950|      0|		sconv = cab->sconv;
  951|      0|	} else {
  952|       |		/* Choose the default conversion. */
  953|      0|		if (!cab->init_default_conversion) {
  ------------------
  |  Branch (953:7): [True: 0, False: 0]
  ------------------
  954|      0|			cab->sconv_default =
  955|      0|			    archive_string_default_conversion_for_read(
  956|      0|			      &(a->archive));
  957|      0|			cab->init_default_conversion = 1;
  958|      0|		}
  959|      0|		sconv = cab->sconv_default;
  960|      0|	}
  961|       |
  962|       |	/*
  963|       |	 * Set a default value and common data
  964|       |	 */
  965|      2|	r = cab_convert_path_separator_1(&(file->pathname), file->attr);
  966|      2|	if (archive_entry_copy_pathname_l(entry, file->pathname.s,
  ------------------
  |  |   80|      2|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (966:6): [True: 2, False: 0]
  ------------------
  967|      2|	    archive_strlen(&(file->pathname)), sconv) != 0) {
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  968|      2|		if (errno == ENOMEM) {
  ------------------
  |  Branch (968:7): [True: 0, False: 2]
  ------------------
  969|      0|			archive_set_error(&a->archive, ENOMEM,
  970|      0|			    "Can't allocate memory for Pathname");
  971|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  972|      0|		}
  973|      2|		archive_set_error(&a->archive,
  974|      2|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  975|      2|		    "Pathname cannot be converted "
  976|      2|		    "from %s to current locale.",
  977|      2|		    archive_string_conversion_charset_name(sconv));
  978|      2|		err = ARCHIVE_WARN;
  ------------------
  |  |  194|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  979|      2|	}
  980|      2|	if (r < 0) {
  ------------------
  |  Branch (980:6): [True: 0, False: 2]
  ------------------
  981|       |		/* Convert a path separator '\' -> '/' */
  982|      0|		cab_convert_path_separator_2(cab, entry);
  983|      0|	}
  984|       |
  985|      2|	archive_entry_set_size(entry, file->uncompressed_size);
  986|      2|	if (file->attr & ATTR_RDONLY)
  ------------------
  |  |  237|      2|#define ATTR_RDONLY		0x01
  ------------------
  |  Branch (986:6): [True: 2, False: 0]
  ------------------
  987|      2|		archive_entry_set_mode(entry, AE_IFREG | 0555);
  ------------------
  |  |  185|      2|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  988|      0|	else
  989|      0|		archive_entry_set_mode(entry, AE_IFREG | 0666);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  990|      2|	archive_entry_set_mtime(entry, file->mtime, 0);
  991|       |
  992|      2|	cab->entry_bytes_remaining = file->uncompressed_size;
  993|      2|	cab->entry_offset = 0;
  994|       |	/* We don't need compress data. */
  995|      2|	if (file->uncompressed_size == 0)
  ------------------
  |  Branch (995:6): [True: 0, False: 2]
  ------------------
  996|      0|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
  997|       |
  998|       |	/* Set up a more descriptive format name. */
  999|      2|	snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
 1000|      2|	    hd->major, hd->minor, cab->entry_cffolder->compname);
 1001|      2|	a->archive.archive_format_name = cab->format_name;
 1002|       |
 1003|      2|	return (err);
 1004|      2|}
archive_read_support_format_cab.c:cab_read_header:
  618|      4|{
  619|      4|	const unsigned char *p;
  620|      4|	struct cab *cab;
  621|      4|	struct cfheader *hd;
  622|      4|	size_t bytes, used;
  623|      4|	ssize_t len;
  624|      4|	int64_t skip;
  625|      4|	int err, i;
  626|      4|	int cur_folder, prev_folder;
  627|      4|	uint32_t offset32;
  628|       |	
  629|      4|	a->archive.archive_format = ARCHIVE_FORMAT_CAB;
  ------------------
  |  |  342|      4|#define	ARCHIVE_FORMAT_CAB			0xC0000
  ------------------
  630|      4|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (630:6): [True: 4, False: 0]
  ------------------
  631|      4|		a->archive.archive_format_name = "CAB";
  632|       |
  633|      4|	if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (633:6): [True: 0, False: 4]
  ------------------
  634|      0|		return (truncated_error(a));
  635|       |
  636|      4|	cab = (struct cab *)(a->format->data);
  637|      4|	if (cab->found_header == 0 &&
  ------------------
  |  Branch (637:6): [True: 4, False: 0]
  ------------------
  638|      4|	    p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (638:6): [True: 4, False: 0]
  |  Branch (638:21): [True: 2, False: 2]
  ------------------
  639|       |		/* This is an executable?  Must be self-extracting... */
  640|      2|		err = cab_skip_sfx(a);
  641|      2|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  194|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (641:7): [True: 0, False: 2]
  ------------------
  642|      0|			return (err);
  643|       |
  644|       |		/* Re-read header after processing the SFX. */
  645|      2|		if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (645:7): [True: 0, False: 2]
  ------------------
  646|      0|			return (truncated_error(a));
  647|      2|	}
  648|       |
  649|      4|	cab->cab_offset = 0;
  650|       |	/*
  651|       |	 * Read CFHEADER.
  652|       |	 */
  653|      4|	hd = &cab->cfheader;
  654|      4|	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  150|      4|#define CFHEADER_signature	0
  ------------------
              	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  150|      4|#define CFHEADER_signature	0
  ------------------
  |  Branch (654:6): [True: 0, False: 4]
  |  Branch (654:40): [True: 0, False: 4]
  ------------------
  655|      4|	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  150|      4|#define CFHEADER_signature	0
  ------------------
              	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  150|      4|#define CFHEADER_signature	0
  ------------------
  |  Branch (655:6): [True: 0, False: 4]
  |  Branch (655:40): [True: 0, False: 4]
  ------------------
  656|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  657|      0|		    "Couldn't find out CAB header");
  658|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  659|      0|	}
  660|      4|	hd->total_bytes = archive_le32dec(p + CFHEADER_cbCabinet);
  ------------------
  |  |  151|      4|#define CFHEADER_cbCabinet	8
  ------------------
  661|      4|	hd->files_offset = archive_le32dec(p + CFHEADER_coffFiles);
  ------------------
  |  |  152|      4|#define CFHEADER_coffFiles	16
  ------------------
  662|      4|	hd->minor = p[CFHEADER_versionMinor];
  ------------------
  |  |  153|      4|#define CFHEADER_versionMinor	24
  ------------------
  663|      4|	hd->major = p[CFHEADER_versionMajor];
  ------------------
  |  |  154|      4|#define CFHEADER_versionMajor	25
  ------------------
  664|      4|	hd->folder_count = archive_le16dec(p + CFHEADER_cFolders);
  ------------------
  |  |  155|      4|#define CFHEADER_cFolders	26
  ------------------
  665|      4|	if (hd->folder_count == 0)
  ------------------
  |  Branch (665:6): [True: 0, False: 4]
  ------------------
  666|      0|		goto invalid;
  667|      4|	hd->file_count = archive_le16dec(p + CFHEADER_cFiles);
  ------------------
  |  |  156|      4|#define CFHEADER_cFiles		28
  ------------------
  668|      4|	if (hd->file_count == 0)
  ------------------
  |  Branch (668:6): [True: 0, False: 4]
  ------------------
  669|      0|		goto invalid;
  670|      4|	hd->flags = archive_le16dec(p + CFHEADER_flags);
  ------------------
  |  |  157|      4|#define CFHEADER_flags		30
  ------------------
  671|      4|	hd->setid = archive_le16dec(p + CFHEADER_setID);
  ------------------
  |  |  158|      4|#define CFHEADER_setID		32
  ------------------
  672|      4|	hd->cabinet = archive_le16dec(p + CFHEADER_iCabinet);
  ------------------
  |  |  159|      4|#define CFHEADER_iCabinet	34
  ------------------
  673|      4|	used = CFHEADER_iCabinet + 2;
  ------------------
  |  |  159|      4|#define CFHEADER_iCabinet	34
  ------------------
  674|      4|	if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|      4|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (674:6): [True: 1, False: 3]
  ------------------
  675|      1|		uint16_t cfheader;
  676|      1|		cfheader = archive_le16dec(p + CFHEADER_cbCFHeader);
  ------------------
  |  |  160|      1|#define CFHEADER_cbCFHeader	36
  ------------------
  677|      1|		if (cfheader > 60000U)
  ------------------
  |  Branch (677:7): [True: 0, False: 1]
  ------------------
  678|      0|			goto invalid;
  679|      1|		hd->cffolder = p[CFHEADER_cbCFFolder];
  ------------------
  |  |  161|      1|#define CFHEADER_cbCFFolder	38
  ------------------
  680|      1|		hd->cfdata = p[CFHEADER_cbCFData];
  ------------------
  |  |  162|      1|#define CFHEADER_cbCFData	39
  ------------------
  681|      1|		used += 4;/* cbCFHeader, cbCFFolder and cbCFData */
  682|      1|		used += cfheader;/* abReserve */
  683|      1|	} else
  684|      3|		hd->cffolder = 0;/* Avoid compiling warning. */
  685|      4|	if (hd->flags & PREV_CABINET) {
  ------------------
  |  |  249|      4|#define PREV_CABINET	0x0001
  ------------------
  |  Branch (685:6): [True: 1, False: 3]
  ------------------
  686|       |		/* How many bytes are used for szCabinetPrev. */
  687|      1|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (687:7): [True: 1, False: 0]
  ------------------
  688|      1|			return (truncated_error(a));
  689|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (689:7): [True: 0, False: 0]
  ------------------
  690|      0|			goto invalid;
  691|      0|		used += len + 1;
  692|       |		/* How many bytes are used for szDiskPrev. */
  693|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (693:7): [True: 0, False: 0]
  ------------------
  694|      0|			return (truncated_error(a));
  695|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (695:7): [True: 0, False: 0]
  ------------------
  696|      0|			goto invalid;
  697|      0|		used += len + 1;
  698|      0|	}
  699|      3|	if (hd->flags & NEXT_CABINET) {
  ------------------
  |  |  250|      3|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (699:6): [True: 0, False: 3]
  ------------------
  700|       |		/* How many bytes are used for szCabinetNext. */
  701|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (701:7): [True: 0, False: 0]
  ------------------
  702|      0|			return (truncated_error(a));
  703|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (703:7): [True: 0, False: 0]
  ------------------
  704|      0|			goto invalid;
  705|      0|		used += len + 1;
  706|       |		/* How many bytes are used for szDiskNext. */
  707|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (707:7): [True: 0, False: 0]
  ------------------
  708|      0|			return (truncated_error(a));
  709|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (709:7): [True: 0, False: 0]
  ------------------
  710|      0|			goto invalid;
  711|      0|		used += len + 1;
  712|      0|	}
  713|      3|	__archive_read_consume(a, used);
  714|      3|	cab->cab_offset += used;
  715|      3|	used = 0;
  716|       |
  717|       |	/*
  718|       |	 * Read CFFOLDER.
  719|       |	 */
  720|      3|	hd->folder_array = (struct cffolder *)calloc(
  721|      3|	    hd->folder_count, sizeof(struct cffolder));
  722|      3|	if (hd->folder_array == NULL)
  ------------------
  |  Branch (722:6): [True: 0, False: 3]
  ------------------
  723|      0|		goto nomem;
  724|       |	
  725|      3|	bytes = 8;
  726|      3|	if (hd->flags & RESERVE_PRESENT)
  ------------------
  |  |  251|      3|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (726:6): [True: 0, False: 3]
  ------------------
  727|      0|		bytes += hd->cffolder;
  728|      3|	bytes *= hd->folder_count;
  729|      3|	if ((p = __archive_read_ahead(a, bytes, NULL)) == NULL)
  ------------------
  |  Branch (729:6): [True: 0, False: 3]
  ------------------
  730|      0|		return (truncated_error(a));
  731|      3|	offset32 = 0;
  732|      6|	for (i = 0; i < hd->folder_count; i++) {
  ------------------
  |  Branch (732:14): [True: 3, False: 3]
  ------------------
  733|      3|		struct cffolder *folder = &(hd->folder_array[i]);
  734|      3|		folder->cfdata_offset_in_cab =
  735|      3|		    archive_le32dec(p + CFFOLDER_coffCabStart);
  ------------------
  |  |  165|      3|#define CFFOLDER_coffCabStart	0
  ------------------
  736|      3|		folder->cfdata_count = archive_le16dec(p+CFFOLDER_cCFData);
  ------------------
  |  |  166|      3|#define CFFOLDER_cCFData	4
  ------------------
  737|      3|		folder->comptype =
  738|      3|		    archive_le16dec(p+CFFOLDER_typeCompress) & 0x0F;
  ------------------
  |  |  167|      3|#define CFFOLDER_typeCompress	6
  ------------------
  739|      3|		folder->compdata =
  740|      3|		    archive_le16dec(p+CFFOLDER_typeCompress) >> 8;
  ------------------
  |  |  167|      3|#define CFFOLDER_typeCompress	6
  ------------------
  741|       |		/* Get a compression name. */
  742|      3|		if (folder->comptype <
  ------------------
  |  Branch (742:7): [True: 3, False: 0]
  ------------------
  743|      3|		    sizeof(compression_name) / sizeof(compression_name[0]))
  744|      3|			folder->compname = compression_name[folder->comptype];
  745|      0|		else
  746|      0|			folder->compname = "UNKNOWN";
  747|      3|		p += 8;
  748|      3|		used += 8;
  749|      3|		if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|      3|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (749:7): [True: 0, False: 3]
  ------------------
  750|      0|			p += hd->cffolder;/* abReserve */
  751|      0|			used += hd->cffolder;
  752|      0|		}
  753|       |		/*
  754|       |		 * Sanity check if each data is acceptable.
  755|       |		 */
  756|      3|		if (offset32 >= folder->cfdata_offset_in_cab)
  ------------------
  |  Branch (756:7): [True: 0, False: 3]
  ------------------
  757|      0|			goto invalid;
  758|      3|		offset32 = folder->cfdata_offset_in_cab;
  759|       |
  760|       |		/* Set a request to initialize zlib for the CFDATA of
  761|       |		 * this folder. */
  762|      3|		folder->decompress_init = 0;
  763|      3|	}
  764|      3|	__archive_read_consume(a, used);
  765|      3|	cab->cab_offset += used;
  766|       |
  767|       |	/*
  768|       |	 * Read CFFILE.
  769|       |	 */
  770|       |	/* Seek read pointer to the offset of CFFILE if needed. */
  771|      3|	skip = (int64_t)hd->files_offset - cab->cab_offset;
  772|      3|	if (skip <  0) {
  ------------------
  |  Branch (772:6): [True: 0, False: 3]
  ------------------
  773|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  774|      0|		    "Invalid offset of CFFILE %jd < %jd",
  775|      0|		    (intmax_t)hd->files_offset, (intmax_t)cab->cab_offset);
  776|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  777|      0|	}
  778|      3|	if (skip) {
  ------------------
  |  Branch (778:6): [True: 0, False: 3]
  ------------------
  779|      0|		__archive_read_consume(a, skip);
  780|      0|		cab->cab_offset += skip;
  781|      0|	}
  782|       |	/* Allocate memory for CFDATA */
  783|      3|	hd->file_array = (struct cffile *)calloc(
  784|      3|	    hd->file_count, sizeof(struct cffile));
  785|      3|	if (hd->file_array == NULL)
  ------------------
  |  Branch (785:6): [True: 0, False: 3]
  ------------------
  786|      0|		goto nomem;
  787|       |
  788|      3|	prev_folder = -1;
  789|      5|	for (i = 0; i < hd->file_count; i++) {
  ------------------
  |  Branch (789:14): [True: 3, False: 2]
  ------------------
  790|      3|		struct cffile *file = &(hd->file_array[i]);
  791|      3|		ssize_t avail;
  792|       |
  793|      3|		if ((p = __archive_read_ahead(a, 16, NULL)) == NULL)
  ------------------
  |  Branch (793:7): [True: 0, False: 3]
  ------------------
  794|      0|			return (truncated_error(a));
  795|      3|		file->uncompressed_size = archive_le32dec(p + CFFILE_cbFile);
  ------------------
  |  |  171|      3|#define CFFILE_cbFile		0
  ------------------
  796|      3|		file->offset = archive_le32dec(p + CFFILE_uoffFolderStart);
  ------------------
  |  |  172|      3|#define CFFILE_uoffFolderStart	4
  ------------------
  797|      3|		file->folder = archive_le16dec(p + CFFILE_iFolder);
  ------------------
  |  |  173|      3|#define CFFILE_iFolder		8
  ------------------
  798|      3|		file->mtime = cab_dos_time(p + CFFILE_date_time);
  ------------------
  |  |  174|      3|#define CFFILE_date_time	10
  ------------------
  799|      3|		file->attr = (uint8_t)archive_le16dec(p + CFFILE_attribs);
  ------------------
  |  |  175|      3|#define CFFILE_attribs		14
  ------------------
  800|      3|		__archive_read_consume(a, 16);
  801|       |
  802|      3|		cab->cab_offset += 16;
  803|      3|		if ((p = cab_read_ahead_remaining(a, 256, &avail)) == NULL)
  ------------------
  |  Branch (803:7): [True: 0, False: 3]
  ------------------
  804|      0|			return (truncated_error(a));
  805|      3|		if ((len = cab_strnlen(p, avail-1)) <= 0)
  ------------------
  |  Branch (805:7): [True: 1, False: 2]
  ------------------
  806|      1|			goto invalid;
  807|       |
  808|       |		/* Copy a pathname.  */
  809|      2|		archive_string_init(&(file->pathname));
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  810|      2|		archive_strncpy(&(file->pathname), p, len);
  ------------------
  |  |  173|      2|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  811|      2|		__archive_read_consume(a, len + 1);
  812|      2|		cab->cab_offset += len + 1;
  813|       |
  814|       |		/*
  815|       |		 * Sanity check if each data is acceptable.
  816|       |		 */
  817|      2|		if (file->uncompressed_size > 0x7FFF8000)
  ------------------
  |  Branch (817:7): [True: 0, False: 2]
  ------------------
  818|      0|			goto invalid;/* Too large */
  819|      2|		if ((int64_t)file->offset + (int64_t)file->uncompressed_size
  ------------------
  |  Branch (819:7): [True: 0, False: 2]
  ------------------
  820|      2|		    > ARCHIVE_LITERAL_LL(0x7FFF8000))
  ------------------
  |  |  178|      2|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  821|      0|			goto invalid;/* Too large */
  822|      2|		switch (file->folder) {
  823|      0|		case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (823:3): [True: 0, False: 2]
  ------------------
  824|       |			/* This must be last file in a folder. */
  825|      0|			if (i != hd->file_count -1)
  ------------------
  |  Branch (825:8): [True: 0, False: 0]
  ------------------
  826|      0|				goto invalid;
  827|      0|			cur_folder = hd->folder_count -1;
  828|      0|			break;
  829|      0|		case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (829:3): [True: 0, False: 2]
  ------------------
  830|       |			/* This must be only one file in a folder. */
  831|      0|			if (hd->file_count != 1)
  ------------------
  |  Branch (831:8): [True: 0, False: 0]
  ------------------
  832|      0|				goto invalid;
  833|       |			/* FALL THROUGH */
  834|      0|		case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (834:3): [True: 0, False: 2]
  ------------------
  835|       |			/* This must be first file in a folder. */
  836|      0|			if (i != 0)
  ------------------
  |  Branch (836:8): [True: 0, False: 0]
  ------------------
  837|      0|				goto invalid;
  838|      0|			prev_folder = cur_folder = 0;
  839|      0|			offset32 = file->offset;
  840|      0|			break;
  841|      2|		default:
  ------------------
  |  Branch (841:3): [True: 2, False: 0]
  ------------------
  842|      2|			if (file->folder >= hd->folder_count)
  ------------------
  |  Branch (842:8): [True: 0, False: 2]
  ------------------
  843|      0|				goto invalid;
  844|      2|			cur_folder = file->folder;
  845|      2|			break;
  846|      2|		}
  847|       |		/* Dot not back track. */
  848|      2|		if (cur_folder < prev_folder)
  ------------------
  |  Branch (848:7): [True: 0, False: 2]
  ------------------
  849|      0|			goto invalid;
  850|      2|		if (cur_folder != prev_folder)
  ------------------
  |  Branch (850:7): [True: 2, False: 0]
  ------------------
  851|      2|			offset32 = 0;
  852|      2|		prev_folder = cur_folder;
  853|       |
  854|       |		/* Make sure there are not any blanks from last file
  855|       |		 * contents. */
  856|      2|		if (offset32 != file->offset)
  ------------------
  |  Branch (856:7): [True: 0, False: 2]
  ------------------
  857|      0|			goto invalid;
  858|      2|		offset32 += file->uncompressed_size;
  859|       |
  860|       |		/* CFDATA is available for file contents. */
  861|      2|		if (file->uncompressed_size > 0 &&
  ------------------
  |  Branch (861:7): [True: 2, False: 0]
  ------------------
  862|      2|		    hd->folder_array[cur_folder].cfdata_count == 0)
  ------------------
  |  Branch (862:7): [True: 0, False: 2]
  ------------------
  863|      0|			goto invalid;
  864|      2|	}
  865|       |
  866|      2|	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  249|      2|#define PREV_CABINET	0x0001
  ------------------
              	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  250|      2|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (866:6): [True: 0, False: 2]
  |  Branch (866:26): [True: 0, False: 2]
  ------------------
  867|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  868|      0|		    "Multivolume cabinet file is unsupported");
  869|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  870|      0|	}
  871|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  872|      1|invalid:
  873|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  874|      1|	    "Invalid CAB header");
  875|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  876|      0|nomem:
  877|      0|	archive_set_error(&a->archive, ENOMEM,
  878|      0|	    "Can't allocate memory for CAB data");
  879|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  880|      2|}
archive_read_support_format_cab.c:truncated_error:
  530|      1|{
  531|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  532|      1|	    "Truncated CAB header");
  533|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  534|      1|}
archive_read_support_format_cab.c:cab_skip_sfx:
  488|      2|{
  489|      2|	const char *p, *q;
  490|      2|	size_t skip;
  491|      2|	ssize_t bytes, window;
  492|       |
  493|      2|	window = 4096;
  494|      2|	for (;;) {
  495|      2|		const char *h = __archive_read_ahead(a, window, &bytes);
  496|      2|		if (h == NULL) {
  ------------------
  |  Branch (496:7): [True: 0, False: 2]
  ------------------
  497|       |			/* Remaining size are less than window. */
  498|      0|			window >>= 1;
  499|      0|			if (window < 128) {
  ------------------
  |  Branch (499:8): [True: 0, False: 0]
  ------------------
  500|      0|				archive_set_error(&a->archive,
  501|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  502|      0|				    "Couldn't find out CAB header");
  503|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  504|      0|			}
  505|      0|			continue;
  506|      0|		}
  507|      2|		p = h;
  508|      2|		q = p + bytes;
  509|       |
  510|       |		/*
  511|       |		 * Scan ahead until we find something that looks
  512|       |		 * like the cab header.
  513|       |		 */
  514|  40.9k|		while (p + 8 < q) {
  ------------------
  |  Branch (514:10): [True: 40.9k, False: 0]
  ------------------
  515|  40.9k|			int next;
  516|  40.9k|			if ((next = find_cab_magic(p)) == 0) {
  ------------------
  |  Branch (516:8): [True: 2, False: 40.9k]
  ------------------
  517|      2|				skip = p - h;
  518|      2|				__archive_read_consume(a, skip);
  519|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  520|      2|			}
  521|  40.9k|			p += next;
  522|  40.9k|		}
  523|      0|		skip = p - h;
  524|      0|		__archive_read_consume(a, skip);
  525|      0|	}
  526|      2|}
archive_read_support_format_cab.c:cab_strnlen:
  538|      3|{
  539|      3|	size_t i;
  540|       |
  541|   262k|	for (i = 0; i <= maxlen; i++) {
  ------------------
  |  Branch (541:14): [True: 262k, False: 1]
  ------------------
  542|   262k|		if (p[i] == 0)
  ------------------
  |  Branch (542:7): [True: 2, False: 262k]
  ------------------
  543|      2|			break;
  544|   262k|	}
  545|      3|	if (i > maxlen)
  ------------------
  |  Branch (545:6): [True: 1, False: 2]
  ------------------
  546|      1|		return (-1);/* invalid */
  547|      2|	return ((ssize_t)i);
  548|      3|}
archive_read_support_format_cab.c:cab_dos_time:
 2045|      3|{
 2046|      3|	int msTime, msDate;
 2047|      3|	struct tm ts;
 2048|       |
 2049|      3|	msDate = archive_le16dec(p);
 2050|      3|	msTime = archive_le16dec(p+2);
 2051|       |
 2052|      3|	memset(&ts, 0, sizeof(ts));
 2053|      3|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 2054|      3|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 2055|      3|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 2056|      3|	ts.tm_hour = (msTime >> 11) & 0x1f;
 2057|      3|	ts.tm_min = (msTime >> 5) & 0x3f;
 2058|      3|	ts.tm_sec = (msTime << 1) & 0x3e;
 2059|      3|	ts.tm_isdst = -1;
 2060|      3|	return (mktime(&ts));
 2061|      3|}
archive_read_support_format_cab.c:cab_read_ahead_remaining:
  553|      3|{
  554|      3|	const void *p;
  555|       |
  556|      3|	while (min > 0) {
  ------------------
  |  Branch (556:9): [True: 3, False: 0]
  ------------------
  557|      3|		p = __archive_read_ahead(a, min, avail);
  558|      3|		if (p != NULL)
  ------------------
  |  Branch (558:7): [True: 3, False: 0]
  ------------------
  559|      3|			return (p);
  560|      0|		min--;
  561|      0|	}
  562|      0|	return (NULL);
  563|      3|}
archive_read_support_format_cab.c:cab_convert_path_separator_1:
  568|      2|{
  569|      2|	size_t i;
  570|      2|	int mb;
  571|       |
  572|       |	/* Easy check if we have '\' in multi-byte string. */
  573|      2|	mb = 0;
  574|      8|	for (i = 0; i < archive_strlen(fn); i++) {
  ------------------
  |  |  178|      8|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (574:14): [True: 6, False: 2]
  ------------------
  575|      6|		if (fn->s[i] == '\\') {
  ------------------
  |  Branch (575:7): [True: 0, False: 6]
  ------------------
  576|      0|			if (mb) {
  ------------------
  |  Branch (576:8): [True: 0, False: 0]
  ------------------
  577|       |				/* This may be second byte of multi-byte
  578|       |				 * character. */
  579|      0|				break;
  580|      0|			}
  581|      0|			fn->s[i] = '/';
  582|      0|			mb = 0;
  583|      6|		} else if ((fn->s[i] & 0x80) && !(attr & ATTR_NAME_IS_UTF))
  ------------------
  |  |  238|      2|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (583:14): [True: 2, False: 4]
  |  Branch (583:35): [True: 0, False: 2]
  ------------------
  584|      0|			mb = 1;
  585|      6|		else
  586|      6|			mb = 0;
  587|      6|	}
  588|      2|	if (i == archive_strlen(fn))
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (588:6): [True: 2, False: 0]
  ------------------
  589|      2|		return (0);
  590|      0|	return (-1);
  591|      2|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data:
 1009|      2|{
 1010|      2|	struct cab *cab = (struct cab *)(a->format->data);
 1011|      2|	int r;
 1012|       |
 1013|      2|	switch (cab->entry_cffile->folder) {
 1014|      0|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1014:2): [True: 0, False: 2]
  ------------------
 1015|      0|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1015:2): [True: 0, False: 2]
  ------------------
 1016|      0|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1016:2): [True: 0, False: 2]
  ------------------
 1017|      0|		*buff = NULL;
 1018|      0|		*size = 0;
 1019|      0|		*offset = 0;
 1020|      0|		archive_clear_error(&a->archive);
 1021|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1022|      0|		    "Cannot restore this file split in multivolume.");
 1023|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1024|      2|	default:
  ------------------
  |  Branch (1024:2): [True: 2, False: 0]
  ------------------
 1025|      2|		break;
 1026|      2|	}
 1027|      2|	if (cab->read_data_invoked == 0) {
  ------------------
  |  Branch (1027:6): [True: 2, False: 0]
  ------------------
 1028|      2|		if (cab->bytes_skipped) {
  ------------------
  |  Branch (1028:7): [True: 0, False: 2]
  ------------------
 1029|      0|			if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (1029:8): [True: 0, False: 0]
  ------------------
 1030|      0|				r = cab_next_cfdata(a);
 1031|      0|				if (r < 0)
  ------------------
  |  Branch (1031:9): [True: 0, False: 0]
  ------------------
 1032|      0|					return (r);
 1033|      0|			}
 1034|      0|			if (cab_consume_cfdata(a, cab->bytes_skipped) < 0)
  ------------------
  |  Branch (1034:8): [True: 0, False: 0]
  ------------------
 1035|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1036|      0|			cab->bytes_skipped = 0;
 1037|      0|		}
 1038|      2|		cab->read_data_invoked = 1;
 1039|      2|	}
 1040|      2|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (1040:6): [True: 0, False: 2]
  ------------------
 1041|       |		/* Consume as much as the compressor actually used. */
 1042|      0|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 1043|      0|		cab->entry_unconsumed = 0;
 1044|      0|		if (r < 0)
  ------------------
  |  Branch (1044:7): [True: 0, False: 0]
  ------------------
 1045|      0|			return (r);
 1046|      0|	}
 1047|      2|	if (cab->end_of_archive || cab->end_of_entry) {
  ------------------
  |  Branch (1047:6): [True: 0, False: 2]
  |  Branch (1047:29): [True: 0, False: 2]
  ------------------
 1048|      0|		if (!cab->end_of_entry_cleanup) {
  ------------------
  |  Branch (1048:7): [True: 0, False: 0]
  ------------------
 1049|       |			/* End-of-entry cleanup done. */
 1050|      0|			cab->end_of_entry_cleanup = 1;
 1051|      0|		}
 1052|      0|		*offset = cab->entry_offset;
 1053|      0|		*size = 0;
 1054|      0|		*buff = NULL;
 1055|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1056|      0|	}
 1057|       |
 1058|      2|	return (cab_read_data(a, buff, size, offset));
 1059|      2|}
archive_read_support_format_cab.c:cab_next_cfdata:
 1191|      2|{
 1192|      2|	struct cab *cab = (struct cab *)(a->format->data);
 1193|      2|	struct cfdata *cfdata = cab->entry_cfdata;
 1194|       |
 1195|       |	/* There are remaining bytes in current CFDATA, use it first. */
 1196|      2|	if (cfdata != NULL && cfdata->uncompressed_bytes_remaining > 0)
  ------------------
  |  Branch (1196:6): [True: 0, False: 2]
  |  Branch (1196:24): [True: 0, False: 0]
  ------------------
 1197|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1198|       |
 1199|      2|	if (cfdata == NULL) {
  ------------------
  |  Branch (1199:6): [True: 2, False: 0]
  ------------------
 1200|      2|		int64_t skip;
 1201|       |
 1202|      2|		cab->entry_cffolder->cfdata_index = 0;
 1203|       |
 1204|       |		/* Seek read pointer to the offset of CFDATA if needed. */
 1205|      2|		skip = cab->entry_cffolder->cfdata_offset_in_cab
 1206|      2|			- cab->cab_offset;
 1207|      2|		if (skip < 0) {
  ------------------
  |  Branch (1207:7): [True: 0, False: 2]
  ------------------
 1208|      0|			int folder_index;
 1209|      0|			switch (cab->entry_cffile->folder) {
 1210|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1210:4): [True: 0, False: 0]
  ------------------
 1211|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1211:4): [True: 0, False: 0]
  ------------------
 1212|      0|				folder_index = 0;
 1213|      0|				break;
 1214|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1214:4): [True: 0, False: 0]
  ------------------
 1215|      0|				folder_index = cab->cfheader.folder_count-1;
 1216|      0|				break;
 1217|      0|			default:
  ------------------
  |  Branch (1217:4): [True: 0, False: 0]
  ------------------
 1218|      0|				folder_index = cab->entry_cffile->folder;
 1219|      0|				break;
 1220|      0|			}
 1221|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1222|      0|			    "Invalid offset of CFDATA in folder(%d) %jd < %jd",
 1223|      0|			    folder_index,
 1224|      0|			    (intmax_t)cab->entry_cffolder->cfdata_offset_in_cab,
 1225|      0|			    (intmax_t)cab->cab_offset);
 1226|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1227|      0|		}
 1228|      2|		if (skip > 0) {
  ------------------
  |  Branch (1228:7): [True: 2, False: 0]
  ------------------
 1229|      2|			if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (1229:8): [True: 0, False: 2]
  ------------------
 1230|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1231|      2|			cab->cab_offset =
 1232|      2|			    cab->entry_cffolder->cfdata_offset_in_cab;
 1233|      2|		}
 1234|      2|	}
 1235|       |
 1236|       |	/*
 1237|       |	 * Read a CFDATA.
 1238|       |	 */
 1239|      2|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1239:6): [True: 2, False: 0]
  ------------------
 1240|      2|	    cab->entry_cffolder->cfdata_count) {
 1241|      2|		const unsigned char *p;
 1242|      2|		int l;
 1243|       |
 1244|      2|		cfdata = &(cab->entry_cffolder->cfdata);
 1245|      2|		cab->entry_cffolder->cfdata_index++;
 1246|      2|		cab->entry_cfdata = cfdata;
 1247|      2|		cfdata->sum_calculated = 0;
 1248|      2|		cfdata->sum_extra_avail = 0;
 1249|      2|		cfdata->sum_ptr = NULL;
 1250|      2|		l = 8;
 1251|      2|		if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  251|      2|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1251:7): [True: 0, False: 2]
  ------------------
 1252|      0|			l += cab->cfheader.cfdata;
 1253|      2|		if ((p = __archive_read_ahead(a, l, NULL)) == NULL)
  ------------------
  |  Branch (1253:7): [True: 0, False: 2]
  ------------------
 1254|      0|			return (truncated_error(a));
 1255|      2|		cfdata->sum = archive_le32dec(p + CFDATA_csum);
  ------------------
  |  |  178|      2|#define CFDATA_csum		0
  ------------------
 1256|      2|		cfdata->compressed_size = archive_le16dec(p + CFDATA_cbData);
  ------------------
  |  |  179|      2|#define CFDATA_cbData		4
  ------------------
 1257|      2|		cfdata->compressed_bytes_remaining = cfdata->compressed_size;
 1258|      2|		cfdata->uncompressed_size =
 1259|      2|		    archive_le16dec(p + CFDATA_cbUncomp);
  ------------------
  |  |  180|      2|#define CFDATA_cbUncomp		6
  ------------------
 1260|      2|		cfdata->uncompressed_bytes_remaining =
 1261|      2|		    cfdata->uncompressed_size;
 1262|      2|		cfdata->uncompressed_avail = 0;
 1263|      2|		cfdata->read_offset = 0;
 1264|      2|		cfdata->unconsumed = 0;
 1265|       |
 1266|       |		/*
 1267|       |		 * Sanity check if data size is acceptable.
 1268|       |		 */
 1269|      2|		if (cfdata->compressed_size == 0 ||
  ------------------
  |  Branch (1269:7): [True: 0, False: 2]
  ------------------
 1270|      2|		    cfdata->compressed_size > (0x8000+6144))
  ------------------
  |  Branch (1270:7): [True: 0, False: 2]
  ------------------
 1271|      0|			goto invalid;
 1272|      2|		if (cfdata->uncompressed_size > 0x8000)
  ------------------
  |  Branch (1272:7): [True: 0, False: 2]
  ------------------
 1273|      0|			goto invalid;
 1274|      2|		if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1274:7): [True: 0, False: 2]
  ------------------
 1275|      0|			switch (cab->entry_cffile->folder) {
 1276|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1276:4): [True: 0, False: 0]
  ------------------
 1277|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1277:4): [True: 0, False: 0]
  ------------------
 1278|      0|				break;
 1279|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1279:4): [True: 0, False: 0]
  ------------------
 1280|      0|			default:
  ------------------
  |  Branch (1280:4): [True: 0, False: 0]
  ------------------
 1281|      0|				goto invalid;
 1282|      0|			}
 1283|      0|		}
 1284|       |		/* If CFDATA is not last in a folder, an uncompressed
 1285|       |		 * size must be 0x8000(32KBi) */
 1286|      2|		if ((cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1286:7): [True: 0, False: 2]
  ------------------
 1287|      2|		     cab->entry_cffolder->cfdata_count) &&
 1288|      2|		       cfdata->uncompressed_size != 0x8000)
  ------------------
  |  Branch (1288:10): [True: 0, False: 0]
  ------------------
 1289|      0|			goto invalid;
 1290|       |
 1291|       |		/* A compressed data size and an uncompressed data size must
 1292|       |		 * be the same in no compression mode. */
 1293|      2|		if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  215|      4|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1293:7): [True: 0, False: 2]
  ------------------
 1294|      2|		    cfdata->compressed_size != cfdata->uncompressed_size)
  ------------------
  |  Branch (1294:7): [True: 0, False: 0]
  ------------------
 1295|      0|			goto invalid;
 1296|       |
 1297|       |		/*
 1298|       |		 * Save CFDATA image for sum check.
 1299|       |		 */
 1300|      2|		if (cfdata->memimage_size < (size_t)l) {
  ------------------
  |  Branch (1300:7): [True: 2, False: 0]
  ------------------
 1301|      2|			free(cfdata->memimage);
 1302|      2|			cfdata->memimage = malloc(l);
 1303|      2|			if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1303:8): [True: 0, False: 2]
  ------------------
 1304|      0|				archive_set_error(&a->archive, ENOMEM,
 1305|      0|				    "Can't allocate memory for CAB data");
 1306|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1307|      0|			}
 1308|      2|			cfdata->memimage_size = l;
 1309|      2|		}
 1310|      2|		memcpy(cfdata->memimage, p, l);
 1311|       |
 1312|       |		/* Consume bytes as much as we used. */
 1313|      2|		__archive_read_consume(a, l);
 1314|      2|		cab->cab_offset += l;
 1315|      2|	} else if (cab->entry_cffolder->cfdata_count > 0) {
  ------------------
  |  Branch (1315:13): [True: 0, False: 0]
  ------------------
 1316|       |		/* Run out of all CFDATA in a folder. */
 1317|      0|		cfdata->compressed_size = 0;
 1318|      0|		cfdata->uncompressed_size = 0;
 1319|      0|		cfdata->compressed_bytes_remaining = 0;
 1320|      0|		cfdata->uncompressed_bytes_remaining = 0;
 1321|      0|	} else {
 1322|       |		/* Current folder does not have any CFDATA. */
 1323|      0|		cfdata = &(cab->entry_cffolder->cfdata);
 1324|      0|		cab->entry_cfdata = cfdata;
 1325|      0|		memset(cfdata, 0, sizeof(*cfdata));
 1326|      0|	}
 1327|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1328|      0|invalid:
 1329|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1330|      0|	    "Invalid CFDATA");
 1331|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1332|      2|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata:
 1339|      2|{
 1340|      2|	struct cab *cab = (struct cab *)(a->format->data);
 1341|      2|	int err;
 1342|       |
 1343|      2|	err = cab_next_cfdata(a);
 1344|      2|	if (err < ARCHIVE_OK) {
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1344:6): [True: 0, False: 2]
  ------------------
 1345|      0|		*avail = err;
 1346|      0|		return (NULL);
 1347|      0|	}
 1348|       |
 1349|      2|	switch (cab->entry_cffolder->comptype) {
 1350|      0|	case COMPTYPE_NONE:
  ------------------
  |  |  215|      0|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1350:2): [True: 0, False: 2]
  ------------------
 1351|      0|		return (cab_read_ahead_cfdata_none(a, avail));
 1352|      2|	case COMPTYPE_MSZIP:
  ------------------
  |  |  216|      2|#define COMPTYPE_MSZIP		0x0001
  ------------------
  |  Branch (1352:2): [True: 2, False: 0]
  ------------------
 1353|      2|		return (cab_read_ahead_cfdata_deflate(a, avail));
 1354|      0|	case COMPTYPE_LZX:
  ------------------
  |  |  218|      0|#define COMPTYPE_LZX		0x0003
  ------------------
  |  Branch (1354:2): [True: 0, False: 2]
  ------------------
 1355|      0|		return (cab_read_ahead_cfdata_lzx(a, avail));
 1356|      0|	default: /* Unsupported compression. */
  ------------------
  |  Branch (1356:2): [True: 0, False: 2]
  ------------------
 1357|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1358|      0|		    "Unsupported CAB compression : %s",
 1359|      0|		    cab->entry_cffolder->compname);
 1360|      0|		*avail = ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1361|      0|		return (NULL);
 1362|      2|	}
 1363|      2|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_deflate:
 1402|      2|{
 1403|      2|	struct cab *cab = (struct cab *)(a->format->data);
 1404|      2|	struct cfdata *cfdata;
 1405|      2|	const void *d;
 1406|      2|	int r, mszip;
 1407|      2|	uint16_t uavail;
 1408|      2|	char eod = 0;
 1409|       |
 1410|      2|	cfdata = cab->entry_cfdata;
 1411|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1412|      2|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1412:6): [True: 2, False: 0]
  ------------------
 1413|      2|		cab->uncompressed_buffer_size = 0x8000;
 1414|      2|		cab->uncompressed_buffer
 1415|      2|		    = (unsigned char *)malloc(cab->uncompressed_buffer_size);
 1416|      2|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1416:7): [True: 0, False: 2]
  ------------------
 1417|      0|			archive_set_error(&a->archive, ENOMEM,
 1418|      0|			    "No memory for CAB reader");
 1419|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1420|      0|			return (NULL);
 1421|      0|		}
 1422|      2|	}
 1423|       |
 1424|      2|	uavail = cfdata->uncompressed_avail;
 1425|      2|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1425:6): [True: 0, False: 2]
  ------------------
 1426|      0|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1427|      0|		*avail = uavail - cfdata->read_offset;
 1428|      0|		return (d);
 1429|      0|	}
 1430|       |
 1431|      2|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1431:6): [True: 2, False: 0]
  ------------------
 1432|      2|		cab->stream.next_in = NULL;
 1433|      2|		cab->stream.avail_in = 0;
 1434|      2|		cab->stream.total_in = 0;
 1435|      2|		cab->stream.next_out = NULL;
 1436|      2|		cab->stream.avail_out = 0;
 1437|      2|		cab->stream.total_out = 0;
 1438|      2|		if (cab->stream_valid)
  ------------------
  |  Branch (1438:7): [True: 0, False: 2]
  ------------------
 1439|      0|			r = inflateReset(&cab->stream);
 1440|      2|		else
 1441|      2|			r = inflateInit2(&cab->stream,
 1442|      2|			    -15 /* Don't check for zlib header */);
 1443|      2|		if (r != Z_OK) {
  ------------------
  |  Branch (1443:7): [True: 0, False: 2]
  ------------------
 1444|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1445|      0|			    "Can't initialize deflate decompression.");
 1446|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1447|      0|			return (NULL);
 1448|      0|		}
 1449|       |		/* Stream structure has been set up. */
 1450|      2|		cab->stream_valid = 1;
 1451|       |		/* We've initialized decompression for this stream. */
 1452|      2|		cab->entry_cffolder->decompress_init = 1;
 1453|      2|	}
 1454|       |
 1455|      2|	if (cfdata->compressed_bytes_remaining == cfdata->compressed_size)
  ------------------
  |  Branch (1455:6): [True: 2, False: 0]
  ------------------
 1456|      2|		mszip = 2;
 1457|      0|	else
 1458|      0|		mszip = 0;
 1459|      2|	eod = 0;
 1460|      2|	cab->stream.total_out = uavail;
 1461|       |	/*
 1462|       |	 * We always uncompress all data in current CFDATA.
 1463|       |	 */
 1464|      2|	while (!eod && cab->stream.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1464:9): [True: 2, False: 0]
  |  Branch (1464:17): [True: 2, False: 0]
  ------------------
 1465|      2|		ssize_t bytes_avail;
 1466|       |
 1467|      2|		cab->stream.next_out =
 1468|      2|		    cab->uncompressed_buffer + cab->stream.total_out;
 1469|      2|		cab->stream.avail_out =
 1470|      2|		    cfdata->uncompressed_size - cab->stream.total_out;
 1471|       |
 1472|      2|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1473|      2|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1473:7): [True: 0, False: 2]
  ------------------
 1474|      0|			*avail = truncated_error(a);
 1475|      0|			return (NULL);
 1476|      0|		}
 1477|      2|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1477:7): [True: 2, False: 0]
  ------------------
 1478|      2|			bytes_avail = cfdata->compressed_bytes_remaining;
 1479|       |		/*
 1480|       |		 * A bug in zlib.h: stream.next_in should be marked 'const'
 1481|       |		 * but isn't (the library never alters data through the
 1482|       |		 * next_in pointer, only reads it).  The result: this ugly
 1483|       |		 * cast to remove 'const'.
 1484|       |		 */
 1485|      2|		cab->stream.next_in = (Bytef *)(uintptr_t)d;
 1486|      2|		cab->stream.avail_in = (uInt)bytes_avail;
 1487|      2|		cab->stream.total_in = 0;
 1488|       |
 1489|       |		/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
 1490|      2|		if (mszip > 0) {
  ------------------
  |  Branch (1490:7): [True: 2, False: 0]
  ------------------
 1491|      2|			if (bytes_avail <= 0)
  ------------------
  |  Branch (1491:8): [True: 0, False: 2]
  ------------------
 1492|      0|				goto nomszip;
 1493|      2|			if (bytes_avail <= mszip) {
  ------------------
  |  Branch (1493:8): [True: 2, False: 0]
  ------------------
 1494|      2|				if (mszip == 2) {
  ------------------
  |  Branch (1494:9): [True: 2, False: 0]
  ------------------
 1495|      2|					if (cab->stream.next_in[0] != 0x43)
  ------------------
  |  Branch (1495:10): [True: 2, False: 0]
  ------------------
 1496|      2|						goto nomszip;
 1497|      0|					if (bytes_avail > 1 &&
  ------------------
  |  Branch (1497:10): [True: 0, False: 0]
  ------------------
 1498|      0|					    cab->stream.next_in[1] != 0x4b)
  ------------------
  |  Branch (1498:10): [True: 0, False: 0]
  ------------------
 1499|      0|						goto nomszip;
 1500|      0|				} else if (cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1500:16): [True: 0, False: 0]
  ------------------
 1501|      0|					goto nomszip;
 1502|      0|				cfdata->unconsumed = bytes_avail;
 1503|      0|				cfdata->sum_ptr = d;
 1504|      0|				if (cab_minimum_consume_cfdata(
  ------------------
  |  Branch (1504:9): [True: 0, False: 0]
  ------------------
 1505|      0|				    a, cfdata->unconsumed) < 0) {
 1506|      0|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1507|      0|					return (NULL);
 1508|      0|				}
 1509|      0|				mszip -= (int)bytes_avail;
 1510|      0|				continue;
 1511|      0|			}
 1512|      0|			if (mszip == 1 && cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1512:8): [True: 0, False: 0]
  |  Branch (1512:22): [True: 0, False: 0]
  ------------------
 1513|      0|				goto nomszip;
 1514|      0|			else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 ||
  ------------------
  |  Branch (1514:13): [True: 0, False: 0]
  |  Branch (1514:28): [True: 0, False: 0]
  ------------------
 1515|      0|			    cab->stream.next_in[1] != 0x4b))
  ------------------
  |  Branch (1515:8): [True: 0, False: 0]
  ------------------
 1516|      0|				goto nomszip;
 1517|      0|			cab->stream.next_in += mszip;
 1518|      0|			cab->stream.avail_in -= mszip;
 1519|      0|			cab->stream.total_in += mszip;
 1520|      0|			mszip = 0;
 1521|      0|		}
 1522|       |
 1523|      0|		r = inflate(&cab->stream, 0);
 1524|      0|		switch (r) {
 1525|      0|		case Z_OK:
  ------------------
  |  Branch (1525:3): [True: 0, False: 0]
  ------------------
 1526|      0|			break;
 1527|      0|		case Z_STREAM_END:
  ------------------
  |  Branch (1527:3): [True: 0, False: 0]
  ------------------
 1528|      0|			eod = 1;
 1529|      0|			break;
 1530|      0|		default:
  ------------------
  |  Branch (1530:3): [True: 0, False: 0]
  ------------------
 1531|      0|			goto zlibfailed;
 1532|      0|		}
 1533|      0|		cfdata->unconsumed = cab->stream.total_in;
 1534|      0|		cfdata->sum_ptr = d;
 1535|      0|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1535:7): [True: 0, False: 0]
  ------------------
 1536|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1537|      0|			return (NULL);
 1538|      0|		}
 1539|      0|	}
 1540|      0|	uavail = (uint16_t)cab->stream.total_out;
 1541|       |
 1542|      0|	if (uavail < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1542:6): [True: 0, False: 0]
  ------------------
 1543|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1544|      0|		    "Invalid uncompressed size (%d < %d)",
 1545|      0|		    uavail, cfdata->uncompressed_size);
 1546|      0|		*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1547|      0|		return (NULL);
 1548|      0|	}
 1549|       |
 1550|       |	/*
 1551|       |	 * Note: I suspect there is a bug in makecab.exe because, in rare
 1552|       |	 * case, compressed bytes are still remaining regardless we have
 1553|       |	 * gotten all uncompressed bytes, which size is recorded in CFDATA,
 1554|       |	 * as much as we need, and we have to use the garbage so as to
 1555|       |	 * correctly compute the sum of CFDATA accordingly.
 1556|       |	 */
 1557|      0|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1557:6): [True: 0, False: 0]
  ------------------
 1558|      0|		ssize_t bytes_avail;
 1559|       |
 1560|      0|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1561|      0|		    &bytes_avail);
 1562|      0|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1562:7): [True: 0, False: 0]
  ------------------
 1563|      0|			*avail = truncated_error(a);
 1564|      0|			return (NULL);
 1565|      0|		}
 1566|      0|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1567|      0|		cfdata->sum_ptr = d;
 1568|      0|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1568:7): [True: 0, False: 0]
  ------------------
 1569|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1570|      0|			return (NULL);
 1571|      0|		}
 1572|      0|	}
 1573|       |
 1574|       |	/*
 1575|       |	 * Set dictionary data for decompressing of next CFDATA, which
 1576|       |	 * in the same folder. This is why we always do decompress CFDATA
 1577|       |	 * even if beginning CFDATA or some of CFDATA are not used in
 1578|       |	 * skipping file data.
 1579|       |	 */
 1580|      0|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1580:6): [True: 0, False: 0]
  ------------------
 1581|      0|	    cab->entry_cffolder->cfdata_count) {
 1582|      0|		r = inflateReset(&cab->stream);
 1583|      0|		if (r != Z_OK)
  ------------------
  |  Branch (1583:7): [True: 0, False: 0]
  ------------------
 1584|      0|			goto zlibfailed;
 1585|      0|		r = inflateSetDictionary(&cab->stream,
 1586|      0|		    cab->uncompressed_buffer, cfdata->uncompressed_size);
 1587|      0|		if (r != Z_OK)
  ------------------
  |  Branch (1587:7): [True: 0, False: 0]
  ------------------
 1588|      0|			goto zlibfailed;
 1589|      0|	}
 1590|       |
 1591|      0|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1592|      0|	*avail = uavail - cfdata->read_offset;
 1593|      0|	cfdata->uncompressed_avail = uavail;
 1594|       |
 1595|      0|	return (d);
 1596|       |
 1597|      0|zlibfailed:
 1598|      0|	switch (r) {
 1599|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (1599:2): [True: 0, False: 0]
  ------------------
 1600|      0|		archive_set_error(&a->archive, ENOMEM,
 1601|      0|		    "Out of memory for deflate decompression");
 1602|      0|		break;
 1603|      0|	default:
  ------------------
  |  Branch (1603:2): [True: 0, False: 0]
  ------------------
 1604|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1605|      0|		    "Deflate decompression failed (%d)", r);
 1606|      0|		break;
 1607|      0|	}
 1608|      0|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1609|      0|	return (NULL);
 1610|      2|nomszip:
 1611|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1612|      2|	    "CFDATA incorrect(no MSZIP signature)");
 1613|      2|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1614|      2|	return (NULL);
 1615|      0|}
archive_read_support_format_cab.c:cab_read_data:
 1914|      2|{
 1915|      2|	struct cab *cab = (struct cab *)(a->format->data);
 1916|      2|	ssize_t bytes_avail;
 1917|       |
 1918|      2|	if (cab->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1918:6): [True: 0, False: 2]
  ------------------
 1919|      0|		*buff = NULL;
 1920|      0|		*size = 0;
 1921|      0|		*offset = cab->entry_offset;
 1922|      0|		cab->end_of_entry = 1;
 1923|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1924|      0|	}
 1925|       |
 1926|      2|	*buff = cab_read_ahead_cfdata(a, &bytes_avail);
 1927|      2|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1927:6): [True: 2, False: 0]
  ------------------
 1928|      2|		*buff = NULL;
 1929|      2|		*size = 0;
 1930|      2|		*offset = 0;
 1931|      2|		if (bytes_avail == 0 &&
  ------------------
  |  Branch (1931:7): [True: 0, False: 2]
  ------------------
 1932|      2|		    cab->entry_cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1932:7): [True: 0, False: 0]
  ------------------
 1933|       |			/* All of CFDATA in a folder has been handled. */
 1934|      0|			archive_set_error(&a->archive,
 1935|      0|			    ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA");
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1936|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1937|      0|		} else
 1938|      2|			return ((int)bytes_avail);
 1939|      2|	}
 1940|      0|	if (bytes_avail > cab->entry_bytes_remaining)
  ------------------
  |  Branch (1940:6): [True: 0, False: 0]
  ------------------
 1941|      0|		bytes_avail = (ssize_t)cab->entry_bytes_remaining;
 1942|       |
 1943|      0|	*size = bytes_avail;
 1944|      0|	*offset = cab->entry_offset;
 1945|      0|	cab->entry_offset += bytes_avail;
 1946|      0|	cab->entry_bytes_remaining -= bytes_avail;
 1947|      0|	if (cab->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1947:6): [True: 0, False: 0]
  ------------------
 1948|      0|		cab->end_of_entry = 1;
 1949|      0|	cab->entry_unconsumed = bytes_avail;
 1950|      0|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  215|      0|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1950:6): [True: 0, False: 0]
  ------------------
 1951|       |		/* Don't consume more than current entry used. */
 1952|      0|		if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed)
  ------------------
  |  Branch (1952:7): [True: 0, False: 0]
  ------------------
 1953|      0|			cab->entry_cfdata->unconsumed = cab->entry_unconsumed;
 1954|      0|	}
 1955|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1956|      2|}
archive_read_support_format_cab.c:archive_read_format_cab_cleanup:
 2015|    238|{
 2016|    238|	struct cab *cab = (struct cab *)(a->format->data);
 2017|    238|	struct cfheader *hd = &cab->cfheader;
 2018|    238|	int i;
 2019|       |
 2020|    238|	if (hd->folder_array != NULL) {
  ------------------
  |  Branch (2020:6): [True: 3, False: 235]
  ------------------
 2021|      6|		for (i = 0; i < hd->folder_count; i++)
  ------------------
  |  Branch (2021:15): [True: 3, False: 3]
  ------------------
 2022|      3|			free(hd->folder_array[i].cfdata.memimage);
 2023|      3|		free(hd->folder_array);
 2024|      3|	}
 2025|    238|	if (hd->file_array != NULL) {
  ------------------
  |  Branch (2025:6): [True: 3, False: 235]
  ------------------
 2026|      6|		for (i = 0; i < cab->cfheader.file_count; i++)
  ------------------
  |  Branch (2026:15): [True: 3, False: 3]
  ------------------
 2027|      3|			archive_string_free(&(hd->file_array[i].pathname));
 2028|      3|		free(hd->file_array);
 2029|      3|	}
 2030|    238|#ifdef HAVE_ZLIB_H
 2031|    238|	if (cab->stream_valid)
  ------------------
  |  Branch (2031:6): [True: 2, False: 236]
  ------------------
 2032|      2|		inflateEnd(&cab->stream);
 2033|    238|#endif
 2034|    238|	lzx_decode_free(&cab->xstrm);
 2035|    238|	archive_wstring_free(&cab->ws);
 2036|    238|	free(cab->uncompressed_buffer);
 2037|    238|	free(cab);
 2038|    238|	(a->format->data) = NULL;
 2039|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2040|    238|}
archive_read_support_format_cab.c:lzx_decode_free:
 2170|    238|{
 2171|       |
 2172|    238|	if (strm->ds == NULL)
  ------------------
  |  Branch (2172:6): [True: 238, False: 0]
  ------------------
 2173|    238|		return;
 2174|      0|	free(strm->ds->w_buff);
 2175|      0|	free(strm->ds->pos_tbl);
 2176|      0|	lzx_huffman_free(&(strm->ds->at));
 2177|      0|	lzx_huffman_free(&(strm->ds->pt));
 2178|      0|	lzx_huffman_free(&(strm->ds->mt));
 2179|      0|	lzx_huffman_free(&(strm->ds->lt));
 2180|      0|	free(strm->ds);
 2181|      0|	strm->ds = NULL;
 2182|      0|}

archive_read_support_format_cpio:
  223|    238|{
  224|    238|	struct archive_read *a = (struct archive_read *)_a;
  225|    238|	struct cpio *cpio;
  226|    238|	int r;
  227|       |
  228|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  229|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cpio");
  230|       |
  231|    238|	cpio = (struct cpio *)calloc(1, sizeof(*cpio));
  232|    238|	if (cpio == NULL) {
  ------------------
  |  Branch (232:6): [True: 0, False: 238]
  ------------------
  233|      0|		archive_set_error(&a->archive, ENOMEM, "Can't allocate cpio data");
  234|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  235|      0|	}
  236|    238|	cpio->magic = CPIO_MAGIC;
  ------------------
  |  |  173|    238|#define	CPIO_MAGIC   0x13141516
  ------------------
  237|       |
  238|    238|	r = __archive_read_register_format(a,
  239|    238|	    cpio,
  240|    238|	    "cpio",
  241|    238|	    archive_read_format_cpio_bid,
  242|    238|	    archive_read_format_cpio_options,
  243|    238|	    archive_read_format_cpio_read_header,
  244|    238|	    archive_read_format_cpio_read_data,
  245|    238|	    archive_read_format_cpio_skip,
  246|    238|	    NULL,
  247|    238|	    archive_read_format_cpio_cleanup,
  248|    238|	    NULL,
  249|    238|	    NULL);
  250|       |
  251|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (251:6): [True: 0, False: 238]
  ------------------
  252|      0|		free(cpio);
  253|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  254|    238|}
archive_read_support_format_cpio.c:archive_read_format_cpio_bid:
  259|    236|{
  260|    236|	const unsigned char *p;
  261|    236|	struct cpio *cpio;
  262|    236|	int bid;
  263|       |
  264|    236|	(void)best_bid; /* UNUSED */
  265|       |
  266|    236|	cpio = (struct cpio *)(a->format->data);
  267|       |
  268|    236|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL)
  ------------------
  |  Branch (268:6): [True: 2, False: 234]
  ------------------
  269|      2|		return (-1);
  270|       |
  271|    234|	bid = 0;
  272|    234|	if (memcmp(p, "070707", 6) == 0) {
  ------------------
  |  Branch (272:6): [True: 1, False: 233]
  ------------------
  273|       |		/* ASCII cpio archive (odc, POSIX.1) */
  274|      1|		cpio->read_header = header_odc;
  275|      1|		bid += 48;
  276|       |		/*
  277|       |		 * XXX TODO:  More verification; Could check that only octal
  278|       |		 * digits appear in appropriate header locations. XXX
  279|       |		 */
  280|    233|	} else if (memcmp(p, "070727", 6) == 0) {
  ------------------
  |  Branch (280:13): [True: 0, False: 233]
  ------------------
  281|       |		/* afio large ASCII cpio archive */
  282|      0|		cpio->read_header = header_odc;
  283|      0|		bid += 48;
  284|       |		/*
  285|       |		 * XXX TODO:  More verification; Could check that almost hex
  286|       |		 * digits appear in appropriate header locations. XXX
  287|       |		 */
  288|    233|	} else if (memcmp(p, "070701", 6) == 0) {
  ------------------
  |  Branch (288:13): [True: 5, False: 228]
  ------------------
  289|       |		/* ASCII cpio archive (SVR4 without CRC) */
  290|      5|		cpio->read_header = header_newc;
  291|      5|		bid += 48;
  292|       |		/*
  293|       |		 * XXX TODO:  More verification; Could check that only hex
  294|       |		 * digits appear in appropriate header locations. XXX
  295|       |		 */
  296|    228|	} else if (memcmp(p, "070702", 6) == 0) {
  ------------------
  |  Branch (296:13): [True: 0, False: 228]
  ------------------
  297|       |		/* ASCII cpio archive (SVR4 with CRC) */
  298|       |		/* XXX TODO: Flag that we should check the CRC. XXX */
  299|      0|		cpio->read_header = header_newc;
  300|      0|		bid += 48;
  301|       |		/*
  302|       |		 * XXX TODO:  More verification; Could check that only hex
  303|       |		 * digits appear in appropriate header locations. XXX
  304|       |		 */
  305|    228|	} else if (p[0] * 256 + p[1] == 070707) {
  ------------------
  |  Branch (305:13): [True: 2, False: 226]
  ------------------
  306|       |		/* big-endian binary cpio archives */
  307|      2|		cpio->read_header = header_bin_be;
  308|      2|		bid += 16;
  309|       |		/* Is more verification possible here? */
  310|    226|	} else if (p[0] + p[1] * 256 == 070707) {
  ------------------
  |  Branch (310:13): [True: 0, False: 226]
  ------------------
  311|       |		/* little-endian binary cpio archives */
  312|      0|		cpio->read_header = header_bin_le;
  313|      0|		bid += 16;
  314|       |		/* Is more verification possible here? */
  315|      0|	} else
  316|    226|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|    226|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  317|       |
  318|      8|	return (bid);
  319|    234|}
archive_read_support_format_cpio.c:header_odc:
  769|    179|{
  770|    179|	const void *h;
  771|    179|	int r;
  772|    179|	const char *header;
  773|       |
  774|    179|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
  ------------------
  |  |  316|    179|#define	ARCHIVE_FORMAT_CPIO_POSIX		(ARCHIVE_FORMAT_CPIO | 1)
  |  |  ------------------
  |  |  |  |  315|    179|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  775|    179|	a->archive.archive_format_name = "POSIX octet-oriented cpio";
  776|       |
  777|       |	/* Find the start of the next header. */
  778|    179|	r = find_odc_header(a);
  779|    179|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  194|    179|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (779:6): [True: 1, False: 178]
  ------------------
  780|      1|		return (r);
  781|       |
  782|    178|	if (a->archive.archive_format == ARCHIVE_FORMAT_CPIO_AFIO_LARGE) {
  ------------------
  |  |  321|    178|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  315|    178|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (782:6): [True: 0, False: 178]
  ------------------
  783|      0|		int r2 = (header_afiol(a, cpio, entry, namelength, name_pad));
  784|      0|		if (r2 == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (784:7): [True: 0, False: 0]
  ------------------
  785|      0|			return (r);
  786|      0|		else
  787|      0|			return (r2);
  788|      0|	}
  789|       |
  790|       |	/* Read fixed-size portion of header. */
  791|    178|	h = __archive_read_ahead(a, odc_header_size, NULL);
  ------------------
  |  |   92|    178|#define	odc_header_size 76
  ------------------
  792|    178|	if (h == NULL)
  ------------------
  |  Branch (792:6): [True: 0, False: 178]
  ------------------
  793|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  794|       |
  795|       |	/* Parse out octal fields. */
  796|    178|	header = (const char *)h;
  797|       |
  798|    178|	archive_entry_set_dev(entry, 
  799|    178|		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   72|    178|#define	odc_dev_offset 6
  ------------------
              		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   73|    178|#define	odc_dev_size 6
  ------------------
  800|    178|	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   74|    178|#define	odc_ino_offset 12
  ------------------
              	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   75|    178|#define	odc_ino_size 6
  ------------------
  801|    178|	archive_entry_set_mode(entry, 
  802|    178|		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   76|    178|#define	odc_mode_offset 18
  ------------------
              		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   77|    178|#define	odc_mode_size 6
  ------------------
  803|    178|	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   78|    178|#define	odc_uid_offset 24
  ------------------
              	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   79|    178|#define	odc_uid_size 6
  ------------------
  804|    178|	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   80|    178|#define	odc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   81|    178|#define	odc_gid_size 6
  ------------------
  805|    178|	archive_entry_set_nlink(entry, 
  806|    178|		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   82|    178|#define	odc_nlink_offset 36
  ------------------
              		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   83|    178|#define	odc_nlink_size 6
  ------------------
  807|    178|	archive_entry_set_rdev(entry,
  808|    178|		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   84|    178|#define	odc_rdev_offset 42
  ------------------
              		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   85|    178|#define	odc_rdev_size 6
  ------------------
  809|    178|	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   86|    178|#define	odc_mtime_offset 48
  ------------------
              	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   87|    178|#define	odc_mtime_size 11
  ------------------
  810|    178|	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   88|    178|#define	odc_namesize_offset 59
  ------------------
              	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   89|    178|#define	odc_namesize_size 6
  ------------------
  811|    178|	*name_pad = 0; /* No padding of filename. */
  812|       |
  813|       |	/*
  814|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  815|       |	 * therefore guaranteed to be big enough for a 33-bit file
  816|       |	 * size.
  817|       |	 */
  818|    178|	cpio->entry_bytes_remaining =
  819|    178|	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   90|    178|#define	odc_filesize_offset 65
  ------------------
              	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   91|    178|#define	odc_filesize_size 11
  ------------------
  820|    178|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  821|    178|	cpio->entry_padding = 0;
  822|    178|	__archive_read_consume(a, odc_header_size);
  ------------------
  |  |   92|    178|#define	odc_header_size 76
  ------------------
  823|    178|	return (r);
  824|    178|}
archive_read_support_format_cpio.c:find_odc_header:
  702|    179|{
  703|    179|	const void *h;
  704|    179|	const char *p, *q;
  705|    179|	size_t skip, skipped = 0;
  706|    179|	ssize_t bytes;
  707|       |
  708|    180|	for (;;) {
  709|    180|		h = __archive_read_ahead(a, odc_header_size, &bytes);
  ------------------
  |  |   92|    180|#define	odc_header_size 76
  ------------------
  710|    180|		if (h == NULL)
  ------------------
  |  Branch (710:7): [True: 1, False: 179]
  ------------------
  711|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  712|    179|		p = h;
  713|    179|		q = p + bytes;
  714|       |
  715|       |		/* Try the typical case first, then go into the slow search.*/
  716|    179|		if (memcmp("070707", p, 6) == 0 && is_octal(p, odc_header_size))
  ------------------
  |  |   92|     52|#define	odc_header_size 76
  ------------------
  |  Branch (716:7): [True: 52, False: 127]
  |  Branch (716:38): [True: 36, False: 16]
  ------------------
  717|     36|			return (ARCHIVE_OK);
  ------------------
  |  |  192|     36|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  718|    143|		if (memcmp("070727", p, 6) == 0 && is_afio_large(p, bytes)) {
  ------------------
  |  Branch (718:7): [True: 2, False: 141]
  |  Branch (718:38): [True: 0, False: 2]
  ------------------
  719|      0|			a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  321|      0|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  315|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  720|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  721|      0|		}
  722|       |
  723|       |		/*
  724|       |		 * Scan ahead until we find something that looks
  725|       |		 * like an odc header.
  726|       |		 */
  727|  44.6k|		while (p + odc_header_size <= q) {
  ------------------
  |  |   92|  44.6k|#define	odc_header_size 76
  ------------------
  |  Branch (727:10): [True: 44.6k, False: 1]
  ------------------
  728|  44.6k|			switch (p[5]) {
  729|  1.27k|			case '7':
  ------------------
  |  Branch (729:4): [True: 1.27k, False: 43.3k]
  ------------------
  730|  1.27k|				if ((memcmp("070707", p, 6) == 0
  ------------------
  |  Branch (730:10): [True: 350, False: 929]
  ------------------
  731|  1.27k|				    && is_octal(p, odc_header_size))
  ------------------
  |  |   92|    350|#define	odc_header_size 76
  ------------------
  |  Branch (731:12): [True: 142, False: 208]
  ------------------
  732|  1.27k|				    || (memcmp("070727", p, 6) == 0
  ------------------
  |  Branch (732:13): [True: 29, False: 1.10k]
  ------------------
  733|  1.13k|				        && is_afio_large(p, q - p))) {
  ------------------
  |  Branch (733:16): [True: 0, False: 29]
  ------------------
  734|    142|					skip = p - (const char *)h;
  735|    142|					__archive_read_consume(a, skip);
  736|    142|					skipped += skip;
  737|    142|					if (p[4] == '2')
  ------------------
  |  Branch (737:10): [True: 0, False: 142]
  ------------------
  738|      0|						a->archive.archive_format =
  739|      0|						    ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  321|      0|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  315|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  740|    142|					if (skipped > 0) {
  ------------------
  |  Branch (740:10): [True: 142, False: 0]
  ------------------
  741|    142|						archive_set_error(&a->archive,
  742|    142|						    0,
  743|    142|						    "Skipped %d bytes before "
  744|    142|						    "finding valid header",
  745|    142|						    (int)skipped);
  746|    142|						return (ARCHIVE_WARN);
  ------------------
  |  |  194|    142|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  747|    142|					}
  748|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  749|    142|				}
  750|  1.13k|				p += 2;
  751|  1.13k|				break;
  752|  17.8k|			case '0':
  ------------------
  |  Branch (752:4): [True: 17.8k, False: 26.8k]
  ------------------
  753|  17.8k|				p++;
  754|  17.8k|				break;
  755|  25.5k|			default:
  ------------------
  |  Branch (755:4): [True: 25.5k, False: 19.0k]
  ------------------
  756|  25.5k|				p += 6;
  757|  25.5k|				break;
  758|  44.6k|			}
  759|  44.6k|		}
  760|      1|		skip = p - (const char *)h;
  761|      1|		__archive_read_consume(a, skip);
  762|      1|		skipped += skip;
  763|      1|	}
  764|    179|}
archive_read_support_format_cpio.c:is_octal:
  670|    402|{
  671|  20.8k|	while (len-- > 0) {
  ------------------
  |  Branch (671:9): [True: 20.7k, False: 178]
  ------------------
  672|  20.7k|		if (*p < '0' || *p > '7')
  ------------------
  |  Branch (672:7): [True: 166, False: 20.5k]
  |  Branch (672:19): [True: 58, False: 20.4k]
  ------------------
  673|    224|			return (0);
  674|  20.4k|	        ++p;
  675|  20.4k|	}
  676|    178|	return (1);
  677|    402|}
archive_read_support_format_cpio.c:is_afio_large:
  681|     31|{
  682|     31|	if (len < afiol_header_size)
  ------------------
  |  |  161|     31|#define afiol_header_size 116
  ------------------
  |  Branch (682:6): [True: 0, False: 31]
  ------------------
  683|      0|		return (0);
  684|     31|	if (h[afiol_ino_m_offset] != 'm'
  ------------------
  |  |  137|     31|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
  |  Branch (684:6): [True: 31, False: 0]
  ------------------
  685|     31|	    || h[afiol_mtime_n_offset] != 'n'
  ------------------
  |  |  150|      0|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
  |  Branch (685:9): [True: 0, False: 0]
  ------------------
  686|     31|	    || h[afiol_xsize_s_offset] != 's'
  ------------------
  |  |  157|      0|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
  |  Branch (686:9): [True: 0, False: 0]
  ------------------
  687|     31|	    || h[afiol_filesize_c_offset] != ':')
  ------------------
  |  |  160|      0|#define	afiol_filesize_c_offset 115	/* ':' */
  ------------------
  |  Branch (687:9): [True: 0, False: 0]
  ------------------
  688|     31|		return (0);
  689|      0|	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  133|      0|#define	afiol_dev_offset 6
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  137|      0|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  133|      0|#define	afiol_dev_offset 6
  ------------------
  |  Branch (689:6): [True: 0, False: 0]
  ------------------
  690|      0|		return (0);
  691|      0|	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  138|      0|#define	afiol_mode_offset 31
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  150|      0|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  138|      0|#define	afiol_mode_offset 31
  ------------------
  |  Branch (691:6): [True: 0, False: 0]
  ------------------
  692|      0|		return (0);
  693|      0|	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  151|      0|#define	afiol_namesize_offset 86
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  157|      0|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  151|      0|#define	afiol_namesize_offset 86
  ------------------
  |  Branch (693:6): [True: 0, False: 0]
  ------------------
  694|      0|		return (0);
  695|      0|	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  158|      0|#define	afiol_filesize_offset 99
  ------------------
              	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  159|      0|#define	afiol_filesize_size 16	/* hex */
  ------------------
  |  Branch (695:6): [True: 0, False: 0]
  ------------------
  696|      0|		return (0);
  697|      0|	return (1);
  698|      0|}
archive_read_support_format_cpio.c:is_hex:
  519|  5.20k|{
  520|   432k|	while (len-- > 0) {
  ------------------
  |  Branch (520:9): [True: 429k, False: 3.11k]
  ------------------
  521|   429k|		if ((*p >= '0' && *p <= '9')
  ------------------
  |  Branch (521:8): [True: 428k, False: 696]
  |  Branch (521:21): [True: 413k, False: 15.1k]
  ------------------
  522|   429k|		    || (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (522:11): [True: 1.50k, False: 14.3k]
  |  Branch (522:24): [True: 953, False: 553]
  ------------------
  523|   429k|		    || (*p >= 'A' && *p <= 'F'))
  ------------------
  |  Branch (523:11): [True: 14.1k, False: 780]
  |  Branch (523:24): [True: 12.8k, False: 1.30k]
  ------------------
  524|   427k|			++p;
  525|  2.08k|		else
  526|  2.08k|			return (0);
  527|   429k|	}
  528|  3.11k|	return (1);
  529|  5.20k|}
archive_read_support_format_cpio.c:atol16:
 1033|  37.3k|{
 1034|  37.3k|	uint64_t l;
 1035|  37.3k|	int digit;
 1036|       |
 1037|  37.3k|	l = 0;
 1038|   336k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1038:9): [True: 298k, False: 37.3k]
  ------------------
 1039|   298k|		if (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (1039:7): [True: 7, False: 298k]
  |  Branch (1039:20): [True: 7, False: 0]
  ------------------
 1040|      7|			digit = *p - 'a' + 10;
 1041|   298k|		else if (*p >= 'A' && *p <= 'F')
  ------------------
  |  Branch (1041:12): [True: 9.67k, False: 289k]
  |  Branch (1041:25): [True: 9.67k, False: 0]
  ------------------
 1042|  9.67k|			digit = *p - 'A' + 10;
 1043|   289k|		else if (*p >= '0' && *p <= '9')
  ------------------
  |  Branch (1043:12): [True: 289k, False: 0]
  |  Branch (1043:25): [True: 289k, False: 0]
  ------------------
 1044|   289k|			digit = *p - '0';
 1045|      0|		else
 1046|      0|			return ((int64_t)l);
 1047|   298k|		p++;
 1048|   298k|		l <<= 4;
 1049|   298k|		l |= digit;
 1050|   298k|	}
 1051|  37.3k|	return ((int64_t)l);
 1052|  37.3k|}
archive_read_support_format_cpio.c:atol8:
 1014|  1.78k|{
 1015|  1.78k|	uint64_t l;
 1016|  1.78k|	int digit;
 1017|       |
 1018|  1.78k|	l = 0;
 1019|  14.2k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1019:9): [True: 12.4k, False: 1.78k]
  ------------------
 1020|  12.4k|		if (*p >= '0' && *p <= '7')
  ------------------
  |  Branch (1020:7): [True: 12.4k, False: 0]
  |  Branch (1020:20): [True: 12.4k, False: 0]
  ------------------
 1021|  12.4k|			digit = *p - '0';
 1022|      0|		else
 1023|      0|			return ((int64_t)l);
 1024|  12.4k|		p++;
 1025|  12.4k|		l <<= 3;
 1026|  12.4k|		l |= digit;
 1027|  12.4k|	}
 1028|  1.78k|	return ((int64_t)l);
 1029|  1.78k|}
archive_read_support_format_cpio.c:header_newc:
  594|  3.11k|{
  595|  3.11k|	const void *h;
  596|  3.11k|	const char *header;
  597|  3.11k|	int r;
  598|       |
  599|  3.11k|	r = find_newc_header(a);
  600|  3.11k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  194|  3.11k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (600:6): [True: 5, False: 3.11k]
  ------------------
  601|      5|		return (r);
  602|       |
  603|       |	/* Read fixed-size portion of header. */
  604|  3.11k|	h = __archive_read_ahead(a, newc_header_size, NULL);
  ------------------
  |  |  122|  3.11k|#define	newc_header_size 110
  ------------------
  605|  3.11k|	if (h == NULL)
  ------------------
  |  Branch (605:6): [True: 0, False: 3.11k]
  ------------------
  606|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  607|       |
  608|       |	/* Parse out hex fields. */
  609|  3.11k|	header = (const char *)h;
  610|       |
  611|  3.11k|	if (memcmp(header + newc_magic_offset, "070701", 6) == 0) {
  ------------------
  |  |   94|  3.11k|#define	newc_magic_offset 0
  ------------------
  |  Branch (611:6): [True: 1.31k, False: 1.79k]
  ------------------
  612|  1.31k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
  ------------------
  |  |  319|  1.31k|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  315|  1.31k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  613|  1.31k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with no CRC)";
  614|  1.79k|	} else if (memcmp(header + newc_magic_offset, "070702", 6) == 0) {
  ------------------
  |  |   94|  1.79k|#define	newc_magic_offset 0
  ------------------
  |  Branch (614:13): [True: 1.79k, False: 0]
  ------------------
  615|  1.79k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_CRC;
  ------------------
  |  |  320|  1.79k|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  315|  1.79k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  616|  1.79k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with CRC)";
  617|  1.79k|	} else {
  618|       |		/* TODO: Abort here? */
  619|      0|	}
  620|       |
  621|  3.11k|	archive_entry_set_devmajor(entry,
  622|  3.11k|		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  110|  3.11k|#define	newc_devmajor_offset 62
  ------------------
              		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  111|  3.11k|#define	newc_devmajor_size 8
  ------------------
  623|  3.11k|	archive_entry_set_devminor(entry, 
  624|  3.11k|		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  112|  3.11k|#define	newc_devminor_offset 70
  ------------------
              		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  113|  3.11k|#define	newc_devminor_size 8
  ------------------
  625|  3.11k|	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   96|  3.11k|#define	newc_ino_offset 6
  ------------------
              	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   97|  3.11k|#define	newc_ino_size 8
  ------------------
  626|  3.11k|	archive_entry_set_mode(entry, 
  627|  3.11k|		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   98|  3.11k|#define	newc_mode_offset 14
  ------------------
              		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   99|  3.11k|#define	newc_mode_size 8
  ------------------
  628|  3.11k|	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  100|  3.11k|#define	newc_uid_offset 22
  ------------------
              	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  101|  3.11k|#define	newc_uid_size 8
  ------------------
  629|  3.11k|	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  102|  3.11k|#define	newc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  103|  3.11k|#define	newc_gid_size 8
  ------------------
  630|  3.11k|	archive_entry_set_nlink(entry,
  631|  3.11k|		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  104|  3.11k|#define	newc_nlink_offset 38
  ------------------
              		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  105|  3.11k|#define	newc_nlink_size 8
  ------------------
  632|  3.11k|	archive_entry_set_rdevmajor(entry,
  633|  3.11k|		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  114|  3.11k|#define	newc_rdevmajor_offset 78
  ------------------
              		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  115|  3.11k|#define	newc_rdevmajor_size 8
  ------------------
  634|  3.11k|	archive_entry_set_rdevminor(entry,
  635|  3.11k|		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  116|  3.11k|#define	newc_rdevminor_offset 86
  ------------------
              		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  117|  3.11k|#define	newc_rdevminor_size 8
  ------------------
  636|  3.11k|	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  106|  3.11k|#define	newc_mtime_offset 46
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  107|  3.11k|#define	newc_mtime_size 8
  ------------------
  637|  3.11k|	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  118|  3.11k|#define	newc_namesize_offset 94
  ------------------
              	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  119|  3.11k|#define	newc_namesize_size 8
  ------------------
  638|       |	/* Pad name to 2 more than a multiple of 4. */
  639|  3.11k|	*name_pad = (2 - *namelength) & 3;
  640|       |
  641|       |	/* Make sure that the padded name length fits into size_t. */
  642|  3.11k|	if (*name_pad > SIZE_MAX - *namelength) {
  ------------------
  |  Branch (642:6): [True: 0, False: 3.11k]
  ------------------
  643|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  644|      0|		    "cpio archive has invalid namelength");
  645|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  646|      0|	}
  647|       |
  648|       |	/*
  649|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  650|       |	 * therefore guaranteed to be big enough for a 33-bit file
  651|       |	 * size.
  652|       |	 */
  653|  3.11k|	cpio->entry_bytes_remaining =
  654|  3.11k|	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  108|  3.11k|#define	newc_filesize_offset 54
  ------------------
              	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  109|  3.11k|#define	newc_filesize_size 8
  ------------------
  655|  3.11k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  656|       |	/* Pad file contents to a multiple of 4. */
  657|  3.11k|	cpio->entry_padding = 3 & -cpio->entry_bytes_remaining;
  658|  3.11k|	__archive_read_consume(a, newc_header_size);
  ------------------
  |  |  122|  3.11k|#define	newc_header_size 110
  ------------------
  659|  3.11k|	return (r);
  660|  3.11k|}
archive_read_support_format_cpio.c:find_newc_header:
  533|  3.11k|{
  534|  3.11k|	const void *h;
  535|  3.11k|	const char *p, *q;
  536|  3.11k|	size_t skip, skipped = 0;
  537|  3.11k|	ssize_t bytes;
  538|       |
  539|  3.12k|	for (;;) {
  540|  3.12k|		h = __archive_read_ahead(a, newc_header_size, &bytes);
  ------------------
  |  |  122|  3.12k|#define	newc_header_size 110
  ------------------
  541|  3.12k|		if (h == NULL)
  ------------------
  |  Branch (541:7): [True: 5, False: 3.11k]
  ------------------
  542|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  543|  3.11k|		p = h;
  544|  3.11k|		q = p + bytes;
  545|       |
  546|       |		/* Try the typical case first, then go into the slow search.*/
  547|  3.11k|		if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (547:7): [True: 265, False: 2.85k]
  ------------------
  548|  3.11k|		    && (p[5] == '1' || p[5] == '2')
  ------------------
  |  Branch (548:11): [True: 11, False: 254]
  |  Branch (548:26): [True: 254, False: 0]
  ------------------
  549|  3.11k|		    && is_hex(p, newc_header_size))
  ------------------
  |  |  122|    265|#define	newc_header_size 110
  ------------------
  |  Branch (549:10): [True: 5, False: 260]
  ------------------
  550|      5|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  551|       |
  552|       |		/*
  553|       |		 * Scan ahead until we find something that looks
  554|       |		 * like a newc header.
  555|       |		 */
  556|   485k|		while (p + newc_header_size <= q) {
  ------------------
  |  |  122|   485k|#define	newc_header_size 110
  ------------------
  |  Branch (556:10): [True: 485k, False: 5]
  ------------------
  557|   485k|			switch (p[5]) {
  558|  4.55k|			case '1':
  ------------------
  |  Branch (558:4): [True: 4.55k, False: 480k]
  ------------------
  559|  10.1k|			case '2':
  ------------------
  |  Branch (559:4): [True: 5.63k, False: 479k]
  ------------------
  560|  10.1k|				if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (560:9): [True: 4.93k, False: 5.25k]
  ------------------
  561|  10.1k|				    && is_hex(p, newc_header_size)) {
  ------------------
  |  |  122|  4.93k|#define	newc_header_size 110
  ------------------
  |  Branch (561:12): [True: 3.10k, False: 1.82k]
  ------------------
  562|  3.10k|					skip = p - (const char *)h;
  563|  3.10k|					__archive_read_consume(a, skip);
  564|  3.10k|					skipped += skip;
  565|  3.10k|					if (skipped > 0) {
  ------------------
  |  Branch (565:10): [True: 3.10k, False: 0]
  ------------------
  566|  3.10k|						archive_set_error(&a->archive,
  567|  3.10k|						    0,
  568|  3.10k|						    "Skipped %d bytes before "
  569|  3.10k|						    "finding valid header",
  570|  3.10k|						    (int)skipped);
  571|  3.10k|						return (ARCHIVE_WARN);
  ------------------
  |  |  194|  3.10k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  572|  3.10k|					}
  573|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  574|  3.10k|				}
  575|  7.08k|				p += 2;
  576|  7.08k|				break;
  577|   220k|			case '0':
  ------------------
  |  Branch (577:4): [True: 220k, False: 264k]
  ------------------
  578|   220k|				p++;
  579|   220k|				break;
  580|   254k|			default:
  ------------------
  |  Branch (580:4): [True: 254k, False: 230k]
  ------------------
  581|   254k|				p += 6;
  582|   254k|				break;
  583|   485k|			}
  584|   485k|		}
  585|      5|		skip = p - (const char *)h;
  586|      5|		__archive_read_consume(a, skip);
  587|      5|		skipped += skip;
  588|      5|	}
  589|  3.11k|}
archive_read_support_format_cpio.c:header_bin_be:
  933|      4|{
  934|      4|	const void *h;
  935|      4|	const unsigned char *header;
  936|       |
  937|      4|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_BE;
  ------------------
  |  |  318|      4|#define	ARCHIVE_FORMAT_CPIO_BIN_BE		(ARCHIVE_FORMAT_CPIO | 3)
  |  |  ------------------
  |  |  |  |  315|      4|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  938|      4|	a->archive.archive_format_name = "cpio (big-endian binary)";
  939|       |
  940|       |	/* Read fixed-size portion of header. */
  941|      4|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   68|      4|#define	bin_header_size 26
  ------------------
  942|      4|	if (h == NULL) {
  ------------------
  |  Branch (942:6): [True: 0, False: 4]
  ------------------
  943|      0|	    archive_set_error(&a->archive, 0,
  944|      0|		"End of file trying to read next cpio header");
  945|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  946|      0|	}
  947|       |
  948|       |	/* Parse out binary fields. */
  949|      4|	header = (const unsigned char *)h;
  950|       |
  951|      4|	archive_entry_set_dev(entry, header[bin_dev_offset] * 256 + header[bin_dev_offset + 1]);
  ------------------
  |  |   48|      4|#define	bin_dev_offset 2
  ------------------
              	archive_entry_set_dev(entry, header[bin_dev_offset] * 256 + header[bin_dev_offset + 1]);
  ------------------
  |  |   48|      4|#define	bin_dev_offset 2
  ------------------
  952|      4|	archive_entry_set_ino(entry, header[bin_ino_offset] * 256 + header[bin_ino_offset + 1]);
  ------------------
  |  |   50|      4|#define	bin_ino_offset 4
  ------------------
              	archive_entry_set_ino(entry, header[bin_ino_offset] * 256 + header[bin_ino_offset + 1]);
  ------------------
  |  |   50|      4|#define	bin_ino_offset 4
  ------------------
  953|      4|	archive_entry_set_mode(entry, header[bin_mode_offset] * 256 + header[bin_mode_offset + 1]);
  ------------------
  |  |   52|      4|#define	bin_mode_offset 6
  ------------------
              	archive_entry_set_mode(entry, header[bin_mode_offset] * 256 + header[bin_mode_offset + 1]);
  ------------------
  |  |   52|      4|#define	bin_mode_offset 6
  ------------------
  954|      4|	if (cpio->option_pwb) {
  ------------------
  |  Branch (954:6): [True: 0, False: 4]
  ------------------
  955|       |		/* turn off random bits left over from V6 inode */
  956|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  957|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (957:7): [True: 0, False: 0]
  ------------------
  958|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  959|      0|	}
  960|      4|	archive_entry_set_uid(entry, header[bin_uid_offset] * 256 + header[bin_uid_offset + 1]);
  ------------------
  |  |   54|      4|#define	bin_uid_offset 8
  ------------------
              	archive_entry_set_uid(entry, header[bin_uid_offset] * 256 + header[bin_uid_offset + 1]);
  ------------------
  |  |   54|      4|#define	bin_uid_offset 8
  ------------------
  961|      4|	archive_entry_set_gid(entry, header[bin_gid_offset] * 256 + header[bin_gid_offset + 1]);
  ------------------
  |  |   56|      4|#define	bin_gid_offset 10
  ------------------
              	archive_entry_set_gid(entry, header[bin_gid_offset] * 256 + header[bin_gid_offset + 1]);
  ------------------
  |  |   56|      4|#define	bin_gid_offset 10
  ------------------
  962|      4|	archive_entry_set_nlink(entry, header[bin_nlink_offset] * 256 + header[bin_nlink_offset + 1]);
  ------------------
  |  |   58|      4|#define	bin_nlink_offset 12
  ------------------
              	archive_entry_set_nlink(entry, header[bin_nlink_offset] * 256 + header[bin_nlink_offset + 1]);
  ------------------
  |  |   58|      4|#define	bin_nlink_offset 12
  ------------------
  963|      4|	archive_entry_set_rdev(entry, header[bin_rdev_offset] * 256 + header[bin_rdev_offset + 1]);
  ------------------
  |  |   60|      4|#define	bin_rdev_offset 14
  ------------------
              	archive_entry_set_rdev(entry, header[bin_rdev_offset] * 256 + header[bin_rdev_offset + 1]);
  ------------------
  |  |   60|      4|#define	bin_rdev_offset 14
  ------------------
  964|      4|	archive_entry_set_mtime(entry, be4(header + bin_mtime_offset), 0);
  ------------------
  |  |   62|      4|#define	bin_mtime_offset 16
  ------------------
  965|      4|	*namelength = header[bin_namesize_offset] * 256 + header[bin_namesize_offset + 1];
  ------------------
  |  |   64|      4|#define	bin_namesize_offset 20
  ------------------
              	*namelength = header[bin_namesize_offset] * 256 + header[bin_namesize_offset + 1];
  ------------------
  |  |   64|      4|#define	bin_namesize_offset 20
  ------------------
  966|      4|	*name_pad = *namelength & 1; /* Pad to even. */
  967|       |
  968|      4|	cpio->entry_bytes_remaining = be4(header + bin_filesize_offset);
  ------------------
  |  |   66|      4|#define	bin_filesize_offset 22
  ------------------
  969|      4|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  970|      4|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  971|      4|	    __archive_read_consume(a, bin_header_size);
  ------------------
  |  |   68|      4|#define	bin_header_size 26
  ------------------
  972|      4|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  973|      4|}
archive_read_support_format_cpio.c:be4:
 1003|      8|{
 1004|      8|	return ((((int64_t)p[0]) << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]));
 1005|      8|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_header:
  362|  3.30k|{
  363|  3.30k|	struct cpio *cpio;
  364|  3.30k|	const void *h, *hl;
  365|  3.30k|	struct archive_string_conv *sconv;
  366|  3.30k|	size_t namelength;
  367|  3.30k|	size_t name_pad;
  368|  3.30k|	int r;
  369|       |
  370|  3.30k|	cpio = (struct cpio *)(a->format->data);
  371|  3.30k|	sconv = cpio->opt_sconv;
  372|  3.30k|	if (sconv == NULL) {
  ------------------
  |  Branch (372:6): [True: 3.30k, False: 0]
  ------------------
  373|  3.30k|		if (!cpio->init_default_conversion) {
  ------------------
  |  Branch (373:7): [True: 8, False: 3.29k]
  ------------------
  374|      8|			cpio->sconv_default =
  375|      8|			    archive_string_default_conversion_for_read(
  376|      8|			      &(a->archive));
  377|      8|			cpio->init_default_conversion = 1;
  378|      8|		}
  379|  3.30k|		sconv = cpio->sconv_default;
  380|  3.30k|	}
  381|       |	
  382|  3.30k|	r = (cpio->read_header(a, cpio, entry, &namelength, &name_pad));
  383|       |
  384|  3.30k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  194|  3.30k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (384:6): [True: 6, False: 3.29k]
  ------------------
  385|      6|		return (r);
  386|       |
  387|       |	/* Read name from buffer. */
  388|  3.29k|	h = __archive_read_ahead(a, namelength + name_pad, NULL);
  389|  3.29k|	if (h == NULL)
  ------------------
  |  Branch (389:6): [True: 0, False: 3.29k]
  ------------------
  390|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  391|  3.29k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  3.29k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (391:6): [True: 0, False: 3.29k]
  ------------------
  392|  3.29k|	    (const char *)h, namelength, sconv) != 0) {
  393|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (393:7): [True: 0, False: 0]
  ------------------
  394|      0|			archive_set_error(&a->archive, ENOMEM,
  395|      0|			    "Can't allocate memory for Pathname");
  396|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  397|      0|		}
  398|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  399|      0|		    "Pathname can't be converted from %s to current locale.",
  400|      0|		    archive_string_conversion_charset_name(sconv));
  401|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  402|      0|	}
  403|  3.29k|	cpio->entry_offset = 0;
  404|       |
  405|  3.29k|	__archive_read_consume(a, namelength + name_pad);
  406|       |
  407|       |	/* If this is a symlink, read the link contents. */
  408|  3.29k|	if (archive_entry_filetype(entry) == AE_IFLNK) {
  ------------------
  |  |  186|  3.29k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (408:6): [True: 0, False: 3.29k]
  ------------------
  409|      0|		if (cpio->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (409:7): [True: 0, False: 0]
  ------------------
  410|      0|			archive_set_error(&a->archive, ENOMEM,
  411|      0|			    "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
  412|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  413|      0|		}
  414|      0|		hl = __archive_read_ahead(a,
  415|      0|			(size_t)cpio->entry_bytes_remaining, NULL);
  416|      0|		if (hl == NULL)
  ------------------
  |  Branch (416:7): [True: 0, False: 0]
  ------------------
  417|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  418|      0|		if (archive_entry_copy_symlink_l(entry, (const char *)hl,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (418:7): [True: 0, False: 0]
  ------------------
  419|      0|		    (size_t)cpio->entry_bytes_remaining, sconv) != 0) {
  420|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (420:8): [True: 0, False: 0]
  ------------------
  421|      0|				archive_set_error(&a->archive, ENOMEM,
  422|      0|				    "Can't allocate memory for Linkname");
  423|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  424|      0|			}
  425|      0|			archive_set_error(&a->archive,
  426|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  427|      0|			    "Linkname can't be converted from %s to "
  428|      0|			    "current locale.",
  429|      0|			    archive_string_conversion_charset_name(sconv));
  430|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  431|      0|		}
  432|      0|		__archive_read_consume(a, cpio->entry_bytes_remaining);
  433|      0|		cpio->entry_bytes_remaining = 0;
  434|      0|	}
  435|       |
  436|       |	/* XXX TODO: If the full mode is 0160200, then this is a Solaris
  437|       |	 * ACL description for the following entry.  Read this body
  438|       |	 * and parse it as a Solaris-style ACL, then read the next
  439|       |	 * header.  XXX */
  440|       |
  441|       |	/* Compare name to "TRAILER!!!" to test for end-of-archive. */
  442|  3.29k|	if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!",
  ------------------
  |  Branch (442:6): [True: 3.10k, False: 186]
  |  Branch (442:26): [True: 0, False: 3.10k]
  ------------------
  443|  3.10k|	    10) == 0) {
  444|       |		/* TODO: Store file location of start of block. */
  445|      0|		archive_clear_error(&a->archive);
  446|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  447|      0|	}
  448|       |
  449|       |	/* Detect and record hardlinks to previously-extracted entries. */
  450|  3.29k|	if (record_hardlink(a, cpio, entry) != ARCHIVE_OK) {
  ------------------
  |  |  192|  3.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (450:6): [True: 0, False: 3.29k]
  ------------------
  451|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  452|      0|	}
  453|       |
  454|  3.29k|	return (r);
  455|  3.29k|}
archive_read_support_format_cpio.c:record_hardlink:
 1057|  3.29k|{
 1058|  3.29k|	struct links_entry      *le;
 1059|  3.29k|	dev_t dev;
 1060|  3.29k|	int64_t ino;
 1061|       |
 1062|  3.29k|	if (archive_entry_nlink(entry) <= 1)
  ------------------
  |  Branch (1062:6): [True: 1.98k, False: 1.31k]
  ------------------
 1063|  1.98k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1064|       |
 1065|  1.31k|	dev = archive_entry_dev(entry);
 1066|  1.31k|	ino = archive_entry_ino64(entry);
 1067|       |
 1068|       |	/*
 1069|       |	 * First look in the list of multiply-linked files.  If we've
 1070|       |	 * already dumped it, convert this entry to a hard link entry.
 1071|       |	 */
 1072|  1.45k|	for (le = cpio->links_head; le; le = le->next) {
  ------------------
  |  Branch (1072:30): [True: 1.01k, False: 441]
  ------------------
 1073|  1.01k|		if (le->dev == dev && le->ino == ino) {
  ------------------
  |  Branch (1073:7): [True: 872, False: 146]
  |  Branch (1073:25): [True: 872, False: 0]
  ------------------
 1074|    872|			archive_entry_copy_hardlink(entry, le->name);
 1075|       |
 1076|    872|			if (--le->links <= 0) {
  ------------------
  |  Branch (1076:8): [True: 435, False: 437]
  ------------------
 1077|    435|				if (le->previous != NULL)
  ------------------
  |  Branch (1077:9): [True: 1, False: 434]
  ------------------
 1078|      1|					le->previous->next = le->next;
 1079|    435|				if (le->next != NULL)
  ------------------
  |  Branch (1079:9): [True: 141, False: 294]
  ------------------
 1080|    141|					le->next->previous = le->previous;
 1081|    435|				if (cpio->links_head == le)
  ------------------
  |  Branch (1081:9): [True: 434, False: 1]
  ------------------
 1082|    434|					cpio->links_head = le->next;
 1083|    435|				free(le->name);
 1084|    435|				free(le);
 1085|    435|			}
 1086|       |
 1087|    872|			return (ARCHIVE_OK);
  ------------------
  |  |  192|    872|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1088|    872|		}
 1089|  1.01k|	}
 1090|       |
 1091|    441|	le = (struct links_entry *)malloc(sizeof(struct links_entry));
 1092|    441|	if (le == NULL) {
  ------------------
  |  Branch (1092:6): [True: 0, False: 441]
  ------------------
 1093|      0|		archive_set_error(&a->archive,
 1094|      0|		    ENOMEM, "Out of memory adding file to list");
 1095|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1096|      0|	}
 1097|    441|	if (cpio->links_head != NULL)
  ------------------
  |  Branch (1097:6): [True: 143, False: 298]
  ------------------
 1098|    143|		cpio->links_head->previous = le;
 1099|    441|	le->next = cpio->links_head;
 1100|    441|	le->previous = NULL;
 1101|    441|	cpio->links_head = le;
 1102|    441|	le->dev = dev;
 1103|    441|	le->ino = ino;
 1104|    441|	le->links = archive_entry_nlink(entry) - 1;
 1105|    441|	le->name = strdup(archive_entry_pathname(entry));
 1106|    441|	if (le->name == NULL) {
  ------------------
  |  Branch (1106:6): [True: 0, False: 441]
  ------------------
 1107|      0|		archive_set_error(&a->archive,
 1108|      0|		    ENOMEM, "Out of memory adding file to list");
 1109|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1110|      0|	}
 1111|       |
 1112|    441|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    441|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1113|    441|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_data:
  460|  5.95k|{
  461|  5.95k|	ssize_t bytes_read;
  462|  5.95k|	struct cpio *cpio;
  463|       |
  464|  5.95k|	cpio = (struct cpio *)(a->format->data);
  465|       |
  466|  5.95k|	if (cpio->entry_bytes_unconsumed) {
  ------------------
  |  Branch (466:6): [True: 1.33k, False: 4.62k]
  ------------------
  467|  1.33k|		__archive_read_consume(a, cpio->entry_bytes_unconsumed);
  468|  1.33k|		cpio->entry_bytes_unconsumed = 0;
  469|  1.33k|	}
  470|       |
  471|  5.95k|	if (cpio->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (471:6): [True: 1.33k, False: 4.62k]
  ------------------
  472|  1.33k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  473|  1.33k|		if (bytes_read <= 0)
  ------------------
  |  Branch (473:7): [True: 2, False: 1.33k]
  ------------------
  474|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  475|  1.33k|		if (bytes_read > cpio->entry_bytes_remaining)
  ------------------
  |  Branch (475:7): [True: 1.32k, False: 2]
  ------------------
  476|  1.32k|			bytes_read = (ssize_t)cpio->entry_bytes_remaining;
  477|  1.33k|		*size = bytes_read;
  478|  1.33k|		cpio->entry_bytes_unconsumed = bytes_read;
  479|  1.33k|		*offset = cpio->entry_offset;
  480|  1.33k|		cpio->entry_offset += bytes_read;
  481|  1.33k|		cpio->entry_bytes_remaining -= bytes_read;
  482|  1.33k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.33k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  483|  4.62k|	} else {
  484|  4.62k|		if (cpio->entry_padding !=
  ------------------
  |  Branch (484:7): [True: 0, False: 4.62k]
  ------------------
  485|  4.62k|			__archive_read_consume(a, cpio->entry_padding)) {
  486|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  487|      0|		}
  488|  4.62k|		cpio->entry_padding = 0;
  489|  4.62k|		*buff = NULL;
  490|  4.62k|		*size = 0;
  491|  4.62k|		*offset = cpio->entry_offset;
  492|  4.62k|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|  4.62k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  493|  4.62k|	}
  494|  5.95k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_skip:
  498|  3.29k|{
  499|  3.29k|	struct cpio *cpio = (struct cpio *)(a->format->data);
  500|  3.29k|	int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
  501|  3.29k|		cpio->entry_bytes_unconsumed;
  502|       |
  503|  3.29k|	if (to_skip != __archive_read_consume(a, to_skip)) {
  ------------------
  |  Branch (503:6): [True: 0, False: 3.29k]
  ------------------
  504|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  505|      0|	}
  506|  3.29k|	cpio->entry_bytes_remaining = 0;
  507|  3.29k|	cpio->entry_padding = 0;
  508|  3.29k|	cpio->entry_bytes_unconsumed = 0;
  509|  3.29k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  3.29k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_cleanup:
  977|    238|{
  978|    238|	struct cpio *cpio;
  979|       |
  980|    238|	cpio = (struct cpio *)(a->format->data);
  981|       |        /* Free inode->name map */
  982|    244|        while (cpio->links_head != NULL) {
  ------------------
  |  Branch (982:16): [True: 6, False: 238]
  ------------------
  983|      6|                struct links_entry *lp = cpio->links_head->next;
  984|       |
  985|      6|                free(cpio->links_head->name);
  986|      6|                free(cpio->links_head);
  987|      6|                cpio->links_head = lp;
  988|      6|        }
  989|    238|	free(cpio);
  990|    238|	(a->format->data) = NULL;
  991|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  992|    238|}

archive_read_support_format_empty:
   40|    476|{
   41|    476|	struct archive_read *a = (struct archive_read *)_a;
   42|    476|	int r;
   43|       |
   44|    476|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    476|	do { \
  |  |  152|    476|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    476|			(allowed_states), (function_name)); \
  |  |  154|    476|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    476|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 476]
  |  |  ------------------
  |  |  155|    476|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    476|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
   45|    476|	    ARCHIVE_STATE_NEW, "archive_read_support_format_empty");
   46|       |
   47|    476|	r = __archive_read_register_format(a,
   48|    476|	    NULL,
   49|    476|	    "empty",
   50|    476|	    archive_read_format_empty_bid,
   51|    476|	    NULL,
   52|    476|	    archive_read_format_empty_read_header,
   53|    476|	    archive_read_format_empty_read_data,
   54|    476|	    NULL,
   55|    476|	    NULL,
   56|    476|	    NULL,
   57|    476|	    NULL,
   58|    476|	    NULL);
   59|       |
   60|    476|	return (r);
   61|    476|}
archive_read_support_format_empty.c:archive_read_format_empty_bid:
   66|    236|{
   67|    236|	if (best_bid < 1 && __archive_read_ahead(a, 1, NULL) == NULL)
  ------------------
  |  Branch (67:6): [True: 228, False: 8]
  |  Branch (67:22): [True: 2, False: 226]
  ------------------
   68|      2|		return (1);
   69|    234|	return (-1);
   70|    236|}
archive_read_support_format_empty.c:archive_read_format_empty_read_header:
   75|      2|{
   76|      2|	(void)a; /* UNUSED */
   77|      2|	(void)entry; /* UNUSED */
   78|       |
   79|      2|	a->archive.archive_format = ARCHIVE_FORMAT_EMPTY;
  ------------------
  |  |  334|      2|#define	ARCHIVE_FORMAT_EMPTY			0x60000
  ------------------
   80|      2|	a->archive.archive_format_name = "Empty file";
   81|       |
   82|      2|	return (ARCHIVE_EOF);
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
   83|      2|}

archive_read_support_format_iso9660:
  451|    238|{
  452|    238|	struct archive_read *a = (struct archive_read *)_a;
  453|    238|	struct iso9660 *iso9660;
  454|    238|	int r;
  455|       |
  456|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  458|       |
  459|    238|	iso9660 = (struct iso9660 *)calloc(1, sizeof(*iso9660));
  460|    238|	if (iso9660 == NULL) {
  ------------------
  |  Branch (460:6): [True: 0, False: 238]
  ------------------
  461|      0|		archive_set_error(&a->archive, ENOMEM,
  462|      0|		    "Can't allocate iso9660 data");
  463|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  464|      0|	}
  465|    238|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  317|    238|#define ISO9660_MAGIC   0x96609660
  ------------------
  466|    238|	iso9660->cache_files.first = NULL;
  467|    238|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  468|    238|	iso9660->re_files.first = NULL;
  469|    238|	iso9660->re_files.last = &(iso9660->re_files.first);
  470|       |	/* Enable to support Joliet extensions by default.	*/
  471|    238|	iso9660->opt_support_joliet = 1;
  472|       |	/* Enable to support Rock Ridge extensions by default.	*/
  473|    238|	iso9660->opt_support_rockridge = 1;
  474|       |
  475|    238|	r = __archive_read_register_format(a,
  476|    238|	    iso9660,
  477|    238|	    "iso9660",
  478|    238|	    archive_read_format_iso9660_bid,
  479|    238|	    archive_read_format_iso9660_options,
  480|    238|	    archive_read_format_iso9660_read_header,
  481|    238|	    archive_read_format_iso9660_read_data,
  482|    238|	    archive_read_format_iso9660_read_data_skip,
  483|    238|	    NULL,
  484|    238|	    archive_read_format_iso9660_cleanup,
  485|    238|	    NULL,
  486|    238|	    NULL);
  487|       |
  488|    238|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (488:6): [True: 0, False: 238]
  ------------------
  489|      0|		free(iso9660);
  490|      0|		return (r);
  491|      0|	}
  492|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  493|    238|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  498|    236|{
  499|    236|	struct iso9660 *iso9660;
  500|    236|	ssize_t bytes_read;
  501|    236|	const unsigned char *p;
  502|    236|	int seenTerminator;
  503|       |
  504|       |	/* If there's already a better bid than we can ever
  505|       |	   make, don't bother testing. */
  506|    236|	if (best_bid > 48)
  ------------------
  |  Branch (506:6): [True: 11, False: 225]
  ------------------
  507|     11|		return (-1);
  508|       |
  509|    225|	iso9660 = (struct iso9660 *)(a->format->data);
  510|       |
  511|       |	/*
  512|       |	 * Skip the first 32k (reserved area) and get the first
  513|       |	 * 8 sectors of the volume descriptor table.  Of course,
  514|       |	 * if the I/O layer gives us more, we'll take it.
  515|       |	 */
  516|    225|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  517|    225|	p = __archive_read_ahead(a,
  518|    225|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  516|    225|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    225|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    225|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   81|    225|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  519|    225|	    &bytes_read);
  520|    225|	if (p == NULL)
  ------------------
  |  Branch (520:6): [True: 6, False: 219]
  ------------------
  521|      6|	    return (-1);
  522|       |
  523|       |	/* Skip the reserved area. */
  524|    219|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  516|    219|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    219|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    219|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  525|    219|	p += RESERVED_AREA;
  ------------------
  |  |  516|    219|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    219|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    219|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  526|       |
  527|       |	/* Check each volume descriptor. */
  528|    219|	seenTerminator = 0;
  529|    258|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   81|    258|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (529:9): [True: 258, False: 0]
  ------------------
  530|    258|	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   81|     39|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   81|     39|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  531|       |		/* Do not handle undefined Volume Descriptor Type. */
  532|    258|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (532:7): [True: 176, False: 82]
  |  Branch (532:20): [True: 143, False: 33]
  ------------------
  533|    143|			return (0);
  534|       |		/* Standard Identifier must be "CD001" */
  535|    115|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (535:7): [True: 55, False: 60]
  ------------------
  536|     55|			return (0);
  537|     60|		if (isPVD(iso9660, p))
  ------------------
  |  Branch (537:7): [True: 20, False: 40]
  ------------------
  538|     20|			continue;
  539|     40|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (539:7): [True: 40, False: 0]
  ------------------
  540|     40|			if (isJolietSVD(iso9660, p))
  ------------------
  |  Branch (540:8): [True: 0, False: 40]
  ------------------
  541|      0|				continue;
  542|     40|		}
  543|     40|		if (isBootRecord(iso9660, p))
  ------------------
  |  Branch (543:7): [True: 0, False: 40]
  ------------------
  544|      0|			continue;
  545|     40|		if (isEVD(iso9660, p))
  ------------------
  |  Branch (545:7): [True: 0, False: 40]
  ------------------
  546|      0|			continue;
  547|     40|		if (isSVD(iso9660, p))
  ------------------
  |  Branch (547:7): [True: 19, False: 21]
  ------------------
  548|     19|			continue;
  549|     21|		if (isVolumePartition(iso9660, p))
  ------------------
  |  Branch (549:7): [True: 0, False: 21]
  ------------------
  550|      0|			continue;
  551|     21|		if (isVDSetTerminator(iso9660, p)) {
  ------------------
  |  Branch (551:7): [True: 20, False: 1]
  ------------------
  552|     20|			seenTerminator = 1;
  553|     20|			break;
  554|     20|		}
  555|      1|		return (0);
  556|     21|	}
  557|       |	/*
  558|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  559|       |	 * Volume Descriptor Set Terminator.
  560|       |	 */
  561|     20|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (561:6): [True: 20, False: 0]
  |  Branch (561:24): [True: 20, False: 0]
  ------------------
  562|     20|		return (48);
  563|       |
  564|       |	/* We didn't find a valid PVD; return a bid of zero. */
  565|      0|	return (0);
  566|     20|}
archive_read_support_format_iso9660.c:isPVD:
  867|     60|{
  868|     60|	const unsigned char *p;
  869|     60|	ssize_t logical_block_size;
  870|     60|	int32_t volume_block;
  871|     60|	int32_t location;
  872|     60|	int i;
  873|       |
  874|       |	/* Type of the Primary Volume Descriptor must be 1. */
  875|     60|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   85|     60|#define PVD_type_offset 0
  ------------------
  |  Branch (875:6): [True: 39, False: 21]
  ------------------
  876|     39|		return (0);
  877|       |
  878|       |	/* PVD version must be 1. */
  879|     21|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (879:6): [True: 0, False: 21]
  ------------------
  880|      0|		return (0);
  881|       |
  882|       |	/* Reserved field must be 0. */
  883|     21|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (883:6): [True: 0, False: 21]
  ------------------
  884|      0|		return (0);
  885|       |
  886|       |	/* Reserved field must be 0. */
  887|     21|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|     21|#define PVD_reserved2_size 8
  ------------------
  |  Branch (887:6): [True: 0, False: 21]
  ------------------
  888|      0|		return (0);
  889|       |
  890|       |	/* Volume space size must be encoded according to 7.3.3 */
  891|     21|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (891:6): [True: 0, False: 21]
  ------------------
  892|      0|		return (0);
  893|      0|	}
  894|     21|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  895|     21|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|     21|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (895:6): [True: 0, False: 21]
  ------------------
  896|      0|		return (0);
  897|       |
  898|       |	/* Reserved field must be 0. */
  899|     21|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|     21|#define PVD_reserved3_size 32
  ------------------
  |  Branch (899:6): [True: 0, False: 21]
  ------------------
  900|      0|		return (0);
  901|       |
  902|       |	/* Volume set size must be encoded according to 7.2.3 */
  903|     21|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (903:6): [True: 0, False: 21]
  ------------------
  904|      0|		return (0);
  905|      0|	}
  906|       |
  907|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  908|     21|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (908:6): [True: 0, False: 21]
  ------------------
  909|      0|		return (0);
  910|      0|	}
  911|       |
  912|       |	/* Logical block size must be > 0. */
  913|       |	/* I've looked at Ecma 119 and can't find any stronger
  914|       |	 * restriction on this field. */
  915|     21|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (915:6): [True: 0, False: 21]
  ------------------
  916|      0|		return (0);
  917|      0|	}
  918|     21|	logical_block_size =
  919|     21|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  920|     21|	if (logical_block_size <= 0)
  ------------------
  |  Branch (920:6): [True: 0, False: 21]
  ------------------
  921|      0|		return (0);
  922|       |
  923|       |	/* Path Table size must be encoded according to 7.3.3 */
  924|     21|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (924:6): [True: 0, False: 21]
  ------------------
  925|      0|		return (0);
  926|      0|	}
  927|       |
  928|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  929|     21|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  143|     21|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  141|     21|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|     21|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  137|     21|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  135|     21|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  133|     21|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     21|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     21|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     21|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     21|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     21|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     21|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     21|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     21|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     21|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     21|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     21|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     21|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     21|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     21|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     21|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     21|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     21|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|     21|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     21|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|     21|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|     21|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|     21|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (929:6): [True: 0, False: 21]
  ------------------
  930|      0|		return (0);
  931|       |
  932|       |	/* Location of Occurrence of Type L Path Table must be
  933|       |	 * available location,
  934|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  935|     21|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|     21|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  936|     21|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|     21|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (936:6): [True: 0, False: 21]
  |  Branch (936:40): [True: 0, False: 21]
  ------------------
  937|      0|		return (0);
  938|       |
  939|       |	/* The Type M Path Table must also be at a valid location
  940|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  941|       |	 * probably other programs omit it, so we permit a zero here)
  942|       |	 *
  943|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  944|     21|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  115|     21|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  113|     21|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|     21|#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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|     21|#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)
  |  |  ------------------
  |  |  |  |  114|     21|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  945|     21|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|     21|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (945:7): [True: 21, False: 0]
  |  Branch (945:23): [True: 0, False: 21]
  ------------------
  946|     21|	    || location >= volume_block)
  ------------------
  |  Branch (946:9): [True: 0, False: 21]
  ------------------
  947|      0|		return (0);
  948|       |
  949|       |	/* Reserved field must be 0. */
  950|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  951|     42|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  146|     42|#define PVD_reserved4_size 1
  ------------------
  |  Branch (951:14): [True: 21, False: 21]
  ------------------
  952|     21|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  145|     21|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|     21|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|     21|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|     21|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|     21|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|     21|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     21|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     21|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     21|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     21|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     21|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     21|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     21|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     21|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     21|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     21|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     21|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     21|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     21|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     21|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     21|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     21|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     21|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     21|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     21|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     21|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     21|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     21|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     21|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     21|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (952:7): [True: 0, False: 21]
  ------------------
  953|     21|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (953:10): [True: 0, False: 0]
  ------------------
  954|      0|			return (0);
  955|       |
  956|       |	/* Reserved field must be 0. */
  957|     21|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  149|     21|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  147|     21|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|     21|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|     21|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  141|     21|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  139|     21|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     21|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     21|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     21|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     21|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     21|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     21|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     21|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     21|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     21|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     21|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     21|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     21|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     21|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     21|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     21|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     21|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     21|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     21|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     21|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     21|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     21|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     21|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     21|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|     21|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|     21|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|     21|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|     21|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|     21|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|     21|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  149|     21|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|     21|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|     21|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|     21|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|     21|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|     21|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     21|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     21|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     21|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     21|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     21|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     21|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     21|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     21|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     21|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     21|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     21|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     21|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     21|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     21|#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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     21|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     21|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     21|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     21|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     21|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     21|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     21|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     21|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     21|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     21|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|     21|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|     21|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|     21|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|     21|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|     21|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (957:6): [True: 1, False: 20]
  ------------------
  958|      1|		return (0);
  959|       |
  960|       |	/* XXX TODO: Check other values for sanity; reject more
  961|       |	 * malformed PVDs. XXX */
  962|       |
  963|       |	/* Read Root Directory Record in Volume Descriptor. */
  964|     20|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  119|     20|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  117|     20|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|     20|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|     20|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|     20|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  109|     20|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     20|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     20|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     20|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     20|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     20|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     20|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     20|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     20|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     20|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     20|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     20|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|     20|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     20|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     20|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     20|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     20|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     20|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     20|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     20|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     20|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     20|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     20|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     20|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     20|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|     20|#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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|     20|#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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|     20|#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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|     20|#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)
  |  |  ------------------
  |  |  |  |  118|     20|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  965|     20|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (965:6): [True: 0, False: 20]
  ------------------
  966|      0|		return (0);
  967|      0|	}
  968|       |
  969|     20|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (969:6): [True: 20, False: 0]
  ------------------
  970|     20|		iso9660->logical_block_size = logical_block_size;
  971|     20|		iso9660->volume_block = volume_block;
  972|     20|		iso9660->volume_size =
  973|     20|		    logical_block_size * (uint64_t)volume_block;
  974|     20|		iso9660->primary.location =
  975|     20|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  199|     20|#define DR_extent_offset 2
  ------------------
  976|     20|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  201|     20|#define DR_size_offset 10
  ------------------
  977|     20|	}
  978|       |
  979|     20|	return (48);
  980|     20|}
archive_read_support_format_iso9660.c:isNull:
  601|    197|{
  602|       |
  603|    197|	while (bytes >= sizeof(iso9660->null)) {
  ------------------
  |  Branch (603:9): [True: 0, False: 197]
  ------------------
  604|      0|		if (!memcmp(iso9660->null, h + offset, sizeof(iso9660->null)))
  ------------------
  |  Branch (604:7): [True: 0, False: 0]
  ------------------
  605|      0|			return (0);
  606|      0|		offset += sizeof(iso9660->null);
  607|      0|		bytes -= sizeof(iso9660->null);
  608|      0|	}
  609|    197|	if (bytes)
  ------------------
  |  Branch (609:6): [True: 197, False: 0]
  ------------------
  610|    197|		return memcmp(iso9660->null, h + offset, bytes) == 0;
  611|      0|	else
  612|      0|		return (1);
  613|    197|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3222|    158|{
 3223|    158|	return (p[0] == p[7]
  ------------------
  |  Branch (3223:10): [True: 158, False: 0]
  ------------------
 3224|    158|		&& p[1] == p[6]
  ------------------
  |  Branch (3224:6): [True: 158, False: 0]
  ------------------
 3225|    158|		&& p[2] == p[5]
  ------------------
  |  Branch (3225:6): [True: 158, False: 0]
  ------------------
 3226|    158|		&& p[3] == p[4]);
  ------------------
  |  Branch (3226:6): [True: 158, False: 0]
  ------------------
 3227|    158|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3216|    121|isValid723Integer(const unsigned char *p) {
 3217|    121|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3217:10): [True: 121, False: 0]
  |  Branch (3217:26): [True: 121, False: 0]
  ------------------
 3218|    121|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  983|     58|isRootDirectoryRecord(const unsigned char *p) {
  984|     58|	int flags;
  985|       |
  986|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  987|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  988|     58|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  195|     58|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  195|     58|#define DR_length_offset 0
  ------------------
  |  Branch (988:6): [True: 0, False: 58]
  |  Branch (988:34): [True: 0, False: 58]
  ------------------
  989|      0|		return (0);
  990|      0|	}
  991|       |
  992|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  993|     58|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  199|     58|#define DR_extent_offset 2
  ------------------
  |  Branch (993:6): [True: 0, False: 58]
  ------------------
  994|      0|		return (0);
  995|      0|	}
  996|       |
  997|       |	/* The root directory size must be a 7.3.3 integer. */
  998|     58|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  201|     58|#define DR_size_offset 10
  ------------------
  |  Branch (998:6): [True: 0, False: 58]
  ------------------
  999|      0|		return (0);
 1000|      0|	}
 1001|       |
 1002|       |	/* According to the standard, certain bits must be one or zero:
 1003|       |	 * Bit 1: must be 1 (this is a directory)
 1004|       |	 * Bit 2: must be 0 (not an associated file)
 1005|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
 1006|       |	 * Bit 7: must be 0 (final directory record for this file)
 1007|       |	 */
 1008|     58|	flags = p[DR_flags_offset];
  ------------------
  |  |  205|     58|#define DR_flags_offset 25
  ------------------
 1009|     58|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1009:6): [True: 0, False: 58]
  ------------------
 1010|      0|		return (0);
 1011|      0|	}
 1012|       |
 1013|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1014|     58|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  211|     58|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1014:6): [True: 0, False: 58]
  ------------------
 1015|      0|		return (0);
 1016|      0|	}
 1017|       |
 1018|       |	/* Root directory name is a single zero byte... */
 1019|     58|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  213|     58|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  215|     58|#define DR_name_offset 33
  ------------------
  |  Branch (1019:6): [True: 0, False: 58]
  |  Branch (1019:36): [True: 0, False: 58]
  ------------------
 1020|      0|		return (0);
 1021|      0|	}
 1022|       |
 1023|       |	/* Nothing looked wrong, so let's accept it. */
 1024|     58|	return (1);
 1025|     58|}
archive_read_support_format_iso9660.c:isJolietSVD:
  679|     40|{
  680|     40|	const unsigned char *p;
  681|     40|	ssize_t logical_block_size;
  682|     40|	int32_t volume_block;
  683|       |
  684|       |	/* Check if current sector is a kind of Supplementary Volume
  685|       |	 * Descriptor. */
  686|     40|	if (!isSVD(iso9660, h))
  ------------------
  |  Branch (686:6): [True: 21, False: 19]
  ------------------
  687|     21|		return (0);
  688|       |
  689|       |	/* FIXME: do more validations according to joliet spec. */
  690|       |
  691|       |	/* check if this SVD contains joliet extension! */
  692|     19|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  172|     19|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  170|     19|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|     19|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  693|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  694|     19|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (694:6): [True: 19, False: 0]
  |  Branch (694:21): [True: 10, False: 9]
  ------------------
  695|     10|		int level = 0;
  696|       |
  697|     10|		if (p[2] == '@')
  ------------------
  |  Branch (697:7): [True: 0, False: 10]
  ------------------
  698|      0|			level = 1;
  699|     10|		else if (p[2] == 'C')
  ------------------
  |  Branch (699:12): [True: 0, False: 10]
  ------------------
  700|      0|			level = 2;
  701|     10|		else if (p[2] == 'E')
  ------------------
  |  Branch (701:12): [True: 0, False: 10]
  ------------------
  702|      0|			level = 3;
  703|     10|		else /* not joliet */
  704|     10|			return (0);
  705|       |
  706|      0|		iso9660->seenJoliet = level;
  707|       |
  708|      0|	} else /* not joliet */
  709|      9|		return (0);
  710|       |
  711|      0|	logical_block_size =
  712|      0|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  175|      0|#define SVD_logical_block_size_offset 128
  ------------------
  713|      0|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  170|      0|#define SVD_volume_space_size_offset 80
  ------------------
  714|       |
  715|      0|	iso9660->logical_block_size = logical_block_size;
  716|      0|	iso9660->volume_block = volume_block;
  717|      0|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  718|       |	/* Read Root Directory Record in Volume Descriptor. */
  719|      0|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  180|      0|#define SVD_root_directory_record_offset 156
  ------------------
  720|      0|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  199|      0|#define DR_extent_offset 2
  ------------------
  721|      0|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  201|      0|#define DR_size_offset 10
  ------------------
  722|       |
  723|      0|	return (48);
  724|     19|}
archive_read_support_format_iso9660.c:isBootRecord:
  617|     40|{
  618|     40|	(void)iso9660; /* UNUSED */
  619|       |
  620|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  621|     40|	if (h[0] != 0)
  ------------------
  |  Branch (621:6): [True: 40, False: 0]
  ------------------
  622|     40|		return (0);
  623|       |
  624|       |	/* Volume Descriptor Version must be 1. */
  625|      0|	if (h[6] != 1)
  ------------------
  |  Branch (625:6): [True: 0, False: 0]
  ------------------
  626|      0|		return (0);
  627|       |
  628|      0|	return (1);
  629|      0|}
archive_read_support_format_iso9660.c:isEVD:
  788|     40|{
  789|     40|	const unsigned char *p;
  790|     40|	ssize_t logical_block_size;
  791|     40|	int32_t volume_block;
  792|     40|	int32_t location;
  793|       |
  794|     40|	(void)iso9660; /* UNUSED */
  795|       |
  796|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  797|     40|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   85|     40|#define PVD_type_offset 0
  ------------------
  |  Branch (797:6): [True: 21, False: 19]
  ------------------
  798|     21|		return (0);
  799|       |
  800|       |	/* EVD version must be 2. */
  801|     19|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   89|     19|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   87|     19|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|     19|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     19|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     19|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (801:6): [True: 19, False: 0]
  ------------------
  802|     19|		return (0);
  803|       |
  804|       |	/* Reserved field must be 0. */
  805|      0|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (805:6): [True: 0, False: 0]
  ------------------
  806|      0|		return (0);
  807|       |
  808|       |	/* Reserved field must be 0. */
  809|      0|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|      0|#define PVD_reserved2_size 8
  ------------------
  |  Branch (809:6): [True: 0, False: 0]
  ------------------
  810|      0|		return (0);
  811|       |
  812|       |	/* Reserved field must be 0. */
  813|      0|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|      0|#define PVD_reserved3_size 32
  ------------------
  |  Branch (813:6): [True: 0, False: 0]
  ------------------
  814|      0|		return (0);
  815|       |
  816|       |	/* Logical block size must be > 0. */
  817|       |	/* I've looked at Ecma 119 and can't find any stronger
  818|       |	 * restriction on this field. */
  819|      0|	logical_block_size =
  820|      0|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  821|      0|	if (logical_block_size <= 0)
  ------------------
  |  Branch (821:6): [True: 0, False: 0]
  ------------------
  822|      0|		return (0);
  823|       |
  824|      0|	volume_block =
  825|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  826|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (826:6): [True: 0, False: 0]
  ------------------
  827|      0|		return (0);
  828|       |
  829|       |	/* File structure version must be 2 for ISO9660:1999. */
  830|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (830:6): [True: 0, False: 0]
  ------------------
  831|      0|		return (0);
  832|       |
  833|       |	/* Location of Occurrence of Type L Path Table must be
  834|       |	 * available location,
  835|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  836|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      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)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  837|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (837:6): [True: 0, False: 0]
  |  Branch (837:40): [True: 0, False: 0]
  ------------------
  838|      0|		return (0);
  839|       |
  840|       |	/* Location of Occurrence of Type M Path Table must be
  841|       |	 * available location,
  842|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  843|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      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)
  |  |  ------------------
  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  844|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (844:7): [True: 0, False: 0]
  |  Branch (844:23): [True: 0, False: 0]
  ------------------
  845|      0|	    || location >= volume_block)
  ------------------
  |  Branch (845:9): [True: 0, False: 0]
  ------------------
  846|      0|		return (0);
  847|       |
  848|       |	/* Reserved field must be 0. */
  849|      0|	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (849:6): [True: 0, False: 0]
  ------------------
  850|      0|		return (0);
  851|       |
  852|       |	/* Reserved field must be 0. */
  853|      0|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  149|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  147|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (853:6): [True: 0, False: 0]
  ------------------
  854|      0|		return (0);
  855|       |
  856|       |	/* Read Root Directory Record in Volume Descriptor. */
  857|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  119|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  117|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   85|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      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)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      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)
  |  |  ------------------
  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  858|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (858:6): [True: 0, False: 0]
  ------------------
  859|      0|		return (0);
  860|      0|	}
  861|       |
  862|      0|	return (48);
  863|      0|}
archive_read_support_format_iso9660.c:isSVD:
  728|     80|{
  729|     80|	const unsigned char *p;
  730|     80|	ssize_t logical_block_size;
  731|     80|	int32_t volume_block;
  732|     80|	int32_t location;
  733|       |
  734|     80|	(void)iso9660; /* UNUSED */
  735|       |
  736|       |	/* Type 2 means it's a SVD. */
  737|     80|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  161|     80|#define SVD_type_offset 0
  ------------------
  |  Branch (737:6): [True: 42, False: 38]
  ------------------
  738|     42|		return (0);
  739|       |
  740|       |	/* Reserved field must be 0. */
  741|     38|	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  168|     38|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|     38|#define SVD_reserved1_size	8
  ------------------
  |  Branch (741:6): [True: 0, False: 38]
  ------------------
  742|      0|		return (0);
  743|     38|	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  183|     38|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|     38|#define SVD_reserved2_size	1
  ------------------
  |  Branch (743:6): [True: 0, False: 38]
  ------------------
  744|      0|		return (0);
  745|     38|	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  185|     38|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|     38|#define SVD_reserved3_size	653
  ------------------
  |  Branch (745:6): [True: 0, False: 38]
  ------------------
  746|      0|		return (0);
  747|       |
  748|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  749|     38|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  182|     38|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (749:6): [True: 0, False: 38]
  ------------------
  750|      0|		return (0);
  751|       |
  752|     38|	logical_block_size =
  753|     38|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  175|     38|#define SVD_logical_block_size_offset 128
  ------------------
  754|     38|	if (logical_block_size <= 0)
  ------------------
  |  Branch (754:6): [True: 0, False: 38]
  ------------------
  755|      0|		return (0);
  756|       |
  757|     38|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  170|     38|#define SVD_volume_space_size_offset 80
  ------------------
  758|     38|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   82|     38|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (758:6): [True: 0, False: 38]
  ------------------
  759|      0|		return (0);
  760|       |
  761|       |	/* Location of Occurrence of Type L Path Table must be
  762|       |	 * available location,
  763|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  764|     38|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  177|     38|#define SVD_type_L_path_table_offset 140
  ------------------
  765|     38|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   82|     38|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (765:6): [True: 0, False: 38]
  |  Branch (765:40): [True: 0, False: 38]
  ------------------
  766|      0|		return (0);
  767|       |
  768|       |	/* The Type M Path Table must be at a valid location (WinISO
  769|       |	 * and probably other programs omit this, so we allow zero)
  770|       |	 *
  771|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  772|     38|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  178|     38|#define SVD_type_M_path_table_offset 148
  ------------------
  773|     38|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   82|     38|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (773:7): [True: 38, False: 0]
  |  Branch (773:23): [True: 0, False: 38]
  ------------------
  774|     38|	    || location >= volume_block)
  ------------------
  |  Branch (774:9): [True: 0, False: 38]
  ------------------
  775|      0|		return (0);
  776|       |
  777|       |	/* Read Root Directory Record in Volume Descriptor. */
  778|     38|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  180|     38|#define SVD_root_directory_record_offset 156
  ------------------
  779|     38|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (779:6): [True: 0, False: 38]
  ------------------
  780|      0|		return (0);
  781|      0|	}
  782|       |
  783|     38|	return (48);
  784|     38|}
archive_read_support_format_iso9660.c:isVolumePartition:
  633|     21|{
  634|     21|	int32_t location;
  635|       |
  636|       |	/* Type of the Volume Partition Descriptor must be 3. */
  637|     21|	if (h[0] != 3)
  ------------------
  |  Branch (637:6): [True: 21, False: 0]
  ------------------
  638|     21|		return (0);
  639|       |
  640|       |	/* Volume Descriptor Version must be 1. */
  641|      0|	if (h[6] != 1)
  ------------------
  |  Branch (641:6): [True: 0, False: 0]
  ------------------
  642|      0|		return (0);
  643|       |	/* Unused Field */
  644|      0|	if (h[7] != 0)
  ------------------
  |  Branch (644:6): [True: 0, False: 0]
  ------------------
  645|      0|		return (0);
  646|       |
  647|      0|	location = archive_le32dec(h + 72);
  648|      0|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   82|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (648:6): [True: 0, False: 0]
  ------------------
  649|      0|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (649:6): [True: 0, False: 0]
  ------------------
  650|      0|		return (0);
  651|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (651:6): [True: 0, False: 0]
  ------------------
  652|      0|		return (0);
  653|       |
  654|      0|	return (1);
  655|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  659|     21|{
  660|     21|	(void)iso9660; /* UNUSED */
  661|       |
  662|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  663|     21|	if (h[0] != 255)
  ------------------
  |  Branch (663:6): [True: 1, False: 20]
  ------------------
  664|      1|		return (0);
  665|       |
  666|       |	/* Volume Descriptor Version must be 1. */
  667|     20|	if (h[6] != 1)
  ------------------
  |  Branch (667:6): [True: 0, False: 20]
  ------------------
  668|      0|		return (0);
  669|       |
  670|       |	/* Reserved field must be 0. */
  671|     20|	if (!isNull(iso9660, h, 7, 2048-7))
  ------------------
  |  Branch (671:6): [True: 0, False: 20]
  ------------------
  672|      0|		return (0);
  673|       |
  674|     20|	return (1);
  675|     20|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1242|    101|{
 1243|    101|	struct iso9660 *iso9660;
 1244|    101|	struct file_info *file;
 1245|    101|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  192|    101|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1246|       |
 1247|    101|	iso9660 = (struct iso9660 *)(a->format->data);
 1248|       |
 1249|    101|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1249:6): [True: 20, False: 81]
  ------------------
 1250|     20|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  331|     20|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1251|     20|		a->archive.archive_format_name = "ISO9660";
 1252|     20|	}
 1253|       |
 1254|    101|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1254:6): [True: 20, False: 81]
  ------------------
 1255|     20|		r = choose_volume(a, iso9660);
 1256|     20|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1256:7): [True: 0, False: 20]
  ------------------
 1257|      0|			return (r);
 1258|     20|	}
 1259|       |
 1260|    101|	file = NULL;/* Eliminate a warning. */
 1261|       |	/* Get the next entry that appears after the current offset. */
 1262|    101|	r = next_entry_seek(a, iso9660, &file);
 1263|    101|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    101|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1263:6): [True: 23, False: 78]
  ------------------
 1264|     23|		return (r);
 1265|       |
 1266|     78|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1266:6): [True: 0, False: 78]
  ------------------
 1267|       |		/*
 1268|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1269|       |		 * and store the result into a filename field.
 1270|       |		 */
 1271|      0|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1271:7): [True: 0, False: 0]
  ------------------
 1272|      0|			iso9660->sconv_utf16be =
 1273|      0|			    archive_string_conversion_from_charset(
 1274|      0|				&(a->archive), "UTF-16BE", 1);
 1275|      0|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1275:8): [True: 0, False: 0]
  ------------------
 1276|       |				/* Couldn't allocate memory */
 1277|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1278|      0|		}
 1279|      0|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1279:7): [True: 0, False: 0]
  ------------------
 1280|      0|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  371|      0|#define UTF16_NAME_MAX	1024
  ------------------
 1281|      0|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1281:8): [True: 0, False: 0]
  ------------------
 1282|      0|				archive_set_error(&a->archive, ENOMEM,
 1283|      0|				    "No memory");
 1284|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1285|      0|			}
 1286|      0|		}
 1287|      0|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1287:7): [True: 0, False: 0]
  ------------------
 1288|      0|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  371|      0|#define UTF16_NAME_MAX	1024
  ------------------
 1289|      0|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1289:8): [True: 0, False: 0]
  ------------------
 1290|      0|				archive_set_error(&a->archive, ENOMEM,
 1291|      0|				    "No memory");
 1292|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1293|      0|			}
 1294|      0|		}
 1295|       |
 1296|      0|		iso9660->utf16be_path_len = 0;
 1297|      0|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1297:7): [True: 0, False: 0]
  ------------------
 1298|      0|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  371|      0|#define UTF16_NAME_MAX	1024
  ------------------
 1299|      0|			archive_set_error(&a->archive,
 1300|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1301|      0|			    "Pathname is too long");
 1302|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1303|      0|		}
 1304|       |
 1305|      0|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|      0|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
 1306|      0|		    (const char *)iso9660->utf16be_path,
 1307|      0|		    iso9660->utf16be_path_len,
 1308|      0|		    iso9660->sconv_utf16be);
 1309|      0|		if (r != 0) {
  ------------------
  |  Branch (1309:7): [True: 0, False: 0]
  ------------------
 1310|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1310:8): [True: 0, False: 0]
  ------------------
 1311|      0|				archive_set_error(&a->archive, ENOMEM,
 1312|      0|				    "No memory for Pathname");
 1313|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1314|      0|			}
 1315|      0|			archive_set_error(&a->archive,
 1316|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1317|      0|			    "Pathname cannot be converted "
 1318|      0|			    "from %s to current locale.",
 1319|      0|			    archive_string_conversion_charset_name(
 1320|      0|			      iso9660->sconv_utf16be));
 1321|       |
 1322|      0|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1323|      0|		}
 1324|     78|	} else {
 1325|     78|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1326|     78|		if (path == NULL) {
  ------------------
  |  Branch (1326:7): [True: 0, False: 78]
  ------------------
 1327|      0|			archive_set_error(&a->archive,
 1328|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1329|      0|			    "Pathname is too long");
 1330|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1331|     78|		} else {
 1332|     78|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|     78|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1333|     78|			archive_entry_set_pathname(entry, path);
 1334|     78|		}
 1335|     78|	}
 1336|       |
 1337|     78|	iso9660->entry_bytes_remaining = file->size;
 1338|       |	/* Offset for sparse-file-aware clients. */
 1339|     78|	iso9660->entry_sparse_offset = 0;
 1340|       |
 1341|     78|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1341:6): [True: 0, False: 78]
  ------------------
 1342|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1343|      0|		    "File is beyond end-of-media: %s",
 1344|      0|		    archive_entry_pathname(entry));
 1345|      0|		iso9660->entry_bytes_remaining = 0;
 1346|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1347|      0|	}
 1348|       |
 1349|       |	/* Set up the entry structure with information about this entry. */
 1350|     78|	archive_entry_set_mode(entry, file->mode);
 1351|     78|	archive_entry_set_uid(entry, file->uid);
 1352|     78|	archive_entry_set_gid(entry, file->gid);
 1353|     78|	archive_entry_set_nlink(entry, file->nlinks);
 1354|     78|	if (file->birthtime_is_set)
  ------------------
  |  Branch (1354:6): [True: 0, False: 78]
  ------------------
 1355|      0|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1356|     78|	else
 1357|     78|		archive_entry_unset_birthtime(entry);
 1358|     78|	archive_entry_set_mtime(entry, file->mtime, 0);
 1359|     78|	archive_entry_set_ctime(entry, file->ctime, 0);
 1360|     78|	archive_entry_set_atime(entry, file->atime, 0);
 1361|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1362|     78|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1363|     78|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1364|     78|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1364:6): [True: 0, False: 78]
  ------------------
 1365|      0|		archive_entry_copy_symlink(entry, file->symlink.s);
 1366|       |
 1367|       |	/* Note: If the input isn't seekable, we can't rewind to
 1368|       |	 * return the same body again, so if the next entry refers to
 1369|       |	 * the same data, we have to return it as a hardlink to the
 1370|       |	 * original entry. */
 1371|     78|	if (file->number != -1 &&
  ------------------
  |  Branch (1371:6): [True: 67, False: 11]
  ------------------
 1372|     78|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1372:6): [True: 5, False: 62]
  ------------------
 1373|      5|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1373:7): [True: 0, False: 5]
  ------------------
 1374|      0|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      0|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
 1375|      0|			    (const char *)iso9660->utf16be_previous_path,
 1376|      0|			    iso9660->utf16be_previous_path_len,
 1377|      0|			    iso9660->sconv_utf16be);
 1378|      0|			if (r != 0) {
  ------------------
  |  Branch (1378:8): [True: 0, False: 0]
  ------------------
 1379|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1379:9): [True: 0, False: 0]
  ------------------
 1380|      0|					archive_set_error(&a->archive, ENOMEM,
 1381|      0|					    "No memory for Linkname");
 1382|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1383|      0|				}
 1384|      0|				archive_set_error(&a->archive,
 1385|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1386|      0|				    "Linkname cannot be converted "
 1387|      0|				    "from %s to current locale.",
 1388|      0|				    archive_string_conversion_charset_name(
 1389|      0|				      iso9660->sconv_utf16be));
 1390|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1391|      0|			}
 1392|      0|		} else
 1393|      5|			archive_entry_set_hardlink(entry,
 1394|      5|			    iso9660->previous_pathname.s);
 1395|      5|		archive_entry_unset_size(entry);
 1396|      5|		iso9660->entry_bytes_remaining = 0;
 1397|      5|		return (rd_r);
 1398|      5|	}
 1399|       |
 1400|     73|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  184|     73|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  190|    146|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1400:6): [True: 37, False: 36]
  ------------------
 1401|     73|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1401:6): [True: 8, False: 29]
  ------------------
 1402|      8|		int64_t r64;
 1403|       |
 1404|      8|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1405|      8|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1405:7): [True: 0, False: 8]
  ------------------
 1406|       |			/* We can't seek backwards to extract it, so issue
 1407|       |			 * a warning.  Note that this can only happen if
 1408|       |			 * this entry was added to the heap after we passed
 1409|       |			 * this offset, that is, only if the directory
 1410|       |			 * mentioning this entry is later than the body of
 1411|       |			 * the entry. Such layouts are very unusual; most
 1412|       |			 * ISO9660 writers lay out and record all directory
 1413|       |			 * information first, then store all file bodies. */
 1414|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1415|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1416|      0|			    (intmax_t)file->number,
 1417|      0|			    iso9660->pathname.s,
 1418|      0|			    (intmax_t)file->offset,
 1419|      0|			    (intmax_t)iso9660->current_position);
 1420|      0|			iso9660->entry_bytes_remaining = 0;
 1421|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1422|      0|		}
 1423|      8|		iso9660->current_position = (uint64_t)r64;
 1424|      8|	}
 1425|       |
 1426|       |	/* Initialize zisofs variables. */
 1427|     73|	iso9660->entry_zisofs.pz = file->pz;
 1428|     73|	if (file->pz) {
  ------------------
  |  Branch (1428:6): [True: 0, False: 73]
  ------------------
 1429|      0|#ifdef HAVE_ZLIB_H
 1430|      0|		struct zisofs  *zisofs;
 1431|       |
 1432|      0|		zisofs = &iso9660->entry_zisofs;
 1433|      0|		zisofs->initialized = 0;
 1434|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1435|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1436|      0|		zisofs->pz_offset = 0;
 1437|      0|		zisofs->header_avail = 0;
 1438|      0|		zisofs->header_passed = 0;
 1439|      0|		zisofs->block_pointers_avail = 0;
 1440|      0|#endif
 1441|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1442|      0|	}
 1443|       |
 1444|     73|	iso9660->previous_number = file->number;
 1445|     73|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1445:6): [True: 0, False: 73]
  ------------------
 1446|      0|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1447|      0|		    iso9660->utf16be_path_len);
 1448|      0|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1449|      0|	} else
 1450|     73|		archive_strcpy(
  ------------------
  |  |  165|     73|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    146|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1451|     73|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1452|       |
 1453|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1454|     73|	iso9660->entry_content = file->contents.first;
 1455|     73|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1455:6): [True: 2, False: 71]
  ------------------
 1456|      2|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1457|       |
 1458|     73|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  190|     73|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1458:6): [True: 36, False: 37]
  ------------------
 1459|       |		/* Overwrite nlinks by proper link number which is
 1460|       |		 * calculated from number of sub directories. */
 1461|     36|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1462|       |		/* Directory data has been read completely. */
 1463|     36|		iso9660->entry_bytes_remaining = 0;
 1464|     36|	}
 1465|       |
 1466|     73|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  192|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1466:6): [True: 0, False: 73]
  ------------------
 1467|      0|		return (rd_r);
 1468|     73|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1469|     73|}
archive_read_support_format_iso9660.c:choose_volume:
 1153|     20|{
 1154|     20|	struct file_info *file;
 1155|     20|	int64_t skipsize;
 1156|     20|	struct vd *vd;
 1157|     20|	const void *block;
 1158|     20|	char seenJoliet;
 1159|       |
 1160|     20|	vd = &(iso9660->primary);
 1161|     20|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1161:6): [True: 0, False: 20]
  ------------------
 1162|      0|		iso9660->seenJoliet = 0;
 1163|     20|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1163:6): [True: 0, False: 20]
  ------------------
 1164|     20|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1164:3): [True: 0, False: 0]
  ------------------
 1165|       |		/* This condition is unlikely; by way of caution. */
 1166|      0|		vd = &(iso9660->joliet);
 1167|       |
 1168|     20|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   81|     20|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1169|     20|	skipsize = __archive_read_consume(a, skipsize);
 1170|     20|	if (skipsize < 0)
  ------------------
  |  Branch (1170:6): [True: 0, False: 20]
  ------------------
 1171|      0|		return ((int)skipsize);
 1172|     20|	iso9660->current_position = skipsize;
 1173|       |
 1174|     20|	block = __archive_read_ahead(a, vd->size, NULL);
 1175|     20|	if (block == NULL) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 20]
  ------------------
 1176|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1177|      0|		    "Failed to read full block when scanning "
 1178|      0|		    "ISO9660 directory list");
 1179|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1180|      0|	}
 1181|       |
 1182|       |	/*
 1183|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1184|       |	 * avoid converting special name 0x00(Current Directory) and
 1185|       |	 * next byte to UCS2.
 1186|       |	 */
 1187|     20|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1188|     20|	iso9660->seenJoliet = 0;
 1189|     20|	file = parse_file_info(a, NULL, block, vd->size);
 1190|     20|	if (file == NULL)
  ------------------
  |  Branch (1190:6): [True: 0, False: 20]
  ------------------
 1191|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1192|     20|	iso9660->seenJoliet = seenJoliet;
 1193|       |
 1194|       |	/*
 1195|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1196|       |	 * use RockRidge Extensions rather than Joliet ones.
 1197|       |	 */
 1198|     20|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1198:6): [True: 20, False: 0]
  |  Branch (1198:35): [True: 0, False: 20]
  ------------------
 1199|     20|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1199:9): [True: 0, False: 0]
  ------------------
 1200|      0|		iso9660->seenJoliet = 0;
 1201|       |
 1202|     20|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1202:6): [True: 20, False: 0]
  |  Branch (1202:35): [True: 20, False: 0]
  ------------------
 1203|     20|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1203:9): [True: 0, False: 20]
  ------------------
 1204|       |		/* Switch reading data from primary to joliet. */
 1205|      0|		vd = &(iso9660->joliet);
 1206|      0|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   81|      0|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1207|      0|		skipsize -= iso9660->current_position;
 1208|      0|		skipsize = __archive_read_consume(a, skipsize);
 1209|      0|		if (skipsize < 0)
  ------------------
  |  Branch (1209:7): [True: 0, False: 0]
  ------------------
 1210|      0|			return ((int)skipsize);
 1211|      0|		iso9660->current_position += skipsize;
 1212|       |
 1213|      0|		block = __archive_read_ahead(a, vd->size, NULL);
 1214|      0|		if (block == NULL) {
  ------------------
  |  Branch (1214:7): [True: 0, False: 0]
  ------------------
 1215|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1216|      0|			    "Failed to read full block when scanning "
 1217|      0|			    "ISO9660 directory list");
 1218|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1219|      0|		}
 1220|      0|		iso9660->seenJoliet = 0;
 1221|      0|		file = parse_file_info(a, NULL, block, vd->size);
 1222|      0|		if (file == NULL)
  ------------------
  |  Branch (1222:7): [True: 0, False: 0]
  ------------------
 1223|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1224|      0|		iso9660->seenJoliet = seenJoliet;
 1225|      0|	}
 1226|       |
 1227|       |	/* Store the root directory in the pending list. */
 1228|     20|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  445|     20|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  192|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1228:6): [True: 0, False: 20]
  ------------------
 1229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1230|     20|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1230:6): [True: 0, False: 20]
  ------------------
 1231|      0|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  332|      0|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  331|      0|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1232|      0|		a->archive.archive_format_name =
 1233|      0|		    "ISO9660 with Rockridge extensions";
 1234|      0|	}
 1235|       |
 1236|     20|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1237|     20|}
archive_read_support_format_iso9660.c:parse_file_info:
 1826|    147|{
 1827|    147|	struct iso9660 *iso9660;
 1828|    147|	struct file_info *file, *filep;
 1829|    147|	size_t name_len;
 1830|    147|	const unsigned char *rr_start, *rr_end;
 1831|    147|	const unsigned char *p;
 1832|    147|	size_t dr_len = 0;
 1833|    147|	uint64_t fsize, offset;
 1834|    147|	int32_t location;
 1835|    147|	int flags;
 1836|       |
 1837|    147|	iso9660 = (struct iso9660 *)(a->format->data);
 1838|       |
 1839|    147|	if (reclen != 0)
  ------------------
  |  Branch (1839:6): [True: 147, False: 0]
  ------------------
 1840|    147|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  195|    147|#define DR_length_offset 0
  ------------------
 1841|       |	/*
 1842|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1843|       |	 * reclen but at least 34
 1844|       |	 */
 1845|    147|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1845:6): [True: 0, False: 147]
  |  Branch (1845:21): [True: 0, False: 147]
  |  Branch (1845:40): [True: 1, False: 146]
  ------------------
 1846|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1847|      1|			"Invalid length of directory record");
 1848|      1|		return (NULL);
 1849|      1|	}
 1850|    146|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  213|    146|#define DR_name_len_offset 32
  ------------------
 1851|    146|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  199|    146|#define DR_extent_offset 2
  ------------------
 1852|    146|	fsize = toi(isodirrec + DR_size_offset, DR_size_size);
  ------------------
  |  |  201|    146|#define DR_size_offset 10
  ------------------
              	fsize = toi(isodirrec + DR_size_offset, DR_size_size);
  ------------------
  |  |  202|    146|#define DR_size_size 4
  ------------------
 1853|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1854|    146|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1854:6): [True: 2, False: 144]
  |  Branch (1854:32): [True: 0, False: 144]
  ------------------
 1855|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1856|      2|		    "Invalid length of file identifier");
 1857|      2|		return (NULL);
 1858|      2|	}
 1859|       |	/* Sanity check that location doesn't exceed volume block.
 1860|       |	 * Don't check lower limit of location; it's possibility
 1861|       |	 * the location has negative value when file type is symbolic
 1862|       |	 * link or file size is zero. As far as I know latest mkisofs
 1863|       |	 * do that.
 1864|       |	 */
 1865|    144|	if (location > 0 &&
  ------------------
  |  Branch (1865:6): [True: 131, False: 13]
  ------------------
 1866|    144|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1866:6): [True: 2, False: 129]
  ------------------
 1867|    131|	       / iso9660->logical_block_size))
 1868|    131|			> (uint32_t)iso9660->volume_block) {
 1869|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1870|      2|		    "Invalid location of extent of file");
 1871|      2|		return (NULL);
 1872|      2|	}
 1873|       |	/* Sanity check that location doesn't have a negative value
 1874|       |	 * when the file is not empty. it's too large. */
 1875|    142|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1875:6): [True: 116, False: 26]
  |  Branch (1875:20): [True: 0, False: 116]
  ------------------
 1876|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1877|      0|		    "Invalid location of extent of file");
 1878|      0|		return (NULL);
 1879|      0|	}
 1880|       |
 1881|       |	/* Sanity check that this entry does not create a cycle. */
 1882|    142|	offset = iso9660->logical_block_size * (uint64_t)location;
 1883|    290|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1883:23): [True: 148, False: 142]
  ------------------
 1884|    148|		if (filep->offset == offset) {
  ------------------
  |  Branch (1884:7): [True: 0, False: 148]
  ------------------
 1885|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1886|      0|			    "Directory structure contains loop");
 1887|      0|			return (NULL);
 1888|      0|		}
 1889|    148|	}
 1890|       |
 1891|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1892|    142|	file = (struct file_info *)calloc(1, sizeof(*file));
 1893|    142|	if (file == NULL) {
  ------------------
  |  Branch (1893:6): [True: 0, False: 142]
  ------------------
 1894|      0|		archive_set_error(&a->archive, ENOMEM,
 1895|      0|		    "No memory for file entry");
 1896|      0|		return (NULL);
 1897|      0|	}
 1898|    142|	file->parent = parent;
 1899|    142|	file->offset = offset;
 1900|    142|	file->size = fsize;
 1901|    142|	file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  203|    142|#define DR_date_offset 18
  ------------------
 1902|    142|	file->ctime = file->atime = file->mtime;
 1903|    142|	file->rede_files.first = NULL;
 1904|    142|	file->rede_files.last = &(file->rede_files.first);
 1905|       |
 1906|    142|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  215|    142|#define DR_name_offset 33
  ------------------
 1907|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1908|       |	 * before fidgeting the name_len below. */
 1909|    142|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1909:29): [True: 27, False: 115]
  ------------------
 1910|    142|	rr_end = isodirrec + dr_len;
 1911|       |
 1912|    142|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1912:6): [True: 0, False: 142]
  ------------------
 1913|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1914|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1915|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1916|       |		 * option '-joliet-long'.
 1917|       |		 */
 1918|      0|		if (name_len > 206)
  ------------------
  |  Branch (1918:7): [True: 0, False: 0]
  ------------------
 1919|      0|			name_len = 206;
 1920|      0|		name_len &= ~1;
 1921|       |
 1922|       |		/* trim trailing first version and dot from filename.
 1923|       |		 *
 1924|       |		 * Remember we were in UTF-16BE land!
 1925|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1926|       |		 * 16 bits big endian characters on Joliet.
 1927|       |		 *
 1928|       |		 * TODO: sanitize filename?
 1929|       |		 *       Joliet allows any UCS-2 char except:
 1930|       |		 *       *, /, :, ;, ? and \.
 1931|       |		 */
 1932|       |		/* Chop off trailing ';1' from files. */
 1933|      0|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1933:7): [True: 0, False: 0]
  |  Branch (1933:23): [True: 0, False: 0]
  |  Branch (1933:45): [True: 0, False: 0]
  ------------------
 1934|      0|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1934:10): [True: 0, False: 0]
  |  Branch (1934:32): [True: 0, False: 0]
  ------------------
 1935|      0|			name_len -= 4;
 1936|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1937|       |		/* Chop off trailing '.' from filenames. */
 1938|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1939|       |			name_len -= 2;
 1940|       |#endif
 1941|      0|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1941:7): [True: 0, False: 0]
  ------------------
 1942|      0|			archive_set_error(&a->archive, ENOMEM,
 1943|      0|			    "No memory for file name");
 1944|      0|			goto fail;
 1945|      0|		}
 1946|      0|		memcpy(file->utf16be_name, p, name_len);
 1947|      0|		file->utf16be_bytes = name_len;
 1948|    142|	} else {
 1949|       |		/* Chop off trailing ';1' from files. */
 1950|    142|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1950:7): [True: 116, False: 26]
  |  Branch (1950:23): [True: 66, False: 50]
  ------------------
 1951|    142|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1951:5): [True: 66, False: 0]
  ------------------
 1952|     66|			name_len -= 2;
 1953|       |		/* Chop off trailing '.' from filenames. */
 1954|    142|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1954:7): [True: 116, False: 26]
  |  Branch (1954:23): [True: 1, False: 115]
  ------------------
 1955|      1|			--name_len;
 1956|       |
 1957|    142|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    142|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1958|    142|	}
 1959|       |
 1960|    142|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  205|    142|#define DR_flags_offset 25
  ------------------
 1961|    142|	if (flags & 0x02)
  ------------------
  |  Branch (1961:6): [True: 66, False: 76]
  ------------------
 1962|     66|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  190|     66|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1963|     76|	else
 1964|     76|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  185|     76|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1965|    142|	if (flags & 0x80)
  ------------------
  |  Branch (1965:6): [True: 7, False: 135]
  ------------------
 1966|      7|		file->multi_extent = 1;
 1967|    135|	else
 1968|    135|		file->multi_extent = 0;
 1969|       |	/*
 1970|       |	 * Use a location for the file number, which is treated as an inode
 1971|       |	 * number to find out hardlink target. If Rockridge extensions is
 1972|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1973|       |	 * NUMBER of RRIP "PX" extension.
 1974|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1975|       |	 * in ISO images.
 1976|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1977|       |	 */
 1978|    142|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1978:6): [True: 26, False: 116]
  |  Branch (1978:25): [True: 26, False: 0]
  ------------------
 1979|       |		/* If file->size is zero, its location points wrong place,
 1980|       |		 * and so we should not use it for the file number.
 1981|       |		 * When the location has negative value, it can be used
 1982|       |		 * for the file number.
 1983|       |		 */
 1984|     26|		file->number = -1;
 1985|       |		/* Do not appear before any directory entries. */
 1986|     26|		file->offset = -1;
 1987|     26|	} else
 1988|    116|		file->number = (int64_t)(uint32_t)location;
 1989|       |
 1990|       |	/* Rockridge extensions overwrite information from above. */
 1991|    142|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1991:6): [True: 20, False: 122]
  ------------------
 1992|     20|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1992:7): [True: 20, False: 0]
  |  Branch (1992:25): [True: 0, False: 20]
  ------------------
 1993|      0|			p = rr_start;
 1994|      0|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1994:8): [True: 0, False: 0]
  ------------------
 1995|       |				/*
 1996|       |				 * SP extension stores the suspOffset
 1997|       |				 * (Number of bytes to skip between
 1998|       |				 * filename and SUSP records.)
 1999|       |				 * It is mandatory by the SUSP standard
 2000|       |				 * (IEEE 1281).
 2001|       |				 *
 2002|       |				 * It allows SUSP to coexist with
 2003|       |				 * non-SUSP uses of the System
 2004|       |				 * Use Area by placing non-SUSP data
 2005|       |				 * before SUSP data.
 2006|       |				 *
 2007|       |				 * SP extension must be in the root
 2008|       |				 * directory entry, disable all SUSP
 2009|       |				 * processing if not found.
 2010|       |				 */
 2011|      0|				iso9660->suspOffset = p[6];
 2012|      0|				iso9660->seenSUSP = 1;
 2013|      0|				rr_start += 7;
 2014|      0|			}
 2015|      0|		}
 2016|     20|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2016:7): [True: 0, False: 20]
  ------------------
 2017|      0|			int r;
 2018|       |
 2019|      0|			file->name_continues = 0;
 2020|      0|			file->symlink_continues = 0;
 2021|      0|			rr_start += iso9660->suspOffset;
 2022|      0|			r = parse_rockridge(a, file, rr_start, rr_end);
 2023|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2023:8): [True: 0, False: 0]
  ------------------
 2024|      0|				goto fail;
 2025|       |			/*
 2026|       |			 * A file size of symbolic link files in ISO images
 2027|       |			 * made by makefs is not zero and its location is
 2028|       |			 * the same as those of next regular file. That is
 2029|       |			 * the same as hard like file and it causes unexpected
 2030|       |			 * error.
 2031|       |			 */
 2032|      0|			if (file->size > 0 &&
  ------------------
  |  Branch (2032:8): [True: 0, False: 0]
  ------------------
 2033|      0|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  186|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2033:8): [True: 0, False: 0]
  ------------------
 2034|      0|				file->size = 0;
 2035|      0|				file->number = -1;
 2036|      0|				file->offset = -1;
 2037|      0|			}
 2038|      0|		} else
 2039|       |			/* If there isn't SUSP, disable parsing
 2040|       |			 * rock ridge extensions. */
 2041|     20|			iso9660->opt_support_rockridge = 0;
 2042|     20|	}
 2043|       |
 2044|    142|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2045|       |	/* Tell file's parent how many children that parent has. */
 2046|    142|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2046:6): [True: 122, False: 20]
  |  Branch (2046:24): [True: 46, False: 76]
  ------------------
 2047|     46|		parent->subdirs++;
 2048|       |
 2049|    142|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2049:6): [True: 0, False: 142]
  ------------------
 2050|      0|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2050:7): [True: 0, False: 0]
  |  Branch (2050:25): [True: 0, False: 0]
  ------------------
 2051|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2051:7): [True: 0, False: 0]
  |  Branch (2051:25): [True: 0, False: 0]
  ------------------
 2052|      0|		    file->name.s &&
  ------------------
  |  Branch (2052:7): [True: 0, False: 0]
  ------------------
 2053|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2053:8): [True: 0, False: 0]
  ------------------
 2054|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2054:8): [True: 0, False: 0]
  ------------------
 2055|      0|			iso9660->rr_moved = file;
 2056|      0|			file->rr_moved = 1;
 2057|      0|			file->rr_moved_has_re_only = 1;
 2058|      0|			file->re = 0;
 2059|      0|			parent->subdirs--;
 2060|      0|		} else if (file->re) {
  ------------------
  |  Branch (2060:14): [True: 0, False: 0]
  ------------------
 2061|       |			/*
 2062|       |			 * Sanity check: file's parent is rr_moved.
 2063|       |			 */
 2064|      0|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2064:8): [True: 0, False: 0]
  |  Branch (2064:26): [True: 0, False: 0]
  ------------------
 2065|      0|				archive_set_error(&a->archive,
 2066|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2067|      0|				    "Invalid Rockridge RE");
 2068|      0|				goto fail;
 2069|      0|			}
 2070|       |			/*
 2071|       |			 * Sanity check: file does not have "CL" extension.
 2072|       |			 */
 2073|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2073:8): [True: 0, False: 0]
  ------------------
 2074|      0|				archive_set_error(&a->archive,
 2075|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2076|      0|				    "Invalid Rockridge RE and CL");
 2077|      0|				goto fail;
 2078|      0|			}
 2079|       |			/*
 2080|       |			 * Sanity check: The file type must be a directory.
 2081|       |			 */
 2082|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2082:8): [True: 0, False: 0]
  ------------------
 2083|      0|				archive_set_error(&a->archive,
 2084|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2085|      0|				    "Invalid Rockridge RE");
 2086|      0|				goto fail;
 2087|      0|			}
 2088|      0|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2088:14): [True: 0, False: 0]
  |  Branch (2088:32): [True: 0, False: 0]
  ------------------
 2089|      0|			file->rr_moved_has_re_only = 0;
 2090|      0|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2090:12): [True: 0, False: 0]
  |  Branch (2090:30): [True: 0, False: 0]
  ------------------
 2091|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2091:8): [True: 0, False: 0]
  |  Branch (2091:22): [True: 0, False: 0]
  ------------------
 2092|      0|			file->re_descendant = 1;
 2093|      0|		if (file->cl_offset) {
  ------------------
  |  Branch (2093:7): [True: 0, False: 0]
  ------------------
 2094|      0|			struct file_info *r;
 2095|       |
 2096|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2096:8): [True: 0, False: 0]
  |  Branch (2096:26): [True: 0, False: 0]
  ------------------
 2097|      0|				archive_set_error(&a->archive,
 2098|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2099|      0|				    "Invalid Rockridge CL");
 2100|      0|				goto fail;
 2101|      0|			}
 2102|       |			/*
 2103|       |			 * Sanity check: The file type must be a regular file.
 2104|       |			 */
 2105|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2105:8): [True: 0, False: 0]
  ------------------
 2106|      0|				archive_set_error(&a->archive,
 2107|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2108|      0|				    "Invalid Rockridge CL");
 2109|      0|				goto fail;
 2110|      0|			}
 2111|      0|			parent->subdirs++;
 2112|       |			/* Overwrite an offset and a number of this "CL" entry
 2113|       |			 * to appear before other dirs. "+1" to those is to
 2114|       |			 * make sure to appear after "RE" entry which this
 2115|       |			 * "CL" entry should be connected with. */
 2116|      0|			file->offset = file->number = file->cl_offset + 1;
 2117|       |
 2118|       |			/*
 2119|       |			 * Sanity check: cl_offset does not point at its
 2120|       |			 * the parents or itself.
 2121|       |			 */
 2122|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2122:21): [True: 0, False: 0]
  ------------------
 2123|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2123:9): [True: 0, False: 0]
  ------------------
 2124|      0|					archive_set_error(&a->archive,
 2125|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2126|      0|					    "Invalid Rockridge CL");
 2127|      0|					goto fail;
 2128|      0|				}
 2129|      0|			}
 2130|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2130:8): [True: 0, False: 0]
  ------------------
 2131|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2131:8): [True: 0, False: 0]
  ------------------
 2132|      0|				archive_set_error(&a->archive,
 2133|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2134|      0|				    "Invalid Rockridge CL");
 2135|      0|				goto fail;
 2136|      0|			}
 2137|      0|		}
 2138|      0|	}
 2139|       |
 2140|       |#if DEBUG
 2141|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2142|       |	if ((flags & ~0x02) != 0) {
 2143|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2144|       |		dump_isodirrec(stderr, isodirrec);
 2145|       |		fprintf(stderr, "\n");
 2146|       |	} else if (toi(isodirrec + DR_volume_sequence_number_offset, 2) != 1) {
 2147|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2148|       |		dump_isodirrec(stderr, isodirrec);
 2149|       |		fprintf(stderr, "\n");
 2150|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2151|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2152|       |		dump_isodirrec(stderr, isodirrec);
 2153|       |		fprintf(stderr, "\n");
 2154|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2155|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2156|       |		dump_isodirrec(stderr, isodirrec);
 2157|       |		fprintf(stderr, "\n");
 2158|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2159|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2160|       |		dump_isodirrec(stderr, isodirrec);
 2161|       |		fprintf(stderr, "\n");
 2162|       |	}
 2163|       |#endif
 2164|    142|	register_file(iso9660, file);
 2165|    142|	return (file);
 2166|      0|fail:
 2167|      0|	archive_string_free(&file->name);
 2168|      0|	free(file);
 2169|      0|	return (NULL);
 2170|    142|}
archive_read_support_format_iso9660.c:toi:
 3194|    584|{
 3195|    584|	const unsigned char *v = (const unsigned char *)p;
 3196|    584|	if (n > 1)
  ------------------
  |  Branch (3196:6): [True: 438, False: 146]
  ------------------
 3197|    438|		return v[0] + 256 * toi(v + 1, n - 1);
 3198|    146|	if (n == 1)
  ------------------
  |  Branch (3198:6): [True: 146, False: 0]
  ------------------
 3199|    146|		return v[0];
 3200|      0|	return (0);
 3201|    146|}
archive_read_support_format_iso9660.c:isodate7:
 3231|    142|{
 3232|    142|	struct tm tm;
 3233|    142|	int offset;
 3234|    142|	time_t t;
 3235|       |
 3236|    142|	memset(&tm, 0, sizeof(tm));
 3237|    142|	tm.tm_year = v[0];
 3238|    142|	tm.tm_mon = v[1] - 1;
 3239|    142|	tm.tm_mday = v[2];
 3240|    142|	tm.tm_hour = v[3];
 3241|    142|	tm.tm_min = v[4];
 3242|    142|	tm.tm_sec = v[5];
 3243|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3244|    142|	offset = ((const signed char *)v)[6];
 3245|    142|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3245:6): [True: 142, False: 0]
  |  Branch (3245:22): [True: 142, False: 0]
  ------------------
 3246|    142|		tm.tm_hour -= offset / 4;
 3247|    142|		tm.tm_min -= (offset % 4) * 15;
 3248|    142|	}
 3249|    142|	t = time_from_tm(&tm);
 3250|    142|	if (t == (time_t)-1)
  ------------------
  |  Branch (3250:6): [True: 0, False: 142]
  ------------------
 3251|      0|		return ((time_t)0);
 3252|    142|	return (t);
 3253|    142|}
archive_read_support_format_iso9660.c:time_from_tm:
 3285|    142|{
 3286|       |#if HAVE__MKGMTIME
 3287|       |        return _mkgmtime(t);
 3288|       |#elif HAVE_TIMEGM
 3289|       |        /* Use platform timegm() if available. */
 3290|    142|        return (timegm(t));
 3291|       |#else
 3292|       |        /* Else use direct calculation using POSIX assumptions. */
 3293|       |        /* First, fix up tm_yday based on the year/month/day. */
 3294|       |        if (mktime(t) == (time_t)-1)
 3295|       |                return ((time_t)-1);
 3296|       |        /* Then we can compute timegm() from first principles. */
 3297|       |        return (t->tm_sec
 3298|       |            + t->tm_min * 60
 3299|       |            + t->tm_hour * 3600
 3300|       |            + t->tm_yday * 86400
 3301|       |            + (t->tm_year - 70) * 31536000
 3302|       |            + ((t->tm_year - 69) / 4) * 86400
 3303|       |            - ((t->tm_year - 1) / 100) * 86400
 3304|       |            + ((t->tm_year + 299) / 400) * 86400);
 3305|       |#endif
 3306|    142|}
archive_read_support_format_iso9660.c:register_file:
 2727|    142|{
 2728|       |
 2729|    142|	file->use_next = iso9660->use_files;
 2730|    142|	iso9660->use_files = file;
 2731|    142|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3086|    135|{
 3087|    135|	uint64_t file_key, parent_key;
 3088|    135|	int hole, parent;
 3089|       |
 3090|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3091|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3092|    135|	key <<= 16;
 3093|    135|	key += heap->used & 0xFFFF;
 3094|       |
 3095|       |	/* Expand our pending files list as necessary. */
 3096|    135|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3096:6): [True: 20, False: 115]
  ------------------
 3097|     20|		struct file_info **new_pending_files;
 3098|     20|		int new_size = heap->allocated * 2;
 3099|       |
 3100|     20|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3100:7): [True: 20, False: 0]
  ------------------
 3101|     20|			new_size = 1024;
 3102|       |		/* Overflow might keep us from growing the list. */
 3103|     20|		if (new_size <= heap->allocated) {
  ------------------
  |  Branch (3103:7): [True: 0, False: 20]
  ------------------
 3104|      0|			archive_set_error(&a->archive,
 3105|      0|			    ENOMEM, "Out of memory");
 3106|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3107|      0|		}
 3108|     20|		new_pending_files = (struct file_info **)
 3109|     20|		    calloc(new_size, sizeof(new_pending_files[0]));
 3110|     20|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3110:7): [True: 0, False: 20]
  ------------------
 3111|      0|			archive_set_error(&a->archive,
 3112|      0|			    ENOMEM, "Out of memory");
 3113|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3114|      0|		}
 3115|     20|		if (heap->allocated)
  ------------------
  |  Branch (3115:7): [True: 0, False: 20]
  ------------------
 3116|      0|			memcpy(new_pending_files, heap->files,
 3117|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3118|     20|		free(heap->files);
 3119|     20|		heap->files = new_pending_files;
 3120|     20|		heap->allocated = new_size;
 3121|     20|	}
 3122|       |
 3123|    135|	file_key = file->key = key;
 3124|       |
 3125|       |	/*
 3126|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3127|       |	 */
 3128|    135|	hole = heap->used++;
 3129|    206|	while (hole > 0) {
  ------------------
  |  Branch (3129:9): [True: 123, False: 83]
  ------------------
 3130|    123|		parent = (hole - 1)/2;
 3131|    123|		parent_key = heap->files[parent]->key;
 3132|    123|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3132:7): [True: 52, False: 71]
  ------------------
 3133|     52|			heap->files[hole] = file;
 3134|     52|			return (ARCHIVE_OK);
  ------------------
  |  |  192|     52|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3135|     52|		}
 3136|       |		/* Move parent into hole <==> move hole up tree. */
 3137|     71|		heap->files[hole] = heap->files[parent];
 3138|     71|		hole = parent;
 3139|     71|	}
 3140|     83|	heap->files[0] = file;
 3141|       |
 3142|     83|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3143|    135|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2760|    101|{
 2761|    101|	struct file_info *file;
 2762|    101|	int r;
 2763|       |
 2764|    101|	r = next_cache_entry(a, iso9660, pfile);
 2765|    101|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    101|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2765:6): [True: 23, False: 78]
  ------------------
 2766|     23|		return (r);
 2767|     78|	file = *pfile;
 2768|       |
 2769|       |	/* Don't waste time seeking for zero-length bodies. */
 2770|     78|	if (file->size == 0)
  ------------------
  |  Branch (2770:6): [True: 11, False: 67]
  ------------------
 2771|     11|		file->offset = iso9660->current_position;
 2772|       |
 2773|       |	/* flush any remaining bytes from the last round to ensure
 2774|       |	 * we're positioned */
 2775|     78|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2775:6): [True: 0, False: 78]
  ------------------
 2776|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2777|      0|		iso9660->entry_bytes_unconsumed = 0;
 2778|      0|	}
 2779|       |
 2780|       |	/* Seek forward to the start of the entry. */
 2781|     78|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2781:6): [True: 17, False: 61]
  ------------------
 2782|     17|		int64_t step;
 2783|       |
 2784|     17|		step = file->offset - iso9660->current_position;
 2785|     17|		step = __archive_read_consume(a, step);
 2786|     17|		if (step < 0)
  ------------------
  |  Branch (2786:7): [True: 0, False: 17]
  ------------------
 2787|      0|			return ((int)step);
 2788|     17|		iso9660->current_position = file->offset;
 2789|     17|	}
 2790|       |
 2791|       |	/* We found body of file; handle it now. */
 2792|     78|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     78|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2793|     78|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2798|    101|{
 2799|    101|	struct file_info *file;
 2800|    101|	struct {
 2801|    101|		struct file_info	*first;
 2802|    101|		struct file_info	**last;
 2803|    101|	}	empty_files;
 2804|    101|	int64_t number;
 2805|    101|	int count;
 2806|       |
 2807|    101|	file = cache_get_entry(iso9660);
 2808|    101|	if (file != NULL) {
  ------------------
  |  Branch (2808:6): [True: 16, False: 85]
  ------------------
 2809|     16|		*pfile = file;
 2810|     16|		return (ARCHIVE_OK);
  ------------------
  |  |  192|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2811|     16|	}
 2812|       |
 2813|     85|	for (;;) {
 2814|     85|		struct file_info *re, *d;
 2815|       |
 2816|     85|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  447|     85|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2817|     85|		if (file == NULL) {
  ------------------
  |  Branch (2817:7): [True: 6, False: 79]
  ------------------
 2818|       |			/*
 2819|       |			 * If directory entries all which are descendant of
 2820|       |			 * rr_moved are still remaining, expose their.
 2821|       |			 */
 2822|      6|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2822:8): [True: 0, False: 6]
  ------------------
 2823|      6|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2823:8): [True: 0, False: 0]
  ------------------
 2824|      6|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2824:8): [True: 0, False: 0]
  ------------------
 2825|       |				/* Expose "rr_moved" entry. */
 2826|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2827|      6|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2827:11): [True: 0, False: 6]
  ------------------
 2828|       |				/* Expose its descendant dirs. */
 2829|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2829:12): [True: 0, False: 0]
  ------------------
 2830|      0|					cache_add_entry(iso9660, d);
 2831|      0|			}
 2832|      6|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2832:8): [True: 0, False: 6]
  ------------------
 2833|      0|				return (next_cache_entry(a, iso9660, pfile));
 2834|      6|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2835|      6|		}
 2836|       |
 2837|     79|		if (file->cl_offset) {
  ------------------
  |  Branch (2837:7): [True: 0, False: 79]
  ------------------
 2838|      0|			struct file_info *first_re = NULL;
 2839|      0|			int nexted_re = 0;
 2840|       |
 2841|       |			/*
 2842|       |			 * Find "RE" dir for the current file, which
 2843|       |			 * has "CL" flag.
 2844|       |			 */
 2845|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2845:11): [True: 0, False: 0]
  ------------------
 2846|      0|			    != first_re) {
 2847|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2847:9): [True: 0, False: 0]
  ------------------
 2848|      0|					first_re = re;
 2849|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2849:9): [True: 0, False: 0]
  ------------------
 2850|      0|					re->parent->subdirs--;
 2851|      0|					re->parent = file->parent;
 2852|      0|					re->re = 0;
 2853|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2853:10): [True: 0, False: 0]
  ------------------
 2854|      0|						nexted_re = 1;
 2855|      0|						re->re_descendant = 1;
 2856|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2856:11): [True: 0, False: 0]
  ------------------
 2857|      0|							goto fatal_rr;
 2858|       |						/* Move a list of descendants
 2859|       |						 * to a new ancestor. */
 2860|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2860:14): [True: 0, False: 0]
  ------------------
 2861|      0|						    re)) != NULL)
 2862|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2862:12): [True: 0, False: 0]
  ------------------
 2863|      0|							    < 0)
 2864|      0|								goto fatal_rr;
 2865|      0|						break;
 2866|      0|					}
 2867|       |					/* Replace the current file
 2868|       |					 * with "RE" dir */
 2869|      0|					*pfile = file = re;
 2870|       |					/* Expose its descendant */
 2871|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2871:13): [True: 0, False: 0]
  ------------------
 2872|      0|					    file)) != NULL)
 2873|      0|						cache_add_entry(
 2874|      0|						    iso9660, d);
 2875|      0|					break;
 2876|      0|				} else
 2877|      0|					re_add_entry(iso9660, re);
 2878|      0|			}
 2879|      0|			if (nexted_re) {
  ------------------
  |  Branch (2879:8): [True: 0, False: 0]
  ------------------
 2880|       |				/*
 2881|       |				 * Do not expose this at this time
 2882|       |				 * because we have not gotten its full-path
 2883|       |				 * name yet.
 2884|       |				 */
 2885|      0|				continue;
 2886|      0|			}
 2887|     79|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  184|     79|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  190|     79|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2887:14): [True: 51, False: 28]
  ------------------
 2888|     51|			int r;
 2889|       |
 2890|       |			/* Read file entries in this dir. */
 2891|     51|			r = read_children(a, file);
 2892|     51|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|     51|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2892:8): [True: 17, False: 34]
  ------------------
 2893|     17|				return (r);
 2894|       |
 2895|       |			/*
 2896|       |			 * Handle a special dir of Rockridge extensions,
 2897|       |			 * "rr_moved".
 2898|       |			 */
 2899|     34|			if (file->rr_moved) {
  ------------------
  |  Branch (2899:8): [True: 0, False: 34]
  ------------------
 2900|       |				/*
 2901|       |				 * If this has only the subdirectories which
 2902|       |				 * have "RE" flags, do not expose at this time.
 2903|       |				 */
 2904|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2904:9): [True: 0, False: 0]
  ------------------
 2905|      0|					continue;
 2906|       |				/* Otherwise expose "rr_moved" entry. */
 2907|     34|			} else if (file->re) {
  ------------------
  |  Branch (2907:15): [True: 0, False: 34]
  ------------------
 2908|       |				/*
 2909|       |				 * Do not expose this at this time
 2910|       |				 * because we have not gotten its full-path
 2911|       |				 * name yet.
 2912|       |				 */
 2913|      0|				re_add_entry(iso9660, file);
 2914|      0|				continue;
 2915|     34|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2915:15): [True: 0, False: 34]
  ------------------
 2916|       |				/*
 2917|       |				 * If the top level "RE" entry of this entry
 2918|       |				 * is not exposed, we, accordingly, should not
 2919|       |				 * expose this entry at this time because
 2920|       |				 * we cannot make its proper full-path name.
 2921|       |				 */
 2922|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2922:9): [True: 0, False: 0]
  ------------------
 2923|      0|					continue;
 2924|       |				/* Otherwise we can expose this entry because
 2925|       |				 * it seems its top level "RE" has already been
 2926|       |				 * exposed. */
 2927|      0|			}
 2928|     34|		}
 2929|     62|		break;
 2930|     79|	}
 2931|       |
 2932|     62|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  184|     62|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  185|    124|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2932:6): [True: 34, False: 28]
  |  Branch (2932:44): [True: 0, False: 28]
  ------------------
 2933|     34|		return (ARCHIVE_OK);
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2934|       |
 2935|     28|	count = 0;
 2936|     28|	number = file->number;
 2937|     28|	iso9660->cache_files.first = NULL;
 2938|     28|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2939|     28|	empty_files.first = NULL;
 2940|     28|	empty_files.last = &empty_files.first;
 2941|       |	/* Collect files which has the same file serial number.
 2942|       |	 * Peek pending_files so that file which number is different
 2943|       |	 * is not put back. */
 2944|     61|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2944:9): [True: 47, False: 14]
  ------------------
 2945|     61|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2945:7): [True: 26, False: 21]
  ------------------
 2946|     47|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2946:7): [True: 7, False: 14]
  ------------------
 2947|     33|		if (file->number == -1) {
  ------------------
  |  Branch (2947:7): [True: 16, False: 17]
  ------------------
 2948|       |			/* This file has the same offset
 2949|       |			 * but it's wrong offset which empty files
 2950|       |			 * and symlink files have.
 2951|       |			 * NOTE: This wrong offset was recorded by
 2952|       |			 * old mkisofs utility. If ISO images is
 2953|       |			 * created by latest mkisofs, this does not
 2954|       |			 * happen.
 2955|       |			 */
 2956|     16|			file->next = NULL;
 2957|     16|			*empty_files.last = file;
 2958|     16|			empty_files.last = &(file->next);
 2959|     17|		} else {
 2960|     17|			count++;
 2961|     17|			cache_add_entry(iso9660, file);
 2962|     17|		}
 2963|     33|		file = next_entry(iso9660);
  ------------------
  |  |  447|     33|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2964|     33|	}
 2965|       |
 2966|     28|	if (count == 0) {
  ------------------
  |  Branch (2966:6): [True: 15, False: 13]
  ------------------
 2967|     15|		*pfile = file;
 2968|     15|		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  192|     15|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2968:11): [True: 0, False: 15]
  ------------------
 2969|     15|	}
 2970|     13|	if (file->number == -1) {
  ------------------
  |  Branch (2970:6): [True: 10, False: 3]
  ------------------
 2971|     10|		file->next = NULL;
 2972|     10|		*empty_files.last = file;
 2973|     10|		empty_files.last = &(file->next);
 2974|     10|	} else {
 2975|      3|		count++;
 2976|      3|		cache_add_entry(iso9660, file);
 2977|      3|	}
 2978|       |
 2979|     13|	if (count > 1) {
  ------------------
  |  Branch (2979:6): [True: 7, False: 6]
  ------------------
 2980|       |		/* The count is the same as number of hardlink,
 2981|       |		 * so much so that each nlinks of files in cache_file
 2982|       |		 * is overwritten by value of the count.
 2983|       |		 */
 2984|      7|		for (file = iso9660->cache_files.first;
 2985|     21|		    file != NULL; file = file->next)
  ------------------
  |  Branch (2985:7): [True: 14, False: 7]
  ------------------
 2986|     14|			file->nlinks = count;
 2987|      7|	}
 2988|       |	/* If there are empty files, that files are added
 2989|       |	 * to the tail of the cache_files. */
 2990|     13|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (2990:6): [True: 10, False: 3]
  ------------------
 2991|     10|		*iso9660->cache_files.last = empty_files.first;
 2992|     10|		iso9660->cache_files.last = empty_files.last;
 2993|     10|	}
 2994|     13|	*pfile = cache_get_entry(iso9660);
 2995|     13|	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  192|     13|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2995:10): [True: 0, False: 13]
  ------------------
 2996|       |
 2997|      0|fatal_rr:
 2998|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2999|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3000|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3001|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3002|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3003|     28|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3071|    114|{
 3072|    114|	struct file_info *file;
 3073|       |
 3074|    114|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3074:6): [True: 29, False: 85]
  ------------------
 3075|     29|		iso9660->cache_files.first = file->next;
 3076|     29|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3076:7): [True: 7, False: 22]
  ------------------
 3077|      7|			iso9660->cache_files.last =
 3078|      7|			    &(iso9660->cache_files.first);
 3079|     29|	}
 3080|    114|	return (file);
 3081|    114|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3147|    118|{
 3148|    118|	uint64_t a_key, b_key, c_key;
 3149|    118|	int a, b, c;
 3150|    118|	struct file_info *r, *tmp;
 3151|       |
 3152|    118|	if (heap->used < 1)
  ------------------
  |  Branch (3152:6): [True: 6, False: 112]
  ------------------
 3153|      6|		return (NULL);
 3154|       |
 3155|       |	/*
 3156|       |	 * The first file in the list is the earliest; we'll return this.
 3157|       |	 */
 3158|    112|	r = heap->files[0];
 3159|       |
 3160|       |	/*
 3161|       |	 * Move the last item in the heap to the root of the tree
 3162|       |	 */
 3163|    112|	heap->files[0] = heap->files[--(heap->used)];
 3164|       |
 3165|       |	/*
 3166|       |	 * Rebalance the heap.
 3167|       |	 */
 3168|    112|	a = 0; /* Starting element and its heap key */
 3169|    112|	a_key = heap->files[a]->key;
 3170|    181|	for (;;) {
 3171|    181|		b = a + a + 1; /* First child */
 3172|    181|		if (b >= heap->used)
  ------------------
  |  Branch (3172:7): [True: 94, False: 87]
  ------------------
 3173|     94|			return (r);
 3174|     87|		b_key = heap->files[b]->key;
 3175|     87|		c = b + 1; /* Use second child if it is smaller. */
 3176|     87|		if (c < heap->used) {
  ------------------
  |  Branch (3176:7): [True: 56, False: 31]
  ------------------
 3177|     56|			c_key = heap->files[c]->key;
 3178|     56|			if (c_key < b_key) {
  ------------------
  |  Branch (3178:8): [True: 9, False: 47]
  ------------------
 3179|      9|				b = c;
 3180|      9|				b_key = c_key;
 3181|      9|			}
 3182|     56|		}
 3183|     87|		if (a_key <= b_key)
  ------------------
  |  Branch (3183:7): [True: 18, False: 69]
  ------------------
 3184|     18|			return (r);
 3185|     69|		tmp = heap->files[a];
 3186|     69|		heap->files[a] = heap->files[b];
 3187|     69|		heap->files[b] = tmp;
 3188|     69|		a = b;
 3189|     69|	}
 3190|    112|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3063|     20|{
 3064|     20|	file->next = NULL;
 3065|     20|	*iso9660->cache_files.last = file;
 3066|     20|	iso9660->cache_files.last = &(file->next);
 3067|     20|}
archive_read_support_format_iso9660.c:re_get_entry:
 3015|      6|{
 3016|      6|	struct file_info *file;
 3017|       |
 3018|      6|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3018:6): [True: 0, False: 6]
  ------------------
 3019|      0|		iso9660->re_files.first = file->re_next;
 3020|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3020:7): [True: 0, False: 0]
  ------------------
 3021|      0|			iso9660->re_files.last =
 3022|      0|			    &(iso9660->re_files.first);
 3023|      0|	}
 3024|      6|	return (file);
 3025|      6|}
archive_read_support_format_iso9660.c:read_children:
 1029|     51|{
 1030|     51|	struct iso9660 *iso9660;
 1031|     51|	const unsigned char *b, *p;
 1032|     51|	struct file_info *multi;
 1033|     51|	size_t step, skip_size;
 1034|       |
 1035|     51|	iso9660 = (struct iso9660 *)(a->format->data);
 1036|       |	/* flush any remaining bytes from the last round to ensure
 1037|       |	 * we're positioned */
 1038|     51|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1038:6): [True: 0, False: 51]
  ------------------
 1039|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1040|      0|		iso9660->entry_bytes_unconsumed = 0;
 1041|      0|	}
 1042|     51|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1042:6): [True: 12, False: 39]
  ------------------
 1043|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1044|     12|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1045|     12|		    parent->name.s,
 1046|     12|		    (intmax_t)iso9660->current_position,
 1047|     12|		    (intmax_t)parent->offset);
 1048|     12|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|     12|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1049|     12|	}
 1050|     39|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1050:6): [True: 0, False: 39]
  ------------------
 1051|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1052|      0|		    "Directory is beyond end-of-media: %s",
 1053|      0|		    parent->name.s);
 1054|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1055|      0|	}
 1056|     39|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1056:6): [True: 0, False: 39]
  ------------------
 1057|      0|		int64_t skipsize;
 1058|       |
 1059|      0|		skipsize = parent->offset - iso9660->current_position;
 1060|      0|		skipsize = __archive_read_consume(a, skipsize);
 1061|      0|		if (skipsize < 0)
  ------------------
  |  Branch (1061:7): [True: 0, False: 0]
  ------------------
 1062|      0|			return ((int)skipsize);
 1063|      0|		iso9660->current_position = parent->offset;
 1064|      0|	}
 1065|       |
 1066|     39|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1067|     39|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1068|     39|	b = __archive_read_ahead(a, step, NULL);
 1069|     39|	if (b == NULL) {
  ------------------
  |  Branch (1069:6): [True: 0, False: 39]
  ------------------
 1070|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1071|      0|		    "Failed to read full block when scanning "
 1072|      0|		    "ISO9660 directory list");
 1073|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1074|      0|	}
 1075|     39|	iso9660->current_position += step;
 1076|     39|	multi = NULL;
 1077|     39|	skip_size = step;
 1078|    568|	while (step) {
  ------------------
  |  Branch (1078:9): [True: 534, False: 34]
  ------------------
 1079|    534|		p = b;
 1080|    534|		b += iso9660->logical_block_size;
 1081|    534|		step -= iso9660->logical_block_size;
 1082|  11.6k|		for (; *p != 0 && p + DR_name_offset < b && p + *p <= b;
  ------------------
  |  |  215|  11.1k|#define DR_name_offset 33
  ------------------
  |  Branch (1082:10): [True: 11.1k, False: 523]
  |  Branch (1082:21): [True: 11.1k, False: 6]
  |  Branch (1082:47): [True: 11.1k, False: 0]
  ------------------
 1083|  11.1k|			p += *p) {
 1084|  11.1k|			struct file_info *child;
 1085|       |
 1086|       |			/* N.B.: these special directory identifiers
 1087|       |			 * are 8 bit "values" even on a
 1088|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1089|       |			 */
 1090|       |
 1091|       |			/* Skip '.' entry. */
 1092|  11.1k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  213|  11.1k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1092:8): [True: 11.0k, False: 121]
  ------------------
 1093|  11.1k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  215|  11.0k|#define DR_name_offset 33
  ------------------
  |  Branch (1093:11): [True: 34, False: 10.9k]
  ------------------
 1094|     34|				continue;
 1095|       |			/* Skip '..' entry. */
 1096|  11.1k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  213|  11.1k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1096:8): [True: 10.9k, False: 121]
  ------------------
 1097|  11.1k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  215|  10.9k|#define DR_name_offset 33
  ------------------
  |  Branch (1097:11): [True: 10.9k, False: 6]
  ------------------
 1098|  10.9k|				continue;
 1099|    127|			child = parse_file_info(a, parent, p, b - p);
 1100|    127|			if (child == NULL) {
  ------------------
  |  Branch (1100:8): [True: 5, False: 122]
  ------------------
 1101|      5|				__archive_read_consume(a, skip_size);
 1102|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1103|      5|			}
 1104|    122|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1104:8): [True: 122, False: 0]
  ------------------
 1105|    122|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1105:9): [True: 7, False: 115]
  |  Branch (1105:32): [True: 7, False: 108]
  ------------------
 1106|     14|				struct content *con;
 1107|       |
 1108|     14|				if (multi == NULL) {
  ------------------
  |  Branch (1108:9): [True: 7, False: 7]
  ------------------
 1109|      7|					multi = child;
 1110|      7|					multi->contents.first = NULL;
 1111|      7|					multi->contents.last =
 1112|      7|					    &(multi->contents.first);
 1113|      7|				}
 1114|     14|				con = malloc(sizeof(struct content));
 1115|     14|				if (con == NULL) {
  ------------------
  |  Branch (1115:9): [True: 0, False: 14]
  ------------------
 1116|      0|					archive_set_error(
 1117|      0|					    &a->archive, ENOMEM,
 1118|      0|					    "No memory for multi extent");
 1119|      0|					__archive_read_consume(a, skip_size);
 1120|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1121|      0|				}
 1122|     14|				con->offset = child->offset;
 1123|     14|				con->size = child->size;
 1124|     14|				con->next = NULL;
 1125|     14|				*multi->contents.last = con;
 1126|     14|				multi->contents.last = &(con->next);
 1127|     14|				if (multi == child) {
  ------------------
  |  Branch (1127:9): [True: 7, False: 7]
  ------------------
 1128|      7|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  445|      7|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1128:10): [True: 0, False: 7]
  ------------------
 1129|      7|					    != ARCHIVE_OK)
  ------------------
  |  |  192|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1130|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|      7|				} else {
 1132|      7|					multi->size += child->size;
 1133|      7|					if (!child->multi_extent)
  ------------------
  |  Branch (1133:10): [True: 7, False: 0]
  ------------------
 1134|      7|						multi = NULL;
 1135|      7|				}
 1136|     14|			} else
 1137|    108|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  445|    108|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  192|    108|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1137:9): [True: 0, False: 108]
  ------------------
 1138|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|    122|		}
 1140|    534|	}
 1141|       |
 1142|     34|	__archive_read_consume(a, skip_size);
 1143|       |
 1144|       |	/* Read data which recorded by RRIP "CE" extension. */
 1145|     34|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1145:6): [True: 0, False: 34]
  ------------------
 1146|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1147|       |
 1148|     34|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1149|     34|}
archive_read_support_format_iso9660.c:read_CE:
 2462|     34|{
 2463|     34|	struct read_ce_queue *heap;
 2464|     34|	const unsigned char *b, *p, *end;
 2465|     34|	struct file_info *file;
 2466|     34|	size_t step;
 2467|     34|	int r;
 2468|       |
 2469|       |	/* Read data which RRIP "CE" extension points. */
 2470|     34|	heap = &(iso9660->read_ce_req);
 2471|     34|	step = iso9660->logical_block_size;
 2472|     34|	while (heap->cnt &&
  ------------------
  |  Branch (2472:9): [True: 0, False: 34]
  ------------------
 2473|     34|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2473:6): [True: 0, False: 0]
  ------------------
 2474|      0|		b = __archive_read_ahead(a, step, NULL);
 2475|      0|		if (b == NULL) {
  ------------------
  |  Branch (2475:7): [True: 0, False: 0]
  ------------------
 2476|      0|			archive_set_error(&a->archive,
 2477|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2478|      0|			    "Failed to read full block when scanning "
 2479|      0|			    "ISO9660 directory list");
 2480|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2481|      0|		}
 2482|      0|		do {
 2483|      0|			file = heap->reqs[0].file;
 2484|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2484:8): [True: 0, False: 0]
  ------------------
 2485|      0|				archive_set_error(&a->archive,
 2486|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2487|      0|				    "Malformed CE information");
 2488|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      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|			next_CE(heap);
 2493|      0|			r = parse_rockridge(a, file, p, end);
 2494|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2494:8): [True: 0, False: 0]
  ------------------
 2495|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2496|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2496:12): [True: 0, False: 0]
  ------------------
 2497|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2497:7): [True: 0, False: 0]
  ------------------
 2498|       |		/* NOTE: Do not move this consume's code to front of
 2499|       |		 * do-while loop. Registration of nested CE extension
 2500|       |		 * might cause error because of current position. */
 2501|      0|		__archive_read_consume(a, step);
 2502|      0|		iso9660->current_position += step;
 2503|      0|	}
 2504|     34|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2505|     34|}
archive_read_support_format_iso9660.c:build_pathname:
 3310|     92|{
 3311|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3312|       |	// to 1000, then something is very, very wrong.
 3313|     92|	if (depth > 1000) {
  ------------------
  |  Branch (3313:6): [True: 0, False: 92]
  ------------------
 3314|      0|		return NULL;
 3315|      0|	}
 3316|     92|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|     72|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3316:6): [True: 72, False: 20]
  |  Branch (3316:30): [True: 14, False: 58]
  ------------------
 3317|     14|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3317:7): [True: 0, False: 14]
  ------------------
 3318|      0|			return NULL;
 3319|      0|		}
 3320|     14|		archive_strcat(as, "/");
 3321|     14|	}
 3322|     92|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|     92|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3322:6): [True: 26, False: 66]
  ------------------
 3323|     26|		archive_strcat(as, ".");
 3324|     66|	else
 3325|     66|		archive_string_concat(as, &file->name);
 3326|     92|	return (as->s);
 3327|     92|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1473|     81|{
 1474|       |	/* Because read_next_header always does an explicit skip
 1475|       |	 * to the next entry, we don't need to do anything here. */
 1476|     81|	(void)a; /* UNUSED */
 1477|     81|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     81|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1478|     81|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1724|    130|{
 1725|    130|	ssize_t bytes_read;
 1726|    130|	struct iso9660 *iso9660;
 1727|       |
 1728|    130|	iso9660 = (struct iso9660 *)(a->format->data);
 1729|       |
 1730|    130|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1730:6): [True: 28, False: 102]
  ------------------
 1731|     28|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1732|     28|		iso9660->entry_bytes_unconsumed = 0;
 1733|     28|	}
 1734|       |
 1735|    130|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1735:6): [True: 93, False: 37]
  ------------------
 1736|     93|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1736:7): [True: 4, False: 89]
  ------------------
 1737|      4|			iso9660->entry_content = iso9660->entry_content->next;
 1738|     93|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1738:7): [True: 91, False: 2]
  ------------------
 1739|     91|			*buff = NULL;
 1740|     91|			*size = 0;
 1741|     91|			*offset = iso9660->entry_sparse_offset;
 1742|     91|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|     91|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1743|     91|		}
 1744|       |		/* Seek forward to the start of the entry. */
 1745|      2|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1745:7): [True: 0, False: 2]
  ------------------
 1746|      0|			int64_t step;
 1747|       |
 1748|      0|			step = iso9660->entry_content->offset -
 1749|      0|			    iso9660->current_position;
 1750|      0|			step = __archive_read_consume(a, step);
 1751|      0|			if (step < 0)
  ------------------
  |  Branch (1751:8): [True: 0, False: 0]
  ------------------
 1752|      0|				return ((int)step);
 1753|      0|			iso9660->current_position =
 1754|      0|			    iso9660->entry_content->offset;
 1755|      0|		}
 1756|      2|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1756:7): [True: 2, False: 0]
  ------------------
 1757|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1758|      2|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1759|      2|			    iso9660->pathname.s,
 1760|      2|			    (intmax_t)iso9660->entry_content->offset,
 1761|      2|			    (intmax_t)iso9660->current_position);
 1762|      2|			*buff = NULL;
 1763|      2|			*size = 0;
 1764|      2|			*offset = iso9660->entry_sparse_offset;
 1765|      2|			return (ARCHIVE_WARN);
  ------------------
  |  |  194|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1766|      2|		}
 1767|      0|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1768|      0|	}
 1769|     37|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1769:6): [True: 0, False: 37]
  ------------------
 1770|      0|		return (zisofs_read_data(a, buff, size, offset));
 1771|       |
 1772|     37|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1773|     37|	if (bytes_read == 0)
  ------------------
  |  Branch (1773:6): [True: 9, False: 28]
  ------------------
 1774|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1775|      9|		    "Truncated input file");
 1776|     37|	if (*buff == NULL)
  ------------------
  |  Branch (1776:6): [True: 9, False: 28]
  ------------------
 1777|      9|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1778|     28|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1778:6): [True: 19, False: 9]
  ------------------
 1779|     19|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1780|     28|	*size = bytes_read;
 1781|     28|	*offset = iso9660->entry_sparse_offset;
 1782|     28|	iso9660->entry_sparse_offset += bytes_read;
 1783|     28|	iso9660->entry_bytes_remaining -= bytes_read;
 1784|     28|	iso9660->entry_bytes_unconsumed = bytes_read;
 1785|     28|	iso9660->current_position += bytes_read;
 1786|     28|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     28|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1787|     37|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1791|    238|{
 1792|    238|	struct iso9660 *iso9660;
 1793|    238|	int r = ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1794|       |
 1795|    238|	iso9660 = (struct iso9660 *)(a->format->data);
 1796|    238|	release_files(iso9660);
 1797|    238|	free(iso9660->read_ce_req.reqs);
 1798|    238|	archive_string_free(&iso9660->pathname);
 1799|    238|	archive_string_free(&iso9660->previous_pathname);
 1800|    238|	free(iso9660->pending_files.files);
 1801|    238|#ifdef HAVE_ZLIB_H
 1802|    238|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1803|    238|	free(iso9660->entry_zisofs.block_pointers);
 1804|    238|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1804:6): [True: 0, False: 238]
  ------------------
 1805|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1805:7): [True: 0, False: 0]
  ------------------
 1806|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1807|      0|			    "Failed to clean up zlib decompressor");
 1808|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1809|      0|		}
 1810|      0|	}
 1811|    238|#endif
 1812|    238|	free(iso9660->utf16be_path);
 1813|    238|	free(iso9660->utf16be_previous_path);
 1814|    238|	free(iso9660);
 1815|    238|	(a->format->data) = NULL;
 1816|    238|	return (r);
 1817|    238|}
archive_read_support_format_iso9660.c:release_files:
 2735|    238|{
 2736|    238|	struct content *con, *connext;
 2737|    238|	struct file_info *file;
 2738|       |
 2739|    238|	file = iso9660->use_files;
 2740|    380|	while (file != NULL) {
  ------------------
  |  Branch (2740:9): [True: 142, False: 238]
  ------------------
 2741|    142|		struct file_info *next = file->use_next;
 2742|       |
 2743|    142|		archive_string_free(&file->name);
 2744|    142|		archive_string_free(&file->symlink);
 2745|    142|		free(file->utf16be_name);
 2746|    142|		con = file->contents.first;
 2747|    156|		while (con != NULL) {
  ------------------
  |  Branch (2747:10): [True: 14, False: 142]
  ------------------
 2748|     14|			connext = con->next;
 2749|     14|			free(con);
 2750|     14|			con = connext;
 2751|     14|		}
 2752|    142|		free(file);
 2753|    142|		file = next;
 2754|    142|	}
 2755|    238|}

archive_read_support_format_lha:
  260|    238|{
  261|    238|	struct archive_read *a = (struct archive_read *)_a;
  262|    238|	struct lha *lha;
  263|    238|	int r;
  264|       |
  265|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  266|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  267|       |
  268|    238|	lha = (struct lha *)calloc(1, sizeof(*lha));
  269|    238|	if (lha == NULL) {
  ------------------
  |  Branch (269:6): [True: 0, False: 238]
  ------------------
  270|      0|		archive_set_error(&a->archive, ENOMEM,
  271|      0|		    "Can't allocate lha data");
  272|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  273|      0|	}
  274|    238|	archive_string_init(&lha->ws);
  ------------------
  |  |   71|    238|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|       |
  276|    238|	r = __archive_read_register_format(a,
  277|    238|	    lha,
  278|    238|	    "lha",
  279|    238|	    archive_read_format_lha_bid,
  280|    238|	    archive_read_format_lha_options,
  281|    238|	    archive_read_format_lha_read_header,
  282|    238|	    archive_read_format_lha_read_data,
  283|    238|	    archive_read_format_lha_read_data_skip,
  284|    238|	    NULL,
  285|    238|	    archive_read_format_lha_cleanup,
  286|    238|	    NULL,
  287|    238|	    NULL);
  288|       |
  289|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (289:6): [True: 0, False: 238]
  ------------------
  290|      0|		free(lha);
  291|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  292|    238|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  349|    236|{
  350|    236|	const char *p;
  351|    236|	const void *buff;
  352|    236|	ssize_t bytes_avail, offset, window;
  353|    236|	size_t next;
  354|       |
  355|       |	/* If there's already a better bid than we can ever
  356|       |	   make, don't bother testing. */
  357|    236|	if (best_bid > 30)
  ------------------
  |  Branch (357:6): [True: 6, False: 230]
  ------------------
  358|      6|		return (-1);
  359|       |
  360|    230|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  211|    230|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (360:6): [True: 2, False: 228]
  ------------------
  361|      2|		return (-1);
  362|       |
  363|    228|	if (lha_check_header_format(p) == 0)
  ------------------
  |  Branch (363:6): [True: 5, False: 223]
  ------------------
  364|      5|		return (30);
  365|       |
  366|    223|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (366:6): [True: 24, False: 199]
  |  Branch (366:21): [True: 22, False: 2]
  ------------------
  367|       |		/* PE file */
  368|     22|		offset = 0;
  369|     22|		window = 4096;
  370|     24|		while (offset < (1024 * 20)) {
  ------------------
  |  Branch (370:10): [True: 22, False: 2]
  ------------------
  371|     22|			buff = __archive_read_ahead(a, offset + window,
  372|     22|			    &bytes_avail);
  373|     22|			if (buff == NULL) {
  ------------------
  |  Branch (373:8): [True: 0, False: 22]
  ------------------
  374|       |				/* Remaining bytes are less than window. */
  375|      0|				window >>= 1;
  376|      0|				if (window < (H_SIZE + 3))
  ------------------
  |  |  211|      0|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (376:9): [True: 0, False: 0]
  ------------------
  377|      0|					return (0);
  378|      0|				continue;
  379|      0|			}
  380|     22|			p = (const char *)buff + offset;
  381|   114k|			while (p + H_SIZE < (const char *)buff + bytes_avail) {
  ------------------
  |  |  211|   114k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (381:11): [True: 114k, False: 2]
  ------------------
  382|   114k|				if ((next = lha_check_header_format(p)) == 0)
  ------------------
  |  Branch (382:9): [True: 20, False: 114k]
  ------------------
  383|     20|					return (30);
  384|   114k|				p += next;
  385|   114k|			}
  386|      2|			offset = p - (const char *)buff;
  387|      2|		}
  388|     22|	}
  389|    203|	return (0);
  390|    223|}
archive_read_support_format_lha.c:lha_check_header_format:
  296|   114k|{
  297|   114k|	const unsigned char *p = h;
  298|   114k|	size_t next_skip_bytes;
  299|       |
  300|   114k|	switch (p[H_METHOD_OFFSET+3]) {
  ------------------
  |  |  208|   114k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  301|       |	/*
  302|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  303|       |	 * "-lzs-" "-lz5-"
  304|       |	 */
  305|    893|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (305:2): [True: 380, False: 114k]
  |  Branch (305:12): [True: 238, False: 114k]
  |  Branch (305:22): [True: 217, False: 114k]
  |  Branch (305:32): [True: 58, False: 114k]
  ------------------
  306|  2.23k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (306:2): [True: 173, False: 114k]
  |  Branch (306:12): [True: 184, False: 114k]
  |  Branch (306:22): [True: 102, False: 114k]
  |  Branch (306:32): [True: 885, False: 113k]
  ------------------
  307|  2.85k|	case 'd':
  ------------------
  |  Branch (307:2): [True: 622, False: 114k]
  ------------------
  308|  3.21k|	case 's':
  ------------------
  |  Branch (308:2): [True: 359, False: 114k]
  ------------------
  309|  3.21k|		next_skip_bytes = 4;
  310|       |
  311|       |		/* b0 == 0 means the end of an LHa archive file.	*/
  312|  3.21k|		if (p[0] == 0)
  ------------------
  |  Branch (312:7): [True: 173, False: 3.04k]
  ------------------
  313|    173|			break;
  314|  3.04k|		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|  3.04k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|    159|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (314:7): [True: 2.88k, False: 159]
  |  Branch (314:36): [True: 84, False: 75]
  ------------------
  315|  3.04k|		    ||  p[H_METHOD_OFFSET+4] != '-')
  ------------------
  |  |  208|     75|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (315:11): [True: 0, False: 75]
  ------------------
  316|  2.97k|			break;
  317|       |
  318|     75|		if (p[H_METHOD_OFFSET+2] == 'h') {
  ------------------
  |  |  208|     75|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (318:7): [True: 75, False: 0]
  ------------------
  319|       |			/* "-lh?-" */
  320|     75|			if (p[H_METHOD_OFFSET+3] == 's')
  ------------------
  |  |  208|     75|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (320:8): [True: 0, False: 75]
  ------------------
  321|      0|				break;
  322|     75|			if (p[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  210|     75|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (322:8): [True: 0, False: 75]
  ------------------
  323|      0|				return (0);
  324|     75|			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  210|     75|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
              			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  209|     68|#define H_ATTR_OFFSET	19	/* DOS attribute. */
  ------------------
  |  Branch (324:8): [True: 68, False: 7]
  |  Branch (324:34): [True: 68, False: 0]
  ------------------
  325|     68|				return (0);
  326|     75|		}
  327|      7|		if (p[H_METHOD_OFFSET+2] == 'z') {
  ------------------
  |  |  208|      7|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (327:7): [True: 0, False: 7]
  ------------------
  328|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  329|      0|			if (p[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  210|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (329:8): [True: 0, False: 0]
  ------------------
  330|      0|				break;
  331|      0|			if (p[H_METHOD_OFFSET+3] == 's'
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (331:8): [True: 0, False: 0]
  ------------------
  332|      0|			    || p[H_METHOD_OFFSET+3] == '4'
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (332:11): [True: 0, False: 0]
  ------------------
  333|      0|			    || p[H_METHOD_OFFSET+3] == '5')
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (333:11): [True: 0, False: 0]
  ------------------
  334|      0|				return (0);
  335|      0|		}
  336|      7|		break;
  337|    240|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (337:2): [True: 240, False: 114k]
  ------------------
  338|     37|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (338:2): [True: 37, False: 114k]
  ------------------
  339|    105|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (339:2): [True: 105, False: 114k]
  ------------------
  340|    218|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (340:2): [True: 218, False: 114k]
  ------------------
  341|   110k|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (341:2): [True: 110k, False: 3.81k]
  ------------------
  342|   114k|	}
  343|       |
  344|   114k|	return (next_skip_bytes);
  345|   114k|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  477|     24|{
  478|     24|	struct archive_wstring linkname;
  479|     24|	struct archive_wstring pathname;
  480|     24|	struct lha *lha;
  481|     24|	const unsigned char *p;
  482|     24|	const char *signature;
  483|     24|	int err;
  484|     24|	struct archive_mstring conv_buffer;
  485|     24|	const wchar_t *conv_buffer_p;
  486|       |
  487|     24|	lha_crc16_init();
  488|       |
  489|     24|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  341|     24|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  490|     24|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (490:6): [True: 24, False: 0]
  ------------------
  491|     24|		a->archive.archive_format_name = "lha";
  492|       |
  493|     24|	lha = (struct lha *)(a->format->data);
  494|     24|	lha->decompress_init = 0;
  495|     24|	lha->end_of_entry = 0;
  496|     24|	lha->end_of_entry_cleanup = 0;
  497|     24|	lha->entry_unconsumed = 0;
  498|       |
  499|     24|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  211|     24|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (499:6): [True: 0, False: 24]
  ------------------
  500|       |		/*
  501|       |		 * LHa archiver added 0 to the tail of its archive file as
  502|       |		 * the mark of the end of the archive.
  503|       |		 */
  504|      0|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  505|      0|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (505:7): [True: 0, False: 0]
  |  Branch (505:28): [True: 0, False: 0]
  ------------------
  506|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  507|      0|		return (truncated_error(a));
  508|      0|	}
  509|       |
  510|     24|	signature = (const char *)p;
  511|     24|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (511:6): [True: 24, False: 0]
  ------------------
  512|     24|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (512:6): [True: 19, False: 5]
  |  Branch (512:29): [True: 19, False: 0]
  ------------------
  513|       |                /* This is an executable?  Must be self-extracting... 	*/
  514|     19|		err = lha_skip_sfx(a);
  515|     19|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  194|     19|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (515:7): [True: 0, False: 19]
  ------------------
  516|      0|			return (err);
  517|       |
  518|     19|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (518:7): [True: 0, False: 19]
  ------------------
  519|      0|			return (truncated_error(a));
  520|     19|		signature = (const char *)p;
  521|     19|	}
  522|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  523|     24|	if (signature[0] == 0)
  ------------------
  |  Branch (523:6): [True: 0, False: 24]
  ------------------
  524|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  525|       |
  526|       |	/*
  527|       |	 * Check the header format and method type.
  528|       |	 */
  529|     24|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (529:6): [True: 0, False: 24]
  ------------------
  530|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  531|      0|		    "Bad LHa file");
  532|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  533|      0|	}
  534|       |
  535|       |	/* We've found the first header. */
  536|     24|	lha->found_first_header = 1;
  537|       |	/* Set a default value and common data */
  538|     24|	lha->header_size = 0;
  539|     24|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  210|     24|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  540|     24|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  208|     24|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  541|     24|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  208|     24|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  542|     24|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  208|     24|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  543|     24|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (543:6): [True: 0, False: 24]
  ------------------
  544|      0|		lha->directory = 1;
  545|     24|	else
  546|     24|		lha->directory = 0;
  547|     24|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (547:6): [True: 19, False: 5]
  ------------------
  548|     24|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (548:6): [True: 0, False: 5]
  ------------------
  549|     19|		lha->entry_is_compressed = 0;
  550|      5|	else
  551|      5|		lha->entry_is_compressed = 1;
  552|       |
  553|     24|	lha->compsize = 0;
  554|     24|	lha->origsize = 0;
  555|     24|	lha->setflag = 0;
  556|     24|	lha->birthtime = 0;
  557|     24|	lha->birthtime_tv_nsec = 0;
  558|     24|	lha->mtime = 0;
  559|     24|	lha->mtime_tv_nsec = 0;
  560|     24|	lha->atime = 0;
  561|     24|	lha->atime_tv_nsec = 0;
  562|     24|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (562:14): [True: 0, False: 24]
  ------------------
  563|     24|	lha->uid = 0;
  564|     24|	lha->gid = 0;
  565|     24|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|     24|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  566|     24|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|     24|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  567|     24|	lha->dos_attr = 0;
  568|     24|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (568:6): [True: 0, False: 24]
  ------------------
  569|      0|		lha->sconv_dir = lha->opt_sconv;
  570|      0|		lha->sconv_fname = lha->opt_sconv;
  571|     24|	} else {
  572|     24|		lha->sconv_dir = NULL;
  573|     24|		lha->sconv_fname = NULL;
  574|     24|	}
  575|       |
  576|     24|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  210|     24|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  577|      0|	case 0:
  ------------------
  |  Branch (577:2): [True: 0, False: 24]
  ------------------
  578|      0|		err = lha_read_file_header_0(a, lha);
  579|      0|		break;
  580|     22|	case 1:
  ------------------
  |  Branch (580:2): [True: 22, False: 2]
  ------------------
  581|     22|		err = lha_read_file_header_1(a, lha);
  582|     22|		break;
  583|      2|	case 2:
  ------------------
  |  Branch (583:2): [True: 2, False: 22]
  ------------------
  584|      2|		err = lha_read_file_header_2(a, lha);
  585|      2|		break;
  586|      0|	case 3:
  ------------------
  |  Branch (586:2): [True: 0, False: 24]
  ------------------
  587|      0|		err = lha_read_file_header_3(a, lha);
  588|      0|		break;
  589|      0|	default:
  ------------------
  |  Branch (589:2): [True: 0, False: 24]
  ------------------
  590|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  591|      0|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  210|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  592|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  593|      0|		break;
  594|     24|	}
  595|     24|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  194|     24|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (595:6): [True: 22, False: 2]
  ------------------
  596|     22|		return (err);
  597|       |
  598|       |
  599|      2|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (599:6): [True: 2, False: 0]
  |  Branch (599:25): [True: 0, False: 2]
  ------------------
  600|       |		/* The filename has not been set */
  601|      0|		return (truncated_error(a));
  602|       |
  603|       |	/*
  604|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  605|       |	 * This is because codepages might differ between dirname and filename.
  606|       |	*/
  607|      2|	archive_string_init(&pathname);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  608|      2|	archive_string_init(&linkname);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  609|      2|	archive_string_init(&conv_buffer.aes_mbs);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  610|      2|	archive_string_init(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  611|      2|	archive_string_init(&conv_buffer.aes_utf8);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  612|      2|	archive_string_init(&conv_buffer.aes_wcs);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
  613|      2|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir)) {
  ------------------
  |  Branch (613:6): [True: 0, False: 2]
  ------------------
  614|      0|		archive_set_error(&a->archive,
  615|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  616|      0|			"Pathname cannot be converted "
  617|      0|			"from %s to Unicode.",
  618|      0|			archive_string_conversion_charset_name(lha->sconv_dir));
  619|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  620|      2|	} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (620:13): [True: 0, False: 2]
  ------------------
  621|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  622|      2|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (622:6): [True: 0, False: 2]
  ------------------
  623|      0|		archive_mstring_clean(&conv_buffer);
  624|      0|		archive_wstring_free(&pathname);
  625|      0|		archive_wstring_free(&linkname);
  626|      0|		return (err);
  627|      0|	}
  628|      2|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|      2|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  629|       |
  630|      2|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|      2|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  631|      2|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|      2|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  632|      2|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|      2|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  633|      2|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|      2|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  634|      2|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname)) {
  ------------------
  |  Branch (634:6): [True: 0, False: 2]
  ------------------
  635|      0|		archive_set_error(&a->archive,
  636|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  637|      0|			"Pathname cannot be converted "
  638|      0|			"from %s to Unicode.",
  639|      0|			archive_string_conversion_charset_name(lha->sconv_fname));
  640|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  641|      0|	}
  642|      2|	else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (642:11): [True: 0, False: 2]
  ------------------
  643|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  644|      2|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (644:6): [True: 0, False: 2]
  ------------------
  645|      0|		archive_mstring_clean(&conv_buffer);
  646|      0|		archive_wstring_free(&pathname);
  647|      0|		archive_wstring_free(&linkname);
  648|      0|		return (err);
  649|      0|	}
  650|      2|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  651|      2|	archive_mstring_clean(&conv_buffer);
  652|       |
  653|      2|	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  184|      2|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  186|      2|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (653:6): [True: 0, False: 2]
  ------------------
  654|       |		/*
  655|       |	 	 * Extract the symlink-name if it's included in the pathname.
  656|       |	 	 */
  657|      0|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (657:7): [True: 0, False: 0]
  ------------------
  658|       |			/* We couldn't get the symlink-name. */
  659|      0|			archive_set_error(&a->archive,
  660|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  661|      0|			    "Unknown symlink-name");
  662|      0|			archive_wstring_free(&pathname);
  663|      0|			archive_wstring_free(&linkname);
  664|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  665|      0|		}
  666|      2|	} else {
  667|       |		/*
  668|       |		 * Make sure a file-type is set.
  669|       |		 * The mode has been overridden if it is in the extended data.
  670|       |		 */
  671|      2|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  184|      2|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  672|      2|		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
              		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  185|      2|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (672:8): [True: 0, False: 2]
  ------------------
  673|      2|	}
  674|      2|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  163|      2|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (674:6): [True: 2, False: 0]
  ------------------
  675|      2|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (675:6): [True: 0, False: 2]
  ------------------
  676|      0|		lha->mode &= ~(0222);/* read only. */
  677|       |
  678|       |	/*
  679|       |	 * Set basic file parameters.
  680|       |	 */
  681|      2|	archive_entry_copy_pathname_w(entry, pathname.s);
  682|      2|	archive_wstring_free(&pathname);
  683|      2|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (683:6): [True: 0, False: 2]
  ------------------
  684|      0|		archive_entry_copy_symlink_w(entry, linkname.s);
  685|      0|	} else
  686|      2|		archive_entry_set_symlink(entry, NULL);
  687|      2|	archive_wstring_free(&linkname);
  688|       |	/*
  689|       |	 * When a header level is 0, there is a possibility that
  690|       |	 * a pathname and a symlink has '\' character, a directory
  691|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  692|       |	 */
  693|      2|	if (p[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  210|      2|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (693:6): [True: 0, False: 2]
  ------------------
  694|      0|		lha_replace_path_separator(lha, entry);
  695|       |
  696|      2|	archive_entry_set_mode(entry, lha->mode);
  697|      2|	archive_entry_set_uid(entry, lha->uid);
  698|      2|	archive_entry_set_gid(entry, lha->gid);
  699|      2|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (699:6): [True: 0, False: 2]
  ------------------
  700|      0|		archive_entry_set_uname(entry, lha->uname.s);
  701|      2|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (701:6): [True: 0, False: 2]
  ------------------
  702|      0|		archive_entry_set_gname(entry, lha->gname.s);
  703|      2|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  161|      2|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (703:6): [True: 0, False: 2]
  ------------------
  704|      0|		archive_entry_set_birthtime(entry, lha->birthtime,
  705|      0|		    lha->birthtime_tv_nsec);
  706|      0|		archive_entry_set_ctime(entry, lha->birthtime,
  707|      0|		    lha->birthtime_tv_nsec);
  708|      2|	} else {
  709|      2|		archive_entry_unset_birthtime(entry);
  710|      2|		archive_entry_unset_ctime(entry);
  711|      2|	}
  712|      2|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  713|      2|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  162|      2|#define ATIME_IS_SET		2
  ------------------
  |  Branch (713:6): [True: 0, False: 2]
  ------------------
  714|      0|		archive_entry_set_atime(entry, lha->atime,
  715|      0|		    lha->atime_tv_nsec);
  716|      2|	else
  717|      2|		archive_entry_unset_atime(entry);
  718|      2|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (718:6): [True: 0, False: 2]
  |  Branch (718:24): [True: 0, False: 2]
  ------------------
  719|      0|		archive_entry_unset_size(entry);
  720|      2|	else
  721|      2|		archive_entry_set_size(entry, lha->origsize);
  722|       |
  723|       |	/*
  724|       |	 * Prepare variables used to read a file content.
  725|       |	 */
  726|      2|	lha->entry_bytes_remaining = lha->compsize;
  727|      2|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (727:6): [True: 0, False: 2]
  ------------------
  728|      0|		archive_set_error(&a->archive,
  729|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  730|      0|		    "Invalid LHa entry size");
  731|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  732|      0|	}
  733|      2|	lha->entry_offset = 0;
  734|      2|	lha->entry_crc_calculated = 0;
  735|       |
  736|       |	/*
  737|       |	 * This file does not have a content.
  738|       |	 */
  739|      2|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (739:6): [True: 0, False: 2]
  |  Branch (739:24): [True: 0, False: 2]
  ------------------
  740|      0|		lha->end_of_entry = 1;
  741|       |
  742|      2|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  743|      2|	    lha->method[0], lha->method[1], lha->method[2]);
  744|      2|	a->archive.archive_format_name = lha->format_name;
  745|       |
  746|      2|	return (err);
  747|      2|}
archive_read_support_format_lha.c:lha_crc16_init:
 1772|     24|{
 1773|     24|	unsigned int i;
 1774|     24|	static int crc16init = 0;
 1775|       |
 1776|     24|	if (crc16init)
  ------------------
  |  Branch (1776:6): [True: 23, False: 1]
  ------------------
 1777|     23|		return;
 1778|      1|	crc16init = 1;
 1779|       |
 1780|    257|	for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (1780:14): [True: 256, False: 1]
  ------------------
 1781|    256|		unsigned int j;
 1782|    256|		uint16_t crc = (uint16_t)i;
 1783|  2.30k|		for (j = 8; j; j--)
  ------------------
  |  Branch (1783:15): [True: 2.04k, False: 256]
  ------------------
 1784|  2.04k|			crc = (crc >> 1) ^ ((crc & 1) * 0xA001);
 1785|    256|		crc16tbl[0][i] = crc;
 1786|    256|	}
 1787|       |
 1788|    257|	for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (1788:14): [True: 256, False: 1]
  ------------------
 1789|    256|		crc16tbl[1][i] = (crc16tbl[0][i] >> 8)
 1790|    256|			^ crc16tbl[0][crc16tbl[0][i] & 0xff];
 1791|    256|	}
 1792|      1|}
archive_read_support_format_lha.c:truncated_error:
  468|     18|{
  469|     18|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|     18|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  470|     18|	    "Truncated LHa header");
  471|     18|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  472|     18|}
archive_read_support_format_lha.c:lha_skip_sfx:
  424|     19|{
  425|     19|	const void *h;
  426|     19|	const char *p, *q;
  427|     19|	size_t next, skip;
  428|     19|	ssize_t bytes, window;
  429|       |
  430|     19|	window = 4096;
  431|     19|	for (;;) {
  432|     19|		h = __archive_read_ahead(a, window, &bytes);
  433|     19|		if (h == NULL) {
  ------------------
  |  Branch (433:7): [True: 0, False: 19]
  ------------------
  434|       |			/* Remaining bytes are less than window. */
  435|      0|			window >>= 1;
  436|      0|			if (window < (H_SIZE + 3))
  ------------------
  |  |  211|      0|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (436:8): [True: 0, False: 0]
  ------------------
  437|      0|				goto fatal;
  438|      0|			continue;
  439|      0|		}
  440|     19|		if (bytes < H_SIZE)
  ------------------
  |  |  211|     19|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (440:7): [True: 0, False: 19]
  ------------------
  441|      0|			goto fatal;
  442|     19|		p = h;
  443|     19|		q = p + bytes;
  444|       |
  445|       |		/*
  446|       |		 * Scan ahead until we find something that looks
  447|       |		 * like the lha header.
  448|       |		 */
  449|     39|		while (p + H_SIZE < q) {
  ------------------
  |  |  211|     39|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (449:10): [True: 39, False: 0]
  ------------------
  450|     39|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (450:8): [True: 19, False: 20]
  ------------------
  451|     19|				skip = p - (const char *)h;
  452|     19|				__archive_read_consume(a, skip);
  453|     19|				return (ARCHIVE_OK);
  ------------------
  |  |  192|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  454|     19|			}
  455|     20|			p += next;
  456|     20|		}
  457|      0|		skip = p - (const char *)h;
  458|      0|		__archive_read_consume(a, skip);
  459|      0|	}
  460|      0|fatal:
  461|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  462|      0|	    "Couldn't find out LHa header");
  463|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  464|     19|}
archive_read_support_format_lha.c:lha_dos_time:
 1722|     22|{
 1723|     22|	int msTime, msDate;
 1724|     22|	struct tm ts;
 1725|       |
 1726|     22|	msTime = archive_le16dec(p);
 1727|     22|	msDate = archive_le16dec(p+2);
 1728|       |
 1729|     22|	memset(&ts, 0, sizeof(ts));
 1730|     22|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 1731|     22|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 1732|     22|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 1733|     22|	ts.tm_hour = (msTime >> 11) & 0x1f;
 1734|     22|	ts.tm_min = (msTime >> 5) & 0x3f;
 1735|     22|	ts.tm_sec = (msTime << 1) & 0x3e;
 1736|     22|	ts.tm_isdst = -1;
 1737|     22|	return (mktime(&ts));
 1738|     22|}
archive_read_support_format_lha.c:lha_calcsum:
 1760|     22|{
 1761|     22|	unsigned char const *p = (unsigned char const *)pp;
 1762|       |
 1763|     22|	p += offset;
 1764|  2.06k|	for (;size > 0; --size)
  ------------------
  |  Branch (1764:8): [True: 2.04k, False: 22]
  ------------------
 1765|  2.04k|		sum += *p++;
 1766|     22|	return (sum);
 1767|     22|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  905|     22|{
  906|     22|	const unsigned char *p;
  907|     22|	size_t extdsize;
  908|     22|	int i, err, err2;
  909|     22|	int namelen, padding;
  910|     22|	unsigned char headersum, sum_calculated;
  911|       |
  912|     22|	err = ARCHIVE_OK;
  ------------------
  |  |  192|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  913|       |
  914|     22|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  902|     22|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (914:6): [True: 0, False: 22]
  ------------------
  915|      0|		return (truncated_error(a));
  916|       |
  917|     22|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  895|     22|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  918|     22|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  896|     22|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  919|       |	/* Note: An extended header size is included in a compsize. */
  920|     22|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  897|     22|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  921|     22|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  898|     22|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  922|     22|	lha->mtime = lha_dos_time(p + H1_DOS_TIME_OFFSET);
  ------------------
  |  |  899|     22|#define H1_DOS_TIME_OFFSET	15
  ------------------
  923|     22|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  900|     22|#define H1_NAME_LEN_OFFSET	21
  ------------------
  924|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  925|     22|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  902|     22|#define H1_FIXED_SIZE		27
  ------------------
  926|       |
  927|     22|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (927:6): [True: 0, False: 22]
  |  Branch (927:23): [True: 0, False: 22]
  ------------------
  928|      0|		goto invalid;
  929|       |
  930|     22|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (930:6): [True: 0, False: 22]
  ------------------
  931|      0|		return (truncated_error(a));
  932|       |
  933|     41|	for (i = 0; i < namelen; i++) {
  ------------------
  |  Branch (933:14): [True: 19, False: 22]
  ------------------
  934|     19|		if (p[i + H1_FILE_NAME_OFFSET] == 0xff)
  ------------------
  |  |  901|     19|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (934:7): [True: 0, False: 19]
  ------------------
  935|      0|			goto invalid;/* Invalid filename. */
  936|     19|	}
  937|     22|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|     22|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  938|     22|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  901|     22|#define H1_FILE_NAME_OFFSET	22
  ------------------
  939|     22|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|     22|#define CRC_IS_SET		8
  ------------------
  940|       |
  941|     22|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  942|       |	/* Consume used bytes but not include `next header size' data
  943|       |	 * since it will be consumed in lha_read_file_extended_header(). */
  944|     22|	__archive_read_consume(a, lha->header_size - 2);
  945|       |
  946|       |	/* Read extended headers */
  947|     22|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  948|     22|	    (uint64_t)(lha->compsize + 2), &extdsize);
  949|     22|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  194|     22|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (949:6): [True: 18, False: 4]
  ------------------
  950|     18|		return (err2);
  951|      4|	if (err2 < err)
  ------------------
  |  Branch (951:6): [True: 0, False: 4]
  ------------------
  952|      0|		err = err2;
  953|       |	/* Get a real compressed file size. */
  954|      4|	lha->compsize -= extdsize - 2;
  955|       |
  956|      4|	if (lha->compsize < 0)
  ------------------
  |  Branch (956:6): [True: 0, False: 4]
  ------------------
  957|      0|		goto invalid;	/* Invalid compressed file size */
  958|       |
  959|      4|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (959:6): [True: 4, False: 0]
  ------------------
  960|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  961|      4|		    "LHa header sum error");
  962|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  963|      4|	}
  964|      0|	return (err);
  965|      0|invalid:
  966|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  967|      0|	    "Invalid LHa header");
  968|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  969|      4|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1142|     24|{
 1143|     24|	const void *h;
 1144|     24|	const unsigned char *extdheader;
 1145|     24|	size_t	extdsize;
 1146|     24|	size_t	datasize;
 1147|     24|	unsigned int i;
 1148|     24|	unsigned char extdtype;
 1149|       |
 1150|     24|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1151|     24|#define EXT_FILENAME		0x01		/* Filename 		    */
 1152|     24|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1153|     24|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1154|     24|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1155|     24|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1156|     24|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1157|     24|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1158|     24|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1159|     24|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1160|     24|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1161|     24|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1162|     24|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1163|     24|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1164|     24|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1165|     24|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1166|     24|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1167|       |
 1168|     24|	*total_size = sizefield_length;
 1169|       |
 1170|    375|	for (;;) {
 1171|       |		/* Read an extended header size. */
 1172|    375|		if ((h =
  ------------------
  |  Branch (1172:7): [True: 0, False: 375]
  ------------------
 1173|    375|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1174|      0|			return (truncated_error(a));
 1175|       |		/* Check if the size is the zero indicates the end of the
 1176|       |		 * extended header. */
 1177|    375|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1177:7): [True: 375, False: 0]
  ------------------
 1178|    375|			extdsize = archive_le16dec(h);
 1179|      0|		else
 1180|      0|			extdsize = archive_le32dec(h);
 1181|    375|		if (extdsize == 0) {
  ------------------
  |  Branch (1181:7): [True: 6, False: 369]
  ------------------
 1182|       |			/* End of extended header */
 1183|      6|			if (crc != NULL)
  ------------------
  |  Branch (1183:8): [True: 2, False: 4]
  ------------------
 1184|      2|				*crc = lha_crc16(*crc, h, sizefield_length);
 1185|      6|			__archive_read_consume(a, sizefield_length);
 1186|      6|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1187|      6|		}
 1188|       |
 1189|       |		/* Sanity check to the extended header size. */
 1190|    369|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1190:7): [True: 0, False: 369]
  ------------------
 1191|    369|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1191:7): [True: 0, False: 369]
  ------------------
 1192|      0|			goto invalid;
 1193|       |
 1194|       |		/* Read the extended header. */
 1195|    369|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1195:7): [True: 18, False: 351]
  ------------------
 1196|     18|			return (truncated_error(a));
 1197|    351|		*total_size += extdsize;
 1198|       |
 1199|    351|		extdheader = (const unsigned char *)h;
 1200|       |		/* Get the extended header type. */
 1201|    351|		extdtype = extdheader[sizefield_length];
 1202|       |		/* Calculate an extended data size. */
 1203|    351|		datasize = extdsize - (1 + sizefield_length);
 1204|       |		/* Skip an extended header size field and type field. */
 1205|    351|		extdheader += sizefield_length + 1;
 1206|       |
 1207|    351|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1150|      4|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1207:7): [True: 4, False: 347]
  |  Branch (1207:22): [True: 3, False: 1]
  ------------------
 1208|      3|			*crc = lha_crc16(*crc, h, extdsize);
 1209|    351|		switch (extdtype) {
 1210|      5|		case EXT_HEADER_CRC:
  ------------------
  |  | 1150|      5|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1210:3): [True: 5, False: 346]
  ------------------
 1211|       |			/* We only use a header CRC. Following data will not
 1212|       |			 * be used. */
 1213|      5|			if (datasize >= 2) {
  ------------------
  |  Branch (1213:8): [True: 5, False: 0]
  ------------------
 1214|      5|				lha->header_crc = archive_le16dec(extdheader);
 1215|      5|				if (crc != NULL) {
  ------------------
  |  Branch (1215:9): [True: 1, False: 4]
  ------------------
 1216|      1|					static const char zeros[2] = {0, 0};
 1217|      1|					*crc = lha_crc16(*crc, h,
 1218|      1|					    extdsize - datasize);
 1219|       |					/* CRC value itself as zero */
 1220|      1|					*crc = lha_crc16(*crc, zeros, 2);
 1221|      1|					*crc = lha_crc16(*crc,
 1222|      1|					    extdheader+2, datasize - 2);
 1223|      1|				}
 1224|      5|			}
 1225|      5|			break;
 1226|      2|		case EXT_FILENAME:
  ------------------
  |  | 1151|      2|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1226:3): [True: 2, False: 349]
  ------------------
 1227|      2|			if (datasize == 0) {
  ------------------
  |  Branch (1227:8): [True: 0, False: 2]
  ------------------
 1228|       |				/* maybe directory header */
 1229|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1230|      0|				break;
 1231|      0|			}
 1232|      2|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1232:8): [True: 0, False: 2]
  ------------------
 1233|      0|				goto invalid;
 1234|      2|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|      2|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1235|      2|			    (const char *)extdheader, datasize);
 1236|      2|			break;
 1237|     40|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1157|     40|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1237:3): [True: 40, False: 311]
  ------------------
 1238|     40|			if (datasize == 0) {
  ------------------
  |  Branch (1238:8): [True: 0, False: 40]
  ------------------
 1239|       |				/* maybe directory header */
 1240|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1241|      0|				break;
 1242|     40|			} else if (datasize & 1) {
  ------------------
  |  Branch (1242:15): [True: 0, False: 40]
  ------------------
 1243|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1244|      0|				goto invalid;
 1245|      0|			}
 1246|     40|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1246:8): [True: 0, False: 40]
  ------------------
 1247|      0|				goto invalid;
 1248|     40|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|     40|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1249|     40|			archive_array_append(&lha->filename,
 1250|     40|				(const char *)extdheader, datasize);
 1251|       |			/* Setup a string conversion for a filename. */
 1252|     40|			lha->sconv_fname =
 1253|     40|			    archive_string_conversion_from_charset(&a->archive,
 1254|     40|			        "UTF-16LE", 1);
 1255|     40|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1255:8): [True: 0, False: 40]
  ------------------
 1256|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1257|     40|			break;
 1258|     40|		case EXT_DIRECTORY:
  ------------------
  |  | 1152|      0|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1258:3): [True: 0, False: 351]
  ------------------
 1259|      0|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1259:8): [True: 0, False: 0]
  |  Branch (1259:25): [True: 0, False: 0]
  ------------------
 1260|       |				/* no directory name data. exit this case. */
 1261|      0|				goto invalid;
 1262|       |
 1263|      0|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1264|      0|		  	    (const char *)extdheader, datasize);
 1265|       |			/*
 1266|       |			 * Convert directory delimiter from 0xFF
 1267|       |			 * to '/' for local system.
 1268|       |	 		 */
 1269|      0|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|      0|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1270:9): [True: 0, False: 0]
  ------------------
 1271|      0|					lha->dirname.s[i] = '/';
 1272|      0|			}
 1273|       |			/* Is last character directory separator? */
 1274|      0|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1274:8): [True: 0, False: 0]
  ------------------
 1275|       |				/* invalid directory data */
 1276|      0|				goto invalid;
 1277|      0|			break;
 1278|      0|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1158|      0|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1278:3): [True: 0, False: 351]
  ------------------
 1279|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1280|      0|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1280:8): [True: 0, False: 0]
  |  Branch (1280:25): [True: 0, False: 0]
  ------------------
 1281|      0|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1281:8): [True: 0, False: 0]
  ------------------
 1282|       |				/* no directory name data. exit this case. */
 1283|      0|				goto invalid;
 1284|      0|			}
 1285|       |
 1286|      0|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1287|      0|			archive_array_append(&lha->dirname,
 1288|      0|				(const char *)extdheader, datasize);
 1289|      0|			lha->sconv_dir =
 1290|      0|			    archive_string_conversion_from_charset(&a->archive,
 1291|      0|			        "UTF-16LE", 1);
 1292|      0|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1292:8): [True: 0, False: 0]
  ------------------
 1293|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1294|      0|			else {
 1295|       |				/*
 1296|       |				 * Convert directory delimiter from 0xFFFF
 1297|       |				 * to '/' for local system.
 1298|       |				 */
 1299|      0|				uint16_t dirSep;
 1300|      0|				uint16_t d = 1;
 1301|      0|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1301:9): [True: 0, False: 0]
  ------------------
 1302|      0|					dirSep = 0x2F00;
 1303|      0|				else
 1304|      0|					dirSep = 0x002F;
 1305|       |
 1306|       |				/* UTF-16LE character */
 1307|      0|				uint16_t *utf16name =
 1308|      0|				    (uint16_t *)lha->dirname.s;
 1309|      0|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1309:17): [True: 0, False: 0]
  ------------------
 1310|      0|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1310:10): [True: 0, False: 0]
  ------------------
 1311|      0|						utf16name[i] = dirSep;
 1312|      0|					}
 1313|      0|				}
 1314|       |				/* Is last character directory separator? */
 1315|      0|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1315:9): [True: 0, False: 0]
  ------------------
 1316|      0|				    dirSep) {
 1317|       |					/* invalid directory data */
 1318|      0|					goto invalid;
 1319|      0|				}
 1320|      0|			}
 1321|      0|			break;
 1322|     67|		case EXT_DOS_ATTR:
  ------------------
  |  | 1153|     67|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1322:3): [True: 67, False: 284]
  ------------------
 1323|     67|			if (datasize == 2)
  ------------------
  |  Branch (1323:8): [True: 0, False: 67]
  ------------------
 1324|      0|				lha->dos_attr = (unsigned char)
 1325|      0|				    (archive_le16dec(extdheader) & 0xff);
 1326|     67|			break;
 1327|     12|		case EXT_TIMESTAMP:
  ------------------
  |  | 1154|     12|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1327:3): [True: 12, False: 339]
  ------------------
 1328|     12|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1328:8): [True: 0, False: 12]
  ------------------
 1329|      0|				lha->birthtime = lha_win_time(
 1330|      0|				    archive_le64dec(extdheader),
 1331|      0|				    &lha->birthtime_tv_nsec);
 1332|      0|				extdheader += sizeof(uint64_t);
 1333|      0|				lha->mtime = lha_win_time(
 1334|      0|				    archive_le64dec(extdheader),
 1335|      0|				    &lha->mtime_tv_nsec);
 1336|      0|				extdheader += sizeof(uint64_t);
 1337|      0|				lha->atime = lha_win_time(
 1338|      0|				    archive_le64dec(extdheader),
 1339|      0|				    &lha->atime_tv_nsec);
 1340|      0|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  161|      0|#define BIRTHTIME_IS_SET	1
  ------------------
 1341|      0|				    ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define ATIME_IS_SET		2
  ------------------
 1342|      0|			}
 1343|     12|			break;
 1344|     28|		case EXT_FILESIZE:
  ------------------
  |  | 1155|     28|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1344:3): [True: 28, False: 323]
  ------------------
 1345|     28|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1345:8): [True: 0, False: 28]
  ------------------
 1346|      0|				lha->compsize = archive_le64dec(extdheader);
 1347|      0|				extdheader += sizeof(uint64_t);
 1348|      0|				lha->origsize = archive_le64dec(extdheader);
 1349|      0|				if (lha->compsize < 0 || lha->origsize < 0)
  ------------------
  |  Branch (1349:9): [True: 0, False: 0]
  |  Branch (1349:30): [True: 0, False: 0]
  ------------------
 1350|      0|					goto invalid;
 1351|      0|			}
 1352|     28|			break;
 1353|     28|		case EXT_CODEPAGE:
  ------------------
  |  | 1159|     10|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1353:3): [True: 10, False: 341]
  ------------------
 1354|       |			/* Get an archived filename charset from codepage.
 1355|       |			 * This overwrites the charset specified by
 1356|       |			 * hdrcharset option. */
 1357|     10|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1357:8): [True: 0, False: 10]
  ------------------
 1358|      0|				struct archive_string cp;
 1359|      0|				const char *charset;
 1360|       |
 1361|      0|				archive_string_init(&cp);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1362|      0|				switch (archive_le32dec(extdheader)) {
 1363|      0|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1363:5): [True: 0, False: 0]
  ------------------
 1364|      0|					charset = "UTF-8";
 1365|      0|					break;
 1366|      0|				default:
  ------------------
  |  Branch (1366:5): [True: 0, False: 0]
  ------------------
 1367|      0|					archive_string_sprintf(&cp, "CP%d",
 1368|      0|					    (int)archive_le32dec(extdheader));
 1369|      0|					charset = cp.s;
 1370|      0|					break;
 1371|      0|				}
 1372|      0|				lha->sconv_dir =
 1373|      0|				    archive_string_conversion_from_charset(
 1374|      0|					&(a->archive), charset, 1);
 1375|      0|				lha->sconv_fname =
 1376|      0|				    archive_string_conversion_from_charset(
 1377|      0|					&(a->archive), charset, 1);
 1378|      0|				archive_string_free(&cp);
 1379|      0|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 0]
  ------------------
 1380|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1381|      0|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1381:9): [True: 0, False: 0]
  ------------------
 1382|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1383|      0|			}
 1384|     10|			break;
 1385|     10|		case EXT_UNIX_MODE:
  ------------------
  |  | 1160|      1|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1385:3): [True: 1, False: 350]
  ------------------
 1386|      1|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1386:8): [True: 0, False: 1]
  ------------------
 1387|      0|				lha->mode = archive_le16dec(extdheader);
 1388|      0|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1389|      0|			}
 1390|      1|			break;
 1391|     29|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1161|     29|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1391:3): [True: 29, False: 322]
  ------------------
 1392|     29|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1392:8): [True: 0, False: 29]
  ------------------
 1393|      0|				lha->gid = archive_le16dec(extdheader);
 1394|      0|				lha->uid = archive_le16dec(extdheader+2);
 1395|      0|			}
 1396|     29|			break;
 1397|     57|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1162|     57|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1397:3): [True: 57, False: 294]
  ------------------
 1398|     57|			if (datasize > 0)
  ------------------
  |  Branch (1398:8): [True: 57, False: 0]
  ------------------
 1399|     57|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|     57|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1400|     57|				    (const char *)extdheader, datasize);
 1401|     57|			break;
 1402|     29|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1163|     29|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1402:3): [True: 29, False: 322]
  ------------------
 1403|     29|			if (datasize > 0)
  ------------------
  |  Branch (1403:8): [True: 29, False: 0]
  ------------------
 1404|     29|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|     29|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1405|     29|				    (const char *)extdheader, datasize);
 1406|     29|			break;
 1407|      0|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1164|      0|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1407:3): [True: 0, False: 351]
  ------------------
 1408|      0|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1408:8): [True: 0, False: 0]
  ------------------
 1409|      0|				lha->mtime = archive_le32dec(extdheader);
 1410|      0|			break;
 1411|     33|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1165|     33|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1411:3): [True: 33, False: 318]
  ------------------
 1412|       |			/* This extended header is OS/2 depend. */
 1413|     33|			if (datasize == 16) {
  ------------------
  |  Branch (1413:8): [True: 0, False: 33]
  ------------------
 1414|      0|				lha->dos_attr = (unsigned char)
 1415|      0|				    (archive_le16dec(extdheader) & 0xff);
 1416|      0|				lha->mode = archive_le16dec(extdheader+2);
 1417|      0|				lha->gid = archive_le16dec(extdheader+4);
 1418|      0|				lha->uid = archive_le16dec(extdheader+6);
 1419|      0|				lha->birthtime = archive_le32dec(extdheader+8);
 1420|      0|				lha->atime = archive_le32dec(extdheader+12);
 1421|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1422|      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
  ------------------
 1423|      0|			}
 1424|     33|			break;
 1425|      0|		case EXT_NEW_ATTR:
  ------------------
  |  | 1166|      0|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1425:3): [True: 0, False: 351]
  ------------------
 1426|      0|			if (datasize == 20) {
  ------------------
  |  Branch (1426:8): [True: 0, False: 0]
  ------------------
 1427|      0|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1428|      0|				lha->gid = archive_le32dec(extdheader+4);
 1429|      0|				lha->uid = archive_le32dec(extdheader+8);
 1430|      0|				lha->birthtime = archive_le32dec(extdheader+12);
 1431|      0|				lha->atime = archive_le32dec(extdheader+16);
 1432|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1433|      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
  ------------------
 1434|      0|			}
 1435|      0|			break;
 1436|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1156|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1436:3): [True: 0, False: 351]
  ------------------
 1437|      0|			break;
 1438|     38|		default:
  ------------------
  |  Branch (1438:3): [True: 38, False: 313]
  ------------------
 1439|     38|			break;
 1440|    351|		}
 1441|       |
 1442|    351|		__archive_read_consume(a, extdsize);
 1443|    351|	}
 1444|      0|invalid:
 1445|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1446|      0|	    "Invalid extended LHa header");
 1447|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1448|     24|}
archive_read_support_format_lha.c:lha_crc16:
 1796|     73|{
 1797|     73|	const unsigned char *p = (const unsigned char *)pp;
 1798|     73|	const uint16_t *buff;
 1799|     73|	const union {
 1800|     73|		uint32_t i;
 1801|     73|		char c[4];
 1802|     73|	} u = { 0x01020304 };
 1803|       |
 1804|     73|	if (len == 0)
  ------------------
  |  Branch (1804:6): [True: 1, False: 72]
  ------------------
 1805|      1|		return crc;
 1806|       |
 1807|       |	/* Process unaligned address. */
 1808|     72|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1808:6): [True: 2, False: 70]
  ------------------
 1809|      2|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1810|      2|		len--;
 1811|      2|	}
 1812|     72|	buff = (const uint16_t *)p;
 1813|       |	/*
 1814|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1815|       |	 * without unrolling pragma, and Clang is so. So we should
 1816|       |	 * unroll this loop for its performance.
 1817|       |	 */
 1818|  1.03M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1818:8): [True: 1.03M, False: 72]
  ------------------
 1819|       |		/* This if statement expects compiler optimization will
 1820|       |		 * remove the statement which will not be executed. */
 1821|  1.03M|#undef bswap16
 1822|       |#ifndef __has_builtin
 1823|       |#define __has_builtin(x) 0
 1824|       |#endif
 1825|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1826|       |#  define bswap16(x) _byteswap_ushort(x)
 1827|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1828|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1829|       |#  define bswap16(x) __builtin_bswap16(x)
 1830|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1831|       |/* Newer clang versions have __builtin_bswap16() */
 1832|  1.03M|#  define bswap16(x) __builtin_bswap16(x)
 1833|       |#else
 1834|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1835|       |#endif
 1836|  1.03M|#define CRC16W	do { 	\
 1837|  1.03M|		if(u.c[0] == 1) { /* Big endian */		\
 1838|  1.03M|			crc ^= bswap16(*buff); buff++;		\
 1839|  1.03M|		} else						\
 1840|  1.03M|			crc ^= *buff++;				\
 1841|  1.03M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1842|  1.03M|} while (0)
 1843|  1.03M|		CRC16W;
  ------------------
  |  | 1836|  1.03M|#define CRC16W	do { 	\
  |  | 1837|  1.03M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1837:6): [True: 0, False: 1.03M]
  |  |  ------------------
  |  | 1838|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1832|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1839|      0|		} else						\
  |  | 1840|  1.03M|			crc ^= *buff++;				\
  |  | 1841|  1.03M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1842|  1.03M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1842:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1844|  1.03M|		CRC16W;
  ------------------
  |  | 1836|  1.03M|#define CRC16W	do { 	\
  |  | 1837|  1.03M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1837:6): [True: 0, False: 1.03M]
  |  |  ------------------
  |  | 1838|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1832|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1839|      0|		} else						\
  |  | 1840|  1.03M|			crc ^= *buff++;				\
  |  | 1841|  1.03M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1842|  1.03M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1842:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1845|  1.03M|		CRC16W;
  ------------------
  |  | 1836|  1.03M|#define CRC16W	do { 	\
  |  | 1837|  1.03M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1837:6): [True: 0, False: 1.03M]
  |  |  ------------------
  |  | 1838|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1832|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1839|      0|		} else						\
  |  | 1840|  1.03M|			crc ^= *buff++;				\
  |  | 1841|  1.03M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1842|  1.03M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1842:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1846|  1.03M|		CRC16W;
  ------------------
  |  | 1836|  1.03M|#define CRC16W	do { 	\
  |  | 1837|  1.03M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1837:6): [True: 0, False: 1.03M]
  |  |  ------------------
  |  | 1838|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1832|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1839|      0|		} else						\
  |  | 1840|  1.03M|			crc ^= *buff++;				\
  |  | 1841|  1.03M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1842|  1.03M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1842:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1847|  1.03M|#undef CRC16W
 1848|  1.03M|#undef bswap16
 1849|  1.03M|	}
 1850|       |
 1851|     72|	p = (const unsigned char *)buff;
 1852|     98|	for (;len; len--) {
  ------------------
  |  Branch (1852:8): [True: 26, False: 72]
  ------------------
 1853|     26|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1854|     26|	}
 1855|     72|	return crc;
 1856|     73|}
archive_read_support_format_lha.c:lha_read_file_header_2:
 1001|      2|{
 1002|      2|	const unsigned char *p;
 1003|      2|	size_t extdsize;
 1004|      2|	int err, padding;
 1005|      2|	uint16_t header_crc;
 1006|       |
 1007|      2|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1007:6): [True: 0, False: 2]
  ------------------
 1008|      0|		return (truncated_error(a));
 1009|       |
 1010|      2|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  993|      2|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1011|      2|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  994|      2|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1012|      2|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  995|      2|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1013|      2|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  996|      2|#define H2_TIME_OFFSET		15
  ------------------
 1014|      2|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  997|      2|#define H2_CRC_OFFSET		21
  ------------------
 1015|      2|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|      2|#define CRC_IS_SET		8
  ------------------
 1016|       |
 1017|      2|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1017:6): [True: 0, False: 2]
  ------------------
 1018|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1019|      0|		    "Invalid LHa header size");
 1020|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1021|      0|	}
 1022|       |
 1023|      2|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
 1024|      2|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
 1025|       |
 1026|       |	/* Read extended headers */
 1027|      2|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1028|      2|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
 1029|      2|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  194|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1029:6): [True: 0, False: 2]
  ------------------
 1030|      0|		return (err);
 1031|       |
 1032|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1033|      2|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  998|      2|#define H2_FIXED_SIZE		24
  ------------------
 1034|      2|	if (padding > 0) {
  ------------------
  |  Branch (1034:6): [True: 0, False: 2]
  ------------------
 1035|      0|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1035:7): [True: 0, False: 0]
  ------------------
 1036|      0|			return (truncated_error(a));
 1037|      0|		header_crc = lha_crc16(header_crc, p, padding);
 1038|      0|		__archive_read_consume(a, padding);
 1039|      0|	}
 1040|       |
 1041|      2|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1041:6): [True: 2, False: 0]
  ------------------
 1042|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1043|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1044|       |		    "LHa header CRC error");
 1045|       |		return (ARCHIVE_FATAL);
 1046|       |#endif
 1047|      2|	}
 1048|      2|	return (err);
 1049|      2|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1473|     65|{
 1474|     65|	struct lha *lha = (struct lha *)(a->format->data);
 1475|     65|	int r;
 1476|       |
 1477|     65|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1477:6): [True: 63, False: 2]
  ------------------
 1478|       |		/* Consume as much as the decompressor actually used. */
 1479|     63|		__archive_read_consume(a, lha->entry_unconsumed);
 1480|     63|		lha->entry_unconsumed = 0;
 1481|     63|	}
 1482|     65|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1482:6): [True: 0, False: 65]
  ------------------
 1483|      0|		*offset = lha->entry_offset;
 1484|      0|		*size = 0;
 1485|      0|		*buff = NULL;
 1486|      0|		return (lha_end_of_entry(a));
 1487|      0|	}
 1488|       |
 1489|     65|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1489:6): [True: 65, False: 0]
  ------------------
 1490|     65|		r =  lha_read_data_lzh(a, buff, size, offset);
 1491|      0|	else
 1492|       |		/* No compression. */
 1493|      0|		r =  lha_read_data_none(a, buff, size, offset);
 1494|     65|	return (r);
 1495|     65|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1553|     65|{
 1554|     65|	struct lha *lha = (struct lha *)(a->format->data);
 1555|     65|	ssize_t bytes_avail;
 1556|     65|	int r;
 1557|       |
 1558|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1559|     65|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1559:6): [True: 2, False: 63]
  ------------------
 1560|      2|		r = lzh_decode_init(&(lha->strm), lha->method);
 1561|      2|		switch (r) {
 1562|      2|		case ARCHIVE_OK:
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1562:3): [True: 2, False: 0]
  ------------------
 1563|      2|			break;
 1564|      0|		case ARCHIVE_FAILED:
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1564:3): [True: 0, False: 2]
  ------------------
 1565|       |        		/* Unsupported compression. */
 1566|      0|			*buff = NULL;
 1567|      0|			*size = 0;
 1568|      0|			*offset = 0;
 1569|      0|			archive_set_error(&a->archive,
 1570|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1571|      0|			    "Unsupported lzh compression method -%c%c%c-",
 1572|      0|			    lha->method[0], lha->method[1], lha->method[2]);
 1573|       |			/* We know compressed size; just skip it. */
 1574|      0|			archive_read_format_lha_read_data_skip(a);
 1575|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1576|      0|		default:
  ------------------
  |  Branch (1576:3): [True: 0, False: 2]
  ------------------
 1577|      0|			archive_set_error(&a->archive, ENOMEM,
 1578|      0|			    "Couldn't allocate memory "
 1579|      0|			    "for lzh decompression");
 1580|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1581|      2|		}
 1582|       |		/* We've initialized decompression for this stream. */
 1583|      2|		lha->decompress_init = 1;
 1584|      2|		lha->strm.avail_out = 0;
 1585|      2|		lha->strm.total_out = 0;
 1586|      2|	}
 1587|       |
 1588|       |	/*
 1589|       |	 * Note: '1' here is a performance optimization.
 1590|       |	 * Recall that the decompression layer returns a count of
 1591|       |	 * available bytes; asking for more than that forces the
 1592|       |	 * decompressor to combine reads by copying data.
 1593|       |	 */
 1594|     65|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1595|     65|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1595:6): [True: 0, False: 65]
  ------------------
 1596|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1597|      0|		    "Truncated LHa file body");
 1598|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1599|      0|	}
 1600|     65|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1600:6): [True: 0, False: 65]
  ------------------
 1601|      0|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1602|       |
 1603|     65|	lha->strm.avail_in = (int)bytes_avail;
 1604|     65|	lha->strm.total_in = 0;
 1605|     65|	lha->strm.avail_out = 0;
 1606|       |
 1607|     65|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1608|     65|	switch (r) {
 1609|     63|	case ARCHIVE_OK:
  ------------------
  |  |  192|     63|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1609:2): [True: 63, False: 2]
  ------------------
 1610|     63|		break;
 1611|      0|	case ARCHIVE_EOF:
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1611:2): [True: 0, False: 65]
  ------------------
 1612|      0|		lha->end_of_entry = 1;
 1613|      0|		break;
 1614|      2|	default:
  ------------------
  |  Branch (1614:2): [True: 2, False: 63]
  ------------------
 1615|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1616|      2|		    "Bad lzh data");
 1617|      2|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1618|     65|	}
 1619|     63|	lha->entry_unconsumed = lha->strm.total_in;
 1620|     63|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1621|       |
 1622|     63|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1622:6): [True: 63, False: 0]
  ------------------
 1623|     63|		*offset = lha->entry_offset;
 1624|     63|		*size = lha->strm.avail_out;
 1625|     63|		*buff = lha->strm.ref_ptr;
 1626|     63|		lha->entry_crc_calculated =
 1627|     63|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1628|     63|		lha->entry_offset += *size;
 1629|     63|	} else {
 1630|      0|		*offset = lha->entry_offset;
 1631|      0|		*size = 0;
 1632|      0|		*buff = NULL;
 1633|      0|		if (lha->end_of_entry)
  ------------------
  |  Branch (1633:7): [True: 0, False: 0]
  ------------------
 1634|      0|			return (lha_end_of_entry(a));
 1635|      0|	}
 1636|     63|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     63|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1637|     63|}
archive_read_support_format_lha.c:lzh_decode_init:
 1868|      2|{
 1869|      2|	struct lzh_dec *ds;
 1870|      2|	int w_bits, w_size;
 1871|       |
 1872|      2|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1872:6): [True: 2, False: 0]
  ------------------
 1873|      2|		strm->ds = calloc(1, sizeof(*strm->ds));
 1874|      2|		if (strm->ds == NULL)
  ------------------
  |  Branch (1874:7): [True: 0, False: 2]
  ------------------
 1875|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1876|      2|	}
 1877|      2|	ds = strm->ds;
 1878|      2|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  196|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1879|      2|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1879:6): [True: 0, False: 2]
  |  Branch (1879:24): [True: 0, False: 2]
  |  Branch (1879:44): [True: 0, False: 2]
  ------------------
 1880|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1881|      2|	switch (method[2]) {
 1882|      2|	case '5':
  ------------------
  |  Branch (1882:2): [True: 2, False: 0]
  ------------------
 1883|      2|		w_bits = 13;/* 8KiB for window */
 1884|      2|		break;
 1885|      0|	case '6':
  ------------------
  |  Branch (1885:2): [True: 0, False: 2]
  ------------------
 1886|      0|		w_bits = 15;/* 32KiB for window */
 1887|      0|		break;
 1888|      0|	case '7':
  ------------------
  |  Branch (1888:2): [True: 0, False: 2]
  ------------------
 1889|      0|		w_bits = 16;/* 64KiB for window */
 1890|      0|		break;
 1891|      0|	default:
  ------------------
  |  Branch (1891:2): [True: 0, False: 2]
  ------------------
 1892|      0|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1893|      2|	}
 1894|      2|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1895|       |	/* Expand a window size up to 128 KiB for decompressing process
 1896|       |	 * performance whatever its original window size is. */
 1897|      2|	ds->w_size = 1U << 17;
 1898|      2|	ds->w_mask = ds->w_size -1;
 1899|      2|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1899:6): [True: 2, False: 0]
  ------------------
 1900|      2|		ds->w_buff = malloc(ds->w_size);
 1901|      2|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1901:7): [True: 0, False: 2]
  ------------------
 1902|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1903|      2|	}
 1904|      2|	w_size = 1U << w_bits;
 1905|      2|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1906|      2|	ds->w_pos = 0;
 1907|      2|	ds->state = 0;
 1908|      2|	ds->pos_pt_len_size = w_bits + 1;
 1909|      2|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1909:25): [True: 0, False: 2]
  |  Branch (1909:41): [True: 0, False: 2]
  ------------------
 1910|      2|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   64|      2|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1911|      2|	ds->literal_pt_len_bits = 5;
 1912|      2|	ds->br.cache_buffer = 0;
 1913|      2|	ds->br.cache_avail = 0;
 1914|       |
 1915|      2|	if (lzh_huffman_init(&(ds->lt), LT_BITLEN_SIZE, 16)
  ------------------
  |  |   61|      2|#define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   49|      2|#define MAXMATCH		256	/* Maximum match length. */
  |  |  ------------------
  |  |               #define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   50|      2|#define MINMATCH		3	/* Minimum match length. */
  |  |  ------------------
  ------------------
  |  Branch (1915:6): [True: 0, False: 2]
  ------------------
 1916|      2|	    != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1917|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1918|      2|	ds->lt.len_bits = 9;
 1919|      2|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   64|      2|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1919:6): [True: 0, False: 2]
  ------------------
 1920|      2|	    != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1921|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1922|      2|	ds->error = 0;
 1923|       |
 1924|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1925|      2|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2550|      4|{
 2551|      4|	int bits;
 2552|       |
 2553|      4|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2553:6): [True: 4, False: 0]
  ------------------
 2554|      4|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2555|      4|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2555:7): [True: 0, False: 4]
  ------------------
 2556|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2557|      4|	}
 2558|      4|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2558:6): [True: 4, False: 0]
  ------------------
 2559|      4|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  113|      4|#define HTBL_BITS	10
  ------------------
  |  Branch (2559:7): [True: 0, False: 4]
  ------------------
 2560|      0|			bits = tbl_bits;
 2561|      4|		else
 2562|      4|			bits = HTBL_BITS;
  ------------------
  |  |  113|      4|#define HTBL_BITS	10
  ------------------
 2563|      4|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2564|      4|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2564:7): [True: 0, False: 4]
  ------------------
 2565|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2566|      4|	}
 2567|      4|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  113|      4|#define HTBL_BITS	10
  ------------------
  |  Branch (2567:6): [True: 4, False: 0]
  |  Branch (2567:26): [True: 4, False: 0]
  ------------------
 2568|      4|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  113|      4|#define HTBL_BITS	10
  ------------------
 2569|      4|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2570|      4|		if (hf->tree == NULL)
  ------------------
  |  Branch (2570:7): [True: 0, False: 4]
  ------------------
 2571|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2572|      4|	}
 2573|      4|	hf->len_size = (int)len_size;
 2574|      4|	hf->tbl_bits = tbl_bits;
 2575|      4|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2576|      4|}
archive_read_support_format_lha.c:lzh_decode:
 2096|     65|{
 2097|     65|	struct lzh_dec *ds = strm->ds;
 2098|     65|	int avail_in;
 2099|     65|	int r;
 2100|       |
 2101|     65|	if (ds->error)
  ------------------
  |  Branch (2101:6): [True: 0, False: 65]
  ------------------
 2102|      0|		return (ds->error);
 2103|       |
 2104|     65|	avail_in = strm->avail_in;
 2105|     73|	do {
 2106|     73|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2089|     73|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2106:7): [True: 6, False: 67]
  ------------------
 2107|      6|			r = lzh_read_blocks(strm, last);
 2108|     67|		else
 2109|     67|			r = lzh_decode_blocks(strm, last);
 2110|     73|	} while (r == 100);
  ------------------
  |  Branch (2110:11): [True: 8, False: 65]
  ------------------
 2111|     65|	strm->total_in += avail_in - strm->avail_in;
 2112|     65|	return (r);
 2113|     65|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2125|      6|{
 2126|      6|	struct lzh_dec *ds = strm->ds;
 2127|      6|	struct lzh_br *br = &(ds->br);
 2128|      6|	int c = 0, i;
 2129|      6|	unsigned rbits;
 2130|       |
 2131|     22|	for (;;) {
 2132|     22|		switch (ds->state) {
  ------------------
  |  Branch (2132:11): [True: 0, False: 22]
  ------------------
 2133|      6|		case ST_RD_BLOCK:
  ------------------
  |  | 2080|      6|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2133:3): [True: 6, False: 16]
  ------------------
 2134|       |			/*
 2135|       |			 * Read a block number indicates how many blocks
 2136|       |			 * we will handle. The block is composed of a
 2137|       |			 * literal and a match, sometimes a literal only
 2138|       |			 * in particular, there are no reference data at
 2139|       |			 * the beginning of the decompression.
 2140|       |			 */
 2141|      6|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1961|      6|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1947|     12|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 2, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1961:26): [True: 4, False: 0]
  |  |  ------------------
  ------------------
 2142|      0|				if (!last)
  ------------------
  |  Branch (2142:9): [True: 0, False: 0]
  ------------------
 2143|       |					/* We need following data. */
 2144|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2145|      0|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2146|       |					/*
 2147|       |					 * It seems there are extra bits.
 2148|       |					 *  1. Compressed data is broken.
 2149|       |					 *  2. `last' flag does not properly
 2150|       |					 *     set.
 2151|       |					 */
 2152|      0|					goto failed;
 2153|      0|				}
 2154|      0|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2154:9): [True: 0, False: 0]
  ------------------
 2155|      0|					lzh_emit_window(strm, ds->w_pos);
 2156|      0|					ds->w_pos = 0;
 2157|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2158|      0|				}
 2159|       |				/* End of compressed data; we have completely
 2160|       |				 * handled all compressed data. */
 2161|      0|				return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2162|      0|			}
 2163|      6|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1950|      6|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      6|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2164|      6|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2164:8): [True: 0, False: 6]
  ------------------
 2165|      0|				goto failed;
 2166|      6|			lzh_br_consume(br, 16);
  ------------------
  |  | 1969|      6|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2167|       |			/*
 2168|       |			 * Read a literal table compressed in huffman
 2169|       |			 * coding.
 2170|       |			 */
 2171|      6|			ds->pt.len_size = ds->literal_pt_len_size;
 2172|      6|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2173|      6|			ds->reading_position = 0;
 2174|       |			/* FALL THROUGH */
 2175|     10|		case ST_RD_PT_1:
  ------------------
  |  | 2081|     10|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2175:3): [True: 4, False: 18]
  ------------------
 2176|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2177|       |			 * used in reading both a literal table and a
 2178|       |			 * position table. */
 2179|     10|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 1966|     10|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|     20|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|     20|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 10, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2180|      0|				if (last)
  ------------------
  |  Branch (2180:9): [True: 0, False: 0]
  ------------------
 2181|      0|					goto failed;/* Truncated data. */
 2182|      0|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2081|      0|#define ST_RD_PT_1		1
  ------------------
 2183|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2184|      0|			}
 2185|     10|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1950|     10|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|     10|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2186|     10|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1969|     10|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2187|       |			/* FALL THROUGH */
 2188|     10|		case ST_RD_PT_2:
  ------------------
  |  | 2082|     10|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2188:3): [True: 0, False: 22]
  ------------------
 2189|     10|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2189:8): [True: 6, False: 4]
  ------------------
 2190|       |				/* There is no bitlen. */
 2191|      6|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1966|      6|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|     12|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|     12|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 6, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2192|      6|				    ds->pt.len_bits)) {
 2193|      0|					if (last)
  ------------------
  |  Branch (2193:10): [True: 0, False: 0]
  ------------------
 2194|      0|						goto failed;/* Truncated data.*/
 2195|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2082|      0|#define ST_RD_PT_2		2
  ------------------
 2196|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2197|      0|				}
 2198|      6|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2198:9): [True: 0, False: 6]
  ------------------
 2199|      6|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1950|      6|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      6|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2200|      0|					goto failed;/* Invalid data. */
 2201|      6|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1969|      6|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2202|      6|				if (ds->reading_position)
  ------------------
  |  Branch (2202:9): [True: 3, False: 3]
  ------------------
 2203|      3|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2089|      3|#define ST_GET_LITERAL		9
  ------------------
 2204|      3|				else
 2205|      3|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2085|      3|#define ST_RD_LITERAL_1		5
  ------------------
 2206|      6|				break;
 2207|      6|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2207:15): [True: 2, False: 2]
  ------------------
 2208|      2|				goto failed;/* Invalid data. */
 2209|      2|			ds->loop = 0;
 2210|      2|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2211|      2|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2211:8): [True: 0, False: 2]
  ------------------
 2212|      2|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2212:8): [True: 1, False: 1]
  ------------------
 2213|      1|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2084|      1|#define ST_RD_PT_4		4
  ------------------
 2214|      1|				break;
 2215|      1|			}
 2216|       |			/* FALL THROUGH */
 2217|      1|		case ST_RD_PT_3:
  ------------------
  |  | 2083|      1|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2217:3): [True: 0, False: 22]
  ------------------
 2218|      1|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2219|      1|			if (ds->loop < 3) {
  ------------------
  |  Branch (2219:8): [True: 0, False: 1]
  ------------------
 2220|      0|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2220:9): [True: 0, False: 0]
  |  Branch (2220:25): [True: 0, False: 0]
  ------------------
 2221|      0|					goto failed;/* Invalid data. */
 2222|       |				/* Not completed, get following data. */
 2223|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2083|      0|#define ST_RD_PT_3		3
  ------------------
 2224|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2225|      0|			}
 2226|       |			/* There are some null in bitlen of the literal. */
 2227|      1|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 1966|      1|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      2|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      2|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2228|      0|				if (last)
  ------------------
  |  Branch (2228:9): [True: 0, False: 0]
  ------------------
 2229|      0|					goto failed;/* Truncated data. */
 2230|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2083|      0|#define ST_RD_PT_3		3
  ------------------
 2231|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2232|      0|			}
 2233|      1|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1950|      1|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      1|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2234|      1|			lzh_br_consume(br, 2);
  ------------------
  |  | 1969|      1|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2235|      1|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2235:8): [True: 0, False: 1]
  ------------------
 2236|      0|				goto failed;/* Invalid data. */
 2237|      1|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2237:16): [True: 0, False: 1]
  ------------------
 2238|      0|				ds->pt.bitlen[i++] = 0;
 2239|      1|			ds->loop = i;
 2240|       |			/* FALL THROUGH */
 2241|      2|		case ST_RD_PT_4:
  ------------------
  |  | 2084|      2|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2241:3): [True: 1, False: 21]
  ------------------
 2242|      2|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2243|      2|			    ds->pt.len_avail);
 2244|      2|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2244:8): [True: 0, False: 2]
  ------------------
 2245|      0|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2245:9): [True: 0, False: 0]
  |  Branch (2245:25): [True: 0, False: 0]
  ------------------
 2246|      0|					goto failed;/* Invalid data. */
 2247|       |				/* Not completed, get following data. */
 2248|      0|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2084|      0|#define ST_RD_PT_4		4
  ------------------
 2249|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2250|      0|			}
 2251|      2|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2251:8): [True: 0, False: 2]
  ------------------
 2252|      0|				goto failed;/* Invalid data */
 2253|      2|			if (ds->reading_position) {
  ------------------
  |  Branch (2253:8): [True: 1, False: 1]
  ------------------
 2254|      1|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2089|      1|#define ST_GET_LITERAL		9
  ------------------
 2255|      1|				break;
 2256|      1|			}
 2257|       |			/* FALL THROUGH */
 2258|      4|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2085|      4|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2258:3): [True: 3, False: 19]
  ------------------
 2259|      4|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 1966|      4|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      8|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      8|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2260|      0|				if (last)
  ------------------
  |  Branch (2260:9): [True: 0, False: 0]
  ------------------
 2261|      0|					goto failed;/* Truncated data. */
 2262|      0|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2085|      0|#define ST_RD_LITERAL_1		5
  ------------------
 2263|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2264|      0|			}
 2265|      4|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1950|      4|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      4|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2266|      4|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1969|      4|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2267|       |			/* FALL THROUGH */
 2268|      4|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2086|      4|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2268:3): [True: 0, False: 22]
  ------------------
 2269|      4|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2269:8): [True: 4, False: 0]
  ------------------
 2270|       |				/* There is no bitlen. */
 2271|      4|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1966|      4|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      8|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      8|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 3, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2272|      4|				    ds->lt.len_bits)) {
 2273|      0|					if (last)
  ------------------
  |  Branch (2273:10): [True: 0, False: 0]
  ------------------
 2274|      0|						goto failed;/* Truncated data.*/
 2275|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2086|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2276|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2277|      0|				}
 2278|      4|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2278:9): [True: 0, False: 4]
  ------------------
 2279|      4|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1950|      4|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      4|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2280|      0|					goto failed;/* Invalid data */
 2281|      4|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1969|      4|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2282|      4|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2088|      4|#define ST_RD_POS_DATA_1	8
  ------------------
 2283|      4|				break;
 2284|      4|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2284:15): [True: 0, False: 0]
  ------------------
 2285|      0|				goto failed;/* Invalid data */
 2286|      0|			ds->loop = 0;
 2287|      0|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2288|       |			/* FALL THROUGH */
 2289|      0|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2087|      0|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2289:3): [True: 0, False: 22]
  ------------------
 2290|      0|			i = ds->loop;
 2291|      0|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2291:11): [True: 0, False: 0]
  ------------------
 2292|      0|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1966|      0|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      0|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2293|      0|				    ds->pt.max_bits)) {
 2294|      0|					if (last)
  ------------------
  |  Branch (2294:10): [True: 0, False: 0]
  ------------------
 2295|      0|						goto failed;/* Truncated data.*/
 2296|      0|					ds->loop = i;
 2297|      0|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2087|      0|#define ST_RD_LITERAL_3		7
  ------------------
 2298|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2299|      0|				}
 2300|      0|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1950|      0|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2301|      0|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2302|      0|				if (c > 2) {
  ------------------
  |  Branch (2302:9): [True: 0, False: 0]
  ------------------
 2303|       |					/* Note: 'c' will never be more than
 2304|       |					 * eighteen since it's limited by
 2305|       |					 * PT_BITLEN_SIZE, which is being set
 2306|       |					 * to ds->pt.len_size through
 2307|       |					 * ds->literal_pt_len_size. */
 2308|      0|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2309|      0|					c -= 2;
 2310|      0|					ds->lt.freq[c]++;
 2311|      0|					ds->lt.bitlen[i++] = c;
 2312|      0|				} else if (c == 0) {
  ------------------
  |  Branch (2312:16): [True: 0, False: 0]
  ------------------
 2313|      0|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2314|      0|					ds->lt.bitlen[i++] = 0;
 2315|      0|				} else {
 2316|       |					/* c == 1 or c == 2 */
 2317|      0|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2317:14): [True: 0, False: 0]
  ------------------
 2318|      0|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1966|      0|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      0|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|      0|					     ds->pt.bitlen[c] + n)) {
 2320|      0|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2320:11): [True: 0, False: 0]
  ------------------
 2321|      0|							goto failed;
 2322|      0|						ds->loop = i;
 2323|      0|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2087|      0|#define ST_RD_LITERAL_3		7
  ------------------
 2324|      0|						return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2325|      0|					}
 2326|      0|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2327|      0|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1950|      0|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2328|      0|					lzh_br_consume(br, n);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2329|      0|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2329:11): [True: 0, False: 0]
  ------------------
 2330|      0|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2330:10): [True: 0, False: 0]
  ------------------
 2331|      0|						goto failed;/* Invalid data */
 2332|      0|					memset(&(ds->lt.bitlen[i]), 0, c);
 2333|      0|					i += c;
 2334|      0|				}
 2335|      0|			}
 2336|      0|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2336:8): [True: 0, False: 0]
  ------------------
 2337|      0|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2337:8): [True: 0, False: 0]
  ------------------
 2338|      0|				goto failed;/* Invalid data */
 2339|       |			/* FALL THROUGH */
 2340|      4|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2088|      4|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2340:3): [True: 4, False: 18]
  ------------------
 2341|       |			/*
 2342|       |			 * Read a position table compressed in huffman
 2343|       |			 * coding.
 2344|       |			 */
 2345|      4|			ds->pt.len_size = ds->pos_pt_len_size;
 2346|      4|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2347|      4|			ds->reading_position = 1;
 2348|      4|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2081|      4|#define ST_RD_PT_1		1
  ------------------
 2349|      4|			break;
 2350|      4|		case ST_GET_LITERAL:
  ------------------
  |  | 2089|      4|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2350:3): [True: 4, False: 18]
  ------------------
 2351|      4|			return (100);
 2352|     22|		}
 2353|     22|	}
 2354|      2|failed:
 2355|      2|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  196|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2356|      6|}
archive_read_support_format_lha.c:lzh_br_fillup:
 1989|  19.6k|{
 1990|  19.6k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   91|  19.6k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 1991|       |
 1992|  19.6k|	for (;;) {
 1993|  19.6k|		const int x = n >> 3;
 1994|  19.6k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (1994:7): [True: 19.6k, False: 0]
  ------------------
 1995|  19.6k|			switch (x) {
 1996|    439|			case 8:
  ------------------
  |  Branch (1996:4): [True: 439, False: 19.2k]
  ------------------
 1997|    439|				br->cache_buffer =
 1998|    439|				    ((uint64_t)strm->next_in[0]) << 56 |
 1999|    439|				    ((uint64_t)strm->next_in[1]) << 48 |
 2000|    439|				    ((uint64_t)strm->next_in[2]) << 40 |
 2001|    439|				    ((uint64_t)strm->next_in[3]) << 32 |
 2002|    439|				    ((uint32_t)strm->next_in[4]) << 24 |
 2003|    439|				    ((uint32_t)strm->next_in[5]) << 16 |
 2004|    439|				    ((uint32_t)strm->next_in[6]) << 8 |
 2005|    439|				     (uint32_t)strm->next_in[7];
 2006|    439|				strm->next_in += 8;
 2007|    439|				strm->avail_in -= 8;
 2008|    439|				br->cache_avail += 8 * 8;
 2009|    439|				return (1);
 2010|  2.90k|			case 7:
  ------------------
  |  Branch (2010:4): [True: 2.90k, False: 16.7k]
  ------------------
 2011|  2.90k|				br->cache_buffer =
 2012|  2.90k|		 		   (br->cache_buffer << 56) |
 2013|  2.90k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2014|  2.90k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2015|  2.90k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2016|  2.90k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2017|  2.90k|				    ((uint64_t)strm->next_in[4]) << 16 |
 2018|  2.90k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2019|  2.90k|				     (uint64_t)strm->next_in[6];
 2020|  2.90k|				strm->next_in += 7;
 2021|  2.90k|				strm->avail_in -= 7;
 2022|  2.90k|				br->cache_avail += 7 * 8;
 2023|  2.90k|				return (1);
 2024|  16.3k|			case 6:
  ------------------
  |  Branch (2024:4): [True: 16.3k, False: 3.34k]
  ------------------
 2025|  16.3k|				br->cache_buffer =
 2026|  16.3k|		 		   (br->cache_buffer << 48) |
 2027|  16.3k|				    ((uint64_t)strm->next_in[0]) << 40 |
 2028|  16.3k|				    ((uint64_t)strm->next_in[1]) << 32 |
 2029|  16.3k|				    ((uint64_t)strm->next_in[2]) << 24 |
 2030|  16.3k|				    ((uint64_t)strm->next_in[3]) << 16 |
 2031|  16.3k|				    ((uint64_t)strm->next_in[4]) << 8 |
 2032|  16.3k|				     (uint64_t)strm->next_in[5];
 2033|  16.3k|				strm->next_in += 6;
 2034|  16.3k|				strm->avail_in -= 6;
 2035|  16.3k|				br->cache_avail += 6 * 8;
 2036|  16.3k|				return (1);
 2037|      0|			case 0:
  ------------------
  |  Branch (2037:4): [True: 0, False: 19.6k]
  ------------------
 2038|       |				/* We have enough compressed data in
 2039|       |				 * the cache buffer.*/
 2040|      0|				return (1);
 2041|      0|			default:
  ------------------
  |  Branch (2041:4): [True: 0, False: 19.6k]
  ------------------
 2042|      0|				break;
 2043|  19.6k|			}
 2044|  19.6k|		}
 2045|      0|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2045:7): [True: 0, False: 0]
  ------------------
 2046|       |			/* There is not enough compressed data to fill up the
 2047|       |			 * cache buffer. */
 2048|      0|			return (0);
 2049|      0|		}
 2050|      0|		br->cache_buffer =
 2051|      0|		   (br->cache_buffer << 8) | *strm->next_in++;
 2052|      0|		strm->avail_in--;
 2053|      0|		br->cache_avail += 8;
 2054|      0|		n -= 8;
 2055|      0|	}
 2056|  19.6k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2117|     63|{
 2118|     63|	strm->ref_ptr = strm->ds->w_buff;
 2119|     63|	strm->avail_out = (int)s;
 2120|     63|	strm->total_out += s;
 2121|     63|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2692|     10|{
 2693|     10|	if (c >= hf->len_size)
  ------------------
  |  Branch (2693:6): [True: 0, False: 10]
  ------------------
 2694|      0|		return (0);
 2695|     10|	hf->tbl[0] = c;
 2696|     10|	hf->max_bits = 0;
 2697|     10|	hf->shift_bits = 0;
 2698|     10|	hf->bitlen[hf->tbl[0]] = 0;
 2699|     10|	return (1);
 2700|     10|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2654|      3|{
 2655|      3|	struct lzh_dec *ds = strm->ds;
 2656|      3|	struct lzh_br *br = &(ds->br);
 2657|      3|	int c, i;
 2658|       |
 2659|     19|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2659:18): [True: 16, False: 3]
  ------------------
 2660|       |		/*
 2661|       |		 *  bit pattern     the number we need
 2662|       |		 *     000           ->  0
 2663|       |		 *     001           ->  1
 2664|       |		 *     010           ->  2
 2665|       |		 *     ...
 2666|       |		 *     110           ->  6
 2667|       |		 *     1110          ->  7
 2668|       |		 *     11110         ->  8
 2669|       |		 *     ...
 2670|       |		 *     1111111111110 ->  16
 2671|       |		 */
 2672|     16|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 1966|     16|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|     32|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|     32|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 15, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2673|      0|			return (i);
 2674|     16|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1950|     16|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|     16|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2674:7): [True: 0, False: 16]
  ------------------
 2675|      0|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 1966|      0|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|      0|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2676|      0|				return (i);
 2677|      0|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1950|      0|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2678|      0|			if (c)
  ------------------
  |  Branch (2678:8): [True: 0, False: 0]
  ------------------
 2679|      0|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2680|      0|			else
 2681|      0|				return (-1);/* Invalid data. */
 2682|      0|		} else
 2683|     16|			lzh_br_consume(br, 3);
  ------------------
  |  | 1969|     16|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2684|     16|		ds->pt.bitlen[i++] = c;
 2685|     16|		ds->pt.freq[c]++;
 2686|     16|	}
 2687|      3|	return (i);
 2688|      3|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2707|      2|{
 2708|      2|	uint16_t *tbl;
 2709|      2|	const unsigned char *bitlen;
 2710|      2|	int bitptn[17], weight[17];
 2711|      2|	int i, maxbits = 0, ptn, tbl_size, w;
 2712|      2|	int diffbits, len_avail;
 2713|       |
 2714|       |	/*
 2715|       |	 * Initialize bit patterns.
 2716|       |	 */
 2717|      2|	ptn = 0;
 2718|     34|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2718:27): [True: 32, False: 2]
  ------------------
 2719|     32|		bitptn[i] = ptn;
 2720|     32|		weight[i] = w;
 2721|     32|		if (hf->freq[i]) {
  ------------------
  |  Branch (2721:7): [True: 8, False: 24]
  ------------------
 2722|      8|			ptn += hf->freq[i] * w;
 2723|      8|			maxbits = i;
 2724|      8|		}
 2725|     32|	}
 2726|      2|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2726:6): [True: 0, False: 2]
  |  Branch (2726:24): [True: 0, False: 2]
  ------------------
 2727|      0|		return (0);/* Invalid */
 2728|       |
 2729|      2|	hf->max_bits = maxbits;
 2730|       |
 2731|       |	/*
 2732|       |	 * Cut out extra bits which we won't house in the table.
 2733|       |	 * This preparation reduces the same calculation in the for-loop
 2734|       |	 * making the table.
 2735|       |	 */
 2736|      2|	if (maxbits < 16) {
  ------------------
  |  Branch (2736:6): [True: 2, False: 0]
  ------------------
 2737|      2|		int ebits = 16 - maxbits;
 2738|     11|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2738:15): [True: 9, False: 2]
  ------------------
 2739|      9|			bitptn[i] >>= ebits;
 2740|      9|			weight[i] >>= ebits;
 2741|      9|		}
 2742|      2|	}
 2743|      2|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  113|      2|#define HTBL_BITS	10
  ------------------
  |  Branch (2743:6): [True: 0, False: 2]
  ------------------
 2744|      0|		unsigned htbl_max;
 2745|      0|		uint16_t *p;
 2746|       |
 2747|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
 2748|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2748:15): [True: 0, False: 0]
  ------------------
 2749|      0|			bitptn[i] >>= diffbits;
 2750|      0|			weight[i] >>= diffbits;
 2751|      0|		}
 2752|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
 2753|      0|		    weight[HTBL_BITS] * hf->freq[HTBL_BITS];
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
              		    weight[HTBL_BITS] * hf->freq[HTBL_BITS];
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
 2754|      0|		p = &(hf->tbl[htbl_max]);
 2755|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2755:10): [True: 0, False: 0]
  ------------------
 2756|      0|			*p++ = 0;
 2757|      0|	} else
 2758|      2|		diffbits = 0;
 2759|      2|	hf->shift_bits = diffbits;
 2760|       |
 2761|       |	/*
 2762|       |	 * Make the table.
 2763|       |	 */
 2764|      2|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  113|      2|#define HTBL_BITS	10
  ------------------
 2765|      2|	tbl = hf->tbl;
 2766|      2|	bitlen = hf->bitlen;
 2767|      2|	len_avail = hf->len_avail;
 2768|      2|	hf->tree_used = 0;
 2769|     18|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2769:14): [True: 16, False: 2]
  ------------------
 2770|     16|		uint16_t *p;
 2771|     16|		int len, cnt;
 2772|     16|		uint16_t bit;
 2773|     16|		int extlen;
 2774|     16|		struct htree_t *ht;
 2775|       |
 2776|     16|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2776:7): [True: 3, False: 13]
  ------------------
 2777|      3|			continue;
 2778|       |		/* Get a bit pattern */
 2779|     13|		len = bitlen[i];
 2780|     13|		ptn = bitptn[len];
 2781|     13|		cnt = weight[len];
 2782|     13|		if (len <= HTBL_BITS) {
  ------------------
  |  |  113|     13|#define HTBL_BITS	10
  ------------------
  |  Branch (2782:7): [True: 13, False: 0]
  ------------------
 2783|       |			/* Calculate next bit pattern */
 2784|     13|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2784:8): [True: 0, False: 13]
  ------------------
 2785|      0|				return (0);/* Invalid */
 2786|       |			/* Update the table */
 2787|     13|			p = &(tbl[ptn]);
 2788|     13|			if (cnt > 7) {
  ------------------
  |  Branch (2788:8): [True: 2, False: 11]
  ------------------
 2789|      2|				uint16_t *pc;
 2790|       |
 2791|      2|				cnt -= 8;
 2792|      2|				pc = &p[cnt];
 2793|      2|				pc[0] = (uint16_t)i;
 2794|      2|				pc[1] = (uint16_t)i;
 2795|      2|				pc[2] = (uint16_t)i;
 2796|      2|				pc[3] = (uint16_t)i;
 2797|      2|				pc[4] = (uint16_t)i;
 2798|      2|				pc[5] = (uint16_t)i;
 2799|      2|				pc[6] = (uint16_t)i;
 2800|      2|				pc[7] = (uint16_t)i;
 2801|      2|				if (cnt > 7) {
  ------------------
  |  Branch (2801:9): [True: 1, False: 1]
  ------------------
 2802|      1|					cnt -= 8;
 2803|      1|					memcpy(&p[cnt], pc,
 2804|      1|						8 * sizeof(uint16_t));
 2805|      1|					pc = &p[cnt];
 2806|      1|					while (cnt > 15) {
  ------------------
  |  Branch (2806:13): [True: 0, False: 1]
  ------------------
 2807|      0|						cnt -= 16;
 2808|      0|						memcpy(&p[cnt], pc,
 2809|      0|							16 * sizeof(uint16_t));
 2810|      0|					}
 2811|      1|				}
 2812|      2|				if (cnt)
  ------------------
  |  Branch (2812:9): [True: 0, False: 2]
  ------------------
 2813|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2814|     11|			} else {
 2815|     21|				while (cnt > 1) {
  ------------------
  |  Branch (2815:12): [True: 10, False: 11]
  ------------------
 2816|     10|					p[--cnt] = (uint16_t)i;
 2817|     10|					p[--cnt] = (uint16_t)i;
 2818|     10|				}
 2819|     11|				if (cnt)
  ------------------
  |  Branch (2819:9): [True: 4, False: 7]
  ------------------
 2820|      4|					p[--cnt] = (uint16_t)i;
 2821|     11|			}
 2822|     13|			continue;
 2823|     13|		}
 2824|       |
 2825|       |		/*
 2826|       |		 * A bit length is too big to be housed to a direct table,
 2827|       |		 * so we use a tree model for its extra bits.
 2828|       |		 */
 2829|      0|		bitptn[len] = ptn + cnt;
 2830|      0|		bit = 1U << (diffbits -1);
 2831|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  113|      0|#define HTBL_BITS	10
  ------------------
 2832|       |		
 2833|      0|		p = &(tbl[ptn >> diffbits]);
 2834|      0|		if (*p == 0) {
  ------------------
  |  Branch (2834:7): [True: 0, False: 0]
  ------------------
 2835|      0|			*p = len_avail + hf->tree_used;
 2836|      0|			ht = &(hf->tree[hf->tree_used++]);
 2837|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2837:8): [True: 0, False: 0]
  ------------------
 2838|      0|				return (0);/* Invalid */
 2839|      0|			ht->left = 0;
 2840|      0|			ht->right = 0;
 2841|      0|		} else {
 2842|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2842:8): [True: 0, False: 0]
  ------------------
 2843|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2843:8): [True: 0, False: 0]
  ------------------
 2844|      0|				return (0);/* Invalid */
 2845|      0|			ht = &(hf->tree[*p - len_avail]);
 2846|      0|		}
 2847|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2847:10): [True: 0, False: 0]
  ------------------
 2848|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2848:8): [True: 0, False: 0]
  ------------------
 2849|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2849:9): [True: 0, False: 0]
  ------------------
 2850|      0|					ht->left = len_avail + hf->tree_used;
 2851|      0|					ht = &(hf->tree[hf->tree_used++]);
 2852|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2852:10): [True: 0, False: 0]
  ------------------
 2853|      0|						return (0);/* Invalid */
 2854|      0|					ht->left = 0;
 2855|      0|					ht->right = 0;
 2856|      0|				} else {
 2857|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2858|      0|				}
 2859|      0|			} else {
 2860|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 0]
  ------------------
 2861|      0|					ht->right = len_avail + hf->tree_used;
 2862|      0|					ht = &(hf->tree[hf->tree_used++]);
 2863|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2863:10): [True: 0, False: 0]
  ------------------
 2864|      0|						return (0);/* Invalid */
 2865|      0|					ht->left = 0;
 2866|      0|					ht->right = 0;
 2867|      0|				} else {
 2868|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2869|      0|				}
 2870|      0|			}
 2871|      0|			bit >>= 1;
 2872|      0|		}
 2873|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2873:7): [True: 0, False: 0]
  ------------------
 2874|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2874:8): [True: 0, False: 0]
  ------------------
 2875|      0|				return (0);/* Invalid */
 2876|      0|			ht->left = (uint16_t)i;
 2877|      0|		} else {
 2878|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2878:8): [True: 0, False: 0]
  ------------------
 2879|      0|				return (0);/* Invalid */
 2880|      0|			ht->right = (uint16_t)i;
 2881|      0|		}
 2882|      0|	}
 2883|      2|	return (1);
 2884|      2|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2908|   277k|{
 2909|   277k|	int c;
 2910|       |	/*
 2911|       |	 * At first search an index table for a bit pattern.
 2912|       |	 * If it fails, search a huffman tree for.
 2913|       |	 */
 2914|   277k|	c = hf->tbl[rbits >> hf->shift_bits];
 2915|   277k|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2915:6): [True: 63.4k, False: 213k]
  |  Branch (2915:27): [True: 213k, False: 0]
  ------------------
 2916|   277k|		return (c);
 2917|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2918|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2919|   277k|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2360|     67|{
 2361|     67|	struct lzh_dec *ds = strm->ds;
 2362|     67|	struct lzh_br bre = ds->br;
 2363|     67|	struct huffman *lt = &(ds->lt);
 2364|     67|	struct huffman *pt = &(ds->pt);
 2365|     67|	unsigned char *w_buff = ds->w_buff;
 2366|     67|	unsigned char *lt_bitlen = lt->bitlen;
 2367|     67|	unsigned char *pt_bitlen = pt->bitlen;
 2368|     67|	int blocks_avail = ds->blocks_avail, c = 0;
 2369|     67|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2370|     67|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2371|     67|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2372|     67|	int state = ds->state;
 2373|       |
 2374|   129k|	for (;;) {
 2375|   129k|		switch (state) {
  ------------------
  |  Branch (2375:11): [True: 0, False: 129k]
  ------------------
 2376|   128k|		case ST_GET_LITERAL:
  ------------------
  |  | 2089|   128k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2376:3): [True: 128k, False: 62]
  ------------------
 2377|   148k|			for (;;) {
 2378|   148k|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2378:9): [True: 4, False: 148k]
  ------------------
 2379|       |					/* We have decoded all blocks.
 2380|       |					 * Let's handle next blocks. */
 2381|      4|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2080|      4|#define ST_RD_BLOCK		0
  ------------------
 2382|      4|					ds->br = bre;
 2383|      4|					ds->blocks_avail = 0;
 2384|      4|					ds->w_pos = w_pos;
 2385|      4|					ds->copy_pos = 0;
 2386|      4|					return (100);
 2387|      4|				}
 2388|       |
 2389|       |				/* lzh_br_read_ahead() always tries to fill the
 2390|       |				 * cache buffer up. In specific situation we
 2391|       |				 * are close to the end of the data, the cache
 2392|       |				 * buffer will not be full and thus we have to
 2393|       |				 * determine if the cache buffer has some bits
 2394|       |				 * as much as we need after lzh_br_read_ahead()
 2395|       |				 * failed. */
 2396|   148k|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 1966|   148k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|   296k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|   296k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 148k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2397|   148k|				    lt_max_bits)) {
 2398|      0|					if (!last)
  ------------------
  |  Branch (2398:10): [True: 0, False: 0]
  ------------------
 2399|      0|						goto next_data;
 2400|       |					/* Remaining bits are less than
 2401|       |					 * maximum bits(lt.max_bits) but maybe
 2402|       |					 * it still remains as much as we need,
 2403|       |					 * so we should try to use it with
 2404|       |					 * dummy bits. */
 2405|      0|					c = lzh_decode_huffman(lt,
 2406|      0|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1953|      0|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1954|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2407|      0|					        lt_max_bits));
 2408|      0|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2409|      0|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2409:10): [True: 0, False: 0]
  ------------------
 2410|      0|						goto failed;/* Over read. */
 2411|   148k|				} else {
 2412|   148k|					c = lzh_decode_huffman(lt,
 2413|   148k|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1950|   148k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|   148k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2414|   148k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1969|   148k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2415|   148k|				}
 2416|   148k|				blocks_avail--;
 2417|   148k|				if (c > UCHAR_MAX)
  ------------------
  |  Branch (2417:9): [True: 128k, False: 19.1k]
  ------------------
 2418|       |					/* Current block is a match data. */
 2419|   128k|					break;
 2420|       |				/*
 2421|       |				 * 'c' is exactly a literal code.
 2422|       |				 */
 2423|       |				/* Save a decoded code to reference it
 2424|       |				 * afterward. */
 2425|  19.1k|				w_buff[w_pos] = c;
 2426|  19.1k|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2426:9): [True: 0, False: 19.1k]
  ------------------
 2427|      0|					w_pos = 0;
 2428|      0|					lzh_emit_window(strm, w_size);
 2429|      0|					goto next_data;
 2430|      0|				}
 2431|  19.1k|			}
 2432|       |			/* 'c' is the length of a match pattern we have
 2433|       |			 * already extracted, which has be stored in
 2434|       |			 * window(ds->w_buff). */
 2435|   128k|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   50|   128k|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2436|       |			/* FALL THROUGH */
 2437|   128k|		case ST_GET_POS_1:
  ------------------
  |  | 2090|   128k|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2437:3): [True: 0, False: 129k]
  ------------------
 2438|       |			/*
 2439|       |			 * Get a reference position. 
 2440|       |			 */
 2441|   128k|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 1966|   128k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|   257k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|   257k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 126k, False: 2.90k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 2.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2442|      0|				if (!last) {
  ------------------
  |  Branch (2442:9): [True: 0, False: 0]
  ------------------
 2443|      0|					state = ST_GET_POS_1;
  ------------------
  |  | 2090|      0|#define ST_GET_POS_1		10
  ------------------
 2444|      0|					ds->copy_len = copy_len;
 2445|      0|					goto next_data;
 2446|      0|				}
 2447|      0|				copy_pos = lzh_decode_huffman(pt,
 2448|      0|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1953|      0|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1954|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2449|      0|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1969|      0|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2450|      0|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2450:9): [True: 0, False: 0]
  ------------------
 2451|      0|					goto failed;/* Over read. */
 2452|   128k|			} else {
 2453|   128k|				copy_pos = lzh_decode_huffman(pt,
 2454|   128k|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1950|   128k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|   128k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2455|   128k|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1969|   128k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2456|   128k|			}
 2457|       |			/* FALL THROUGH */
 2458|   128k|		case ST_GET_POS_2:
  ------------------
  |  | 2091|   128k|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2458:3): [True: 0, False: 129k]
  ------------------
 2459|   128k|			if (copy_pos > 1) {
  ------------------
  |  Branch (2459:8): [True: 86.8k, False: 42.1k]
  ------------------
 2460|       |				/* We need an additional adjustment number to
 2461|       |				 * the position. */
 2462|  86.8k|				int p = copy_pos - 1;
 2463|  86.8k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 1966|  86.8k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1961|   173k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1947|   173k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1947:27): [True: 70.0k, False: 16.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1961:26): [True: 16.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1947|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1947:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2464|      0|					if (last)
  ------------------
  |  Branch (2464:10): [True: 0, False: 0]
  ------------------
 2465|      0|						goto failed;/* Truncated data.*/
 2466|      0|					state = ST_GET_POS_2;
  ------------------
  |  | 2091|      0|#define ST_GET_POS_2		11
  ------------------
 2467|      0|					ds->copy_len = copy_len;
 2468|      0|					ds->copy_pos = copy_pos;
 2469|      0|					goto next_data;
 2470|      0|				}
 2471|  86.8k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1950|  86.8k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1951|  86.8k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2472|  86.8k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 1969|  86.8k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2473|  86.8k|			}
 2474|       |			/* The position is actually a distance from the last
 2475|       |			 * code we had extracted and thus we have to convert
 2476|       |			 * it to a position of the window. */
 2477|   128k|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2478|       |			/* FALL THROUGH */
 2479|   129k|		case ST_COPY_DATA:
  ------------------
  |  | 2092|   129k|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2479:3): [True: 62, False: 128k]
  ------------------
 2480|       |			/*
 2481|       |			 * Copy `copy_len' bytes as extracted data from
 2482|       |			 * the window into the output buffer.
 2483|       |			 */
 2484|   129k|			for (;;) {
 2485|   129k|				int l;
 2486|       |
 2487|   129k|				l = copy_len;
 2488|   129k|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2488:9): [True: 3.17k, False: 125k]
  ------------------
 2489|  3.17k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2489:10): [True: 67, False: 3.10k]
  ------------------
 2490|     67|						l = w_size - copy_pos;
 2491|   125k|				} else {
 2492|   125k|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2492:10): [True: 62, False: 125k]
  ------------------
 2493|     62|						l = w_size - w_pos;
 2494|   125k|				}
 2495|   129k|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2495:9): [True: 62.3k, False: 66.7k]
  ------------------
 2496|   129k|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2496:12): [True: 3.17k, False: 63.6k]
  ------------------
 2497|       |					/* No overlap. */
 2498|  65.4k|					memcpy(w_buff + w_pos,
 2499|  65.4k|					    w_buff + copy_pos, l);
 2500|  65.4k|				} else {
 2501|  63.6k|					const unsigned char *s;
 2502|  63.6k|					unsigned char *d;
 2503|  63.6k|					int li;
 2504|       |
 2505|  63.6k|					d = w_buff + w_pos;
 2506|  63.6k|					s = w_buff + copy_pos;
 2507|  2.03M|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2507:19): [True: 1.96M, False: 63.6k]
  ------------------
 2508|  1.96M|						d[li] = s[li];li++;
 2509|  1.96M|						d[li] = s[li];li++;
 2510|  1.96M|					}
 2511|  63.6k|					if (li < l)
  ------------------
  |  Branch (2511:10): [True: 63.5k, False: 37]
  ------------------
 2512|  63.5k|						d[li] = s[li];
 2513|  63.6k|				}
 2514|   129k|				w_pos += l;
 2515|   129k|				if (w_pos == w_size) {
  ------------------
  |  Branch (2515:9): [True: 63, False: 129k]
  ------------------
 2516|     63|					w_pos = 0;
 2517|     63|					lzh_emit_window(strm, w_size);
 2518|     63|					if (copy_len <= l)
  ------------------
  |  Branch (2518:10): [True: 1, False: 62]
  ------------------
 2519|      1|						state = ST_GET_LITERAL;
  ------------------
  |  | 2089|      1|#define ST_GET_LITERAL		9
  ------------------
 2520|     62|					else {
 2521|     62|						state = ST_COPY_DATA;
  ------------------
  |  | 2092|     62|#define ST_COPY_DATA		12
  ------------------
 2522|     62|						ds->copy_len = copy_len - l;
 2523|     62|						ds->copy_pos =
 2524|     62|						    (copy_pos + l) & w_mask;
 2525|     62|					}
 2526|     63|					goto next_data;
 2527|     63|				}
 2528|   129k|				if (copy_len <= l)
  ------------------
  |  Branch (2528:9): [True: 128k, False: 67]
  ------------------
 2529|       |					/* A copy of current pattern ended. */
 2530|   128k|					break;
 2531|     67|				copy_len -= l;
 2532|     67|				copy_pos = (copy_pos + l) & w_mask;
 2533|     67|			}
 2534|   128k|			state = ST_GET_LITERAL;
  ------------------
  |  | 2089|   128k|#define ST_GET_LITERAL		9
  ------------------
 2535|   128k|			break;
 2536|   129k|		}
 2537|   129k|	}
 2538|      0|failed:
 2539|      0|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2540|     63|next_data:
 2541|     63|	ds->br = bre;
 2542|     63|	ds->blocks_avail = blocks_avail;
 2543|     63|	ds->state = state;
 2544|     63|	ds->w_pos = w_pos;
 2545|     63|	return (ARCHIVE_OK);
  ------------------
  |  |  192|     63|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2546|     67|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1644|      2|{
 1645|      2|	struct lha *lha;
 1646|      2|	int64_t bytes_skipped;
 1647|       |
 1648|      2|	lha = (struct lha *)(a->format->data);
 1649|       |
 1650|      2|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1650:6): [True: 0, False: 2]
  ------------------
 1651|       |		/* Consume as much as the decompressor actually used. */
 1652|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1653|      0|		lha->entry_unconsumed = 0;
 1654|      0|	}
 1655|       |
 1656|       |	/* if we've already read to end of data, we're done. */
 1657|      2|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1657:6): [True: 0, False: 2]
  ------------------
 1658|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1659|       |
 1660|       |	/*
 1661|       |	 * If the length is at the beginning, we can skip the
 1662|       |	 * compressed data much more quickly.
 1663|       |	 */
 1664|      2|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1665|      2|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1665:6): [True: 2, False: 0]
  ------------------
 1666|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1667|       |
 1668|       |	/* This entry is finished and done. */
 1669|      0|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1670|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1671|      2|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1675|    238|{
 1676|    238|	struct lha *lha = (struct lha *)(a->format->data);
 1677|       |
 1678|    238|	lzh_decode_free(&(lha->strm));
 1679|    238|	archive_string_free(&(lha->dirname));
 1680|    238|	archive_string_free(&(lha->filename));
 1681|    238|	archive_string_free(&(lha->uname));
 1682|    238|	archive_string_free(&(lha->gname));
 1683|    238|	archive_wstring_free(&(lha->ws));
 1684|    238|	free(lha);
 1685|    238|	(a->format->data) = NULL;
 1686|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1687|    238|}
archive_read_support_format_lha.c:lzh_decode_free:
 1932|    238|{
 1933|       |
 1934|    238|	if (strm->ds == NULL)
  ------------------
  |  Branch (1934:6): [True: 236, False: 2]
  ------------------
 1935|    236|		return;
 1936|      2|	free(strm->ds->w_buff);
 1937|      2|	lzh_huffman_free(&(strm->ds->lt));
 1938|      2|	lzh_huffman_free(&(strm->ds->pt));
 1939|      2|	free(strm->ds);
 1940|      2|	strm->ds = NULL;
 1941|      2|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2580|      4|{
 2581|      4|	free(hf->bitlen);
 2582|      4|	free(hf->tbl);
 2583|      4|	free(hf->tree);
 2584|      4|}

archive_read_support_format_mtree:
  265|    238|{
  266|    238|	static const struct archive_rb_tree_ops rb_ops = {
  267|    238|		mtree_cmp_node, mtree_cmp_key,
  268|    238|	};
  269|    238|	struct archive_read *a = (struct archive_read *)_a;
  270|    238|	struct mtree *mtree;
  271|    238|	int r;
  272|       |
  273|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  275|       |
  276|    238|	mtree = (struct mtree *)calloc(1, sizeof(*mtree));
  277|    238|	if (mtree == NULL) {
  ------------------
  |  Branch (277:6): [True: 0, False: 238]
  ------------------
  278|      0|		archive_set_error(&a->archive, ENOMEM,
  279|      0|		    "Can't allocate mtree data");
  280|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  281|      0|	}
  282|    238|	mtree->checkfs = 0;
  283|    238|	mtree->fd = -1;
  284|       |
  285|    238|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  286|       |
  287|    238|	r = __archive_read_register_format(a, mtree, "mtree",
  288|    238|           mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL);
  289|       |
  290|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (290:6): [True: 0, False: 238]
  ------------------
  291|      0|		free(mtree);
  292|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  293|    238|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  248|  9.91k|{
  249|  9.91k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  250|  9.91k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  251|       |
  252|  9.91k|	return (strcmp(e1->name, e2->name));
  253|  9.91k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  257|  9.93k|{
  258|  9.93k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  259|       |
  260|  9.93k|	return (strcmp(e->name, key));
  261|  9.93k|}
archive_read_support_format_mtree.c:cleanup:
  297|    238|{
  298|    238|	struct mtree *mtree;
  299|    238|	struct mtree_entry *p, *q;
  300|       |
  301|    238|	mtree = (struct mtree *)(a->format->data);
  302|       |
  303|    238|	p = mtree->entries;
  304|  7.14k|	while (p != NULL) {
  ------------------
  |  Branch (304:9): [True: 6.90k, False: 238]
  ------------------
  305|  6.90k|		q = p->next;
  306|  6.90k|		free(p->name);
  307|  6.90k|		free_options(p->options);
  308|  6.90k|		free(p);
  309|  6.90k|		p = q;
  310|  6.90k|	}
  311|    238|	archive_string_free(&mtree->line);
  312|    238|	archive_string_free(&mtree->current_dir);
  313|    238|	archive_string_free(&mtree->contents_name);
  314|    238|	archive_entry_linkresolver_free(mtree->resolver);
  315|       |
  316|    238|	free(mtree->buff);
  317|    238|	free(mtree);
  318|    238|	(a->format->data) = NULL;
  319|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  320|    238|}
archive_read_support_format_mtree.c:free_options:
  235|  6.90k|{
  236|  6.90k|	struct mtree_option *next;
  237|       |
  238|   152k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (238:9): [True: 145k, False: 6.90k]
  ------------------
  239|   145k|		next = head->next;
  240|   145k|		free(head->value);
  241|   145k|		free(head);
  242|   145k|	}
  243|  6.90k|}
archive_read_support_format_mtree.c:mtree_bid:
  669|    236|{
  670|    236|	const char *signature = "#mtree";
  671|    236|	const char *p;
  672|       |
  673|    236|	(void)best_bid; /* UNUSED */
  674|       |
  675|       |	/* Now let's look at the actual header and see if it matches. */
  676|    236|	p = __archive_read_ahead(a, strlen(signature), NULL);
  677|    236|	if (p == NULL)
  ------------------
  |  Branch (677:6): [True: 2, False: 234]
  ------------------
  678|      2|		return (-1);
  679|       |
  680|    234|	if (memcmp(p, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (680:6): [True: 0, False: 234]
  ------------------
  681|      0|		return (8 * (int)strlen(signature));
  682|       |
  683|       |	/*
  684|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  685|       |	 */
  686|    234|	return (detect_form(a, NULL));
  687|    234|}
archive_read_support_format_mtree.c:detect_form:
  691|    235|{
  692|    235|	const char *p;
  693|    235|	ssize_t avail, ravail;
  694|    235|	ssize_t len, nl;
  695|    235|	int entry_cnt = 0, multiline = 0;
  696|    235|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  697|       |			* (In this source we call it `form D') . */
  698|       |
  699|    235|	if (is_form_d != NULL)
  ------------------
  |  Branch (699:6): [True: 1, False: 234]
  ------------------
  700|      1|		*is_form_d = 0;
  701|    235|	p = __archive_read_ahead(a, 1, &avail);
  702|    235|	if (p == NULL)
  ------------------
  |  Branch (702:6): [True: 0, False: 235]
  ------------------
  703|      0|		return (-1);
  704|    235|	ravail = avail;
  705|   198M|	for (;;) {
  706|   198M|		len = next_line(a, &p, &avail, &ravail, &nl);
  707|       |		/* The terminal character of the line should be
  708|       |		 * a new line character, '\r\n' or '\n'. */
  709|   198M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (709:7): [True: 220, False: 198M]
  |  Branch (709:19): [True: 2, False: 198M]
  ------------------
  710|    222|			break;
  711|   198M|		if (!multiline) {
  ------------------
  |  Branch (711:7): [True: 198M, False: 0]
  ------------------
  712|       |			/* Leading whitespace is never significant,
  713|       |			 * ignore it. */
  714|   199M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (714:11): [True: 199M, False: 0]
  |  Branch (714:23): [True: 1.28M, False: 198M]
  |  Branch (714:36): [True: 0, False: 198M]
  ------------------
  715|  1.28M|				++p;
  716|  1.28M|				--avail;
  717|  1.28M|				--len;
  718|  1.28M|			}
  719|       |			/* Skip comment or empty line. */ 
  720|   198M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (720:8): [True: 0, False: 198M]
  |  Branch (720:23): [True: 198M, False: 22]
  |  Branch (720:39): [True: 0, False: 22]
  ------------------
  721|   198M|				p += len;
  722|   198M|				avail -= len;
  723|   198M|				continue;
  724|   198M|			}
  725|   198M|		} else {
  726|       |			/* A continuance line; the terminal
  727|       |			 * character of previous line was '\' character. */
  728|      0|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (728:8): [True: 0, False: 0]
  ------------------
  729|      0|				break;
  730|      0|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (730:8): [True: 0, False: 0]
  ------------------
  731|      0|				if (multiline == 1 &&
  ------------------
  |  Branch (731:9): [True: 0, False: 0]
  ------------------
  732|      0|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  665|      0|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (732:9): [True: 0, False: 0]
  ------------------
  733|      0|					break;
  734|      0|				multiline = 0;
  735|      0|			}
  736|      0|			p += len;
  737|      0|			avail -= len;
  738|      0|			continue;
  739|      0|		}
  740|     22|		if (p[0] != '/') {
  ------------------
  |  Branch (740:7): [True: 22, False: 0]
  ------------------
  741|     22|			int last_is_path, keywords;
  742|       |
  743|     22|			keywords = bid_entry(p, len, nl, &last_is_path);
  744|     22|			if (keywords >= 0) {
  ------------------
  |  Branch (744:8): [True: 11, False: 11]
  ------------------
  745|     11|				if (form_D == 0) {
  ------------------
  |  Branch (745:9): [True: 7, False: 4]
  ------------------
  746|      7|					if (last_is_path)
  ------------------
  |  Branch (746:10): [True: 2, False: 5]
  ------------------
  747|      2|						form_D = 1;
  748|      5|					else if (keywords > 0)
  ------------------
  |  Branch (748:15): [True: 0, False: 5]
  ------------------
  749|       |						/* This line is not `form D'. */
  750|      0|						form_D = -1;
  751|      7|				} else if (form_D == 1) {
  ------------------
  |  Branch (751:16): [True: 4, False: 0]
  ------------------
  752|      4|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (752:10): [True: 2, False: 2]
  |  Branch (752:27): [True: 0, False: 2]
  ------------------
  753|       |						/* This this is not `form D'
  754|       |						 * and We cannot accept mixed
  755|       |						 * format. */
  756|      0|						break;
  757|      4|				}
  758|     11|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (758:9): [True: 7, False: 4]
  |  Branch (758:26): [True: 0, False: 7]
  ------------------
  759|       |					/* This line continues. */
  760|      0|					multiline = 1;
  761|     11|				else {
  762|       |					/* We've got plenty of correct lines
  763|       |					 * to assume that this file is an mtree
  764|       |					 * format. */
  765|     11|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  665|     11|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (765:10): [True: 2, False: 9]
  ------------------
  766|      2|						break;
  767|     11|				}
  768|     11|			} else
  769|     11|				break;
  770|     22|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (770:14): [True: 0, False: 0]
  |  Branch (770:25): [True: 0, False: 0]
  ------------------
  771|      0|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (771:8): [True: 0, False: 0]
  ------------------
  772|      0|				break;
  773|       |			/* This line continues. */
  774|      0|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (774:8): [True: 0, False: 0]
  ------------------
  775|      0|				multiline = 2;
  776|      0|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (776:14): [True: 0, False: 0]
  |  Branch (776:25): [True: 0, False: 0]
  ------------------
  777|      0|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (777:8): [True: 0, False: 0]
  ------------------
  778|      0|				break;
  779|       |			/* This line continues. */
  780|      0|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (780:8): [True: 0, False: 0]
  ------------------
  781|      0|				multiline = 2;
  782|      0|		} else
  783|      0|			break;
  784|       |
  785|       |		/* Test next line. */
  786|      9|		p += len;
  787|      9|		avail -= len;
  788|      9|	}
  789|    235|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  665|    470|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (789:6): [True: 2, False: 233]
  |  Branch (789:37): [True: 5, False: 228]
  |  Branch (789:54): [True: 0, False: 5]
  ------------------
  790|      2|		if (is_form_d != NULL) {
  ------------------
  |  Branch (790:7): [True: 1, False: 1]
  ------------------
  791|      1|			if (form_D == 1)
  ------------------
  |  Branch (791:8): [True: 1, False: 0]
  ------------------
  792|      1|				*is_form_d = 1;
  793|      1|		}
  794|      2|		return (32);
  795|      2|	}
  796|       |
  797|    233|	return (0);
  798|    235|}
archive_read_support_format_mtree.c:next_line:
  368|   198M|{
  369|   198M|	ssize_t len;
  370|   198M|	int quit;
  371|       |	
  372|   198M|	quit = 0;
  373|   198M|	if (*avail == 0) {
  ------------------
  |  Branch (373:6): [True: 27, False: 198M]
  ------------------
  374|     27|		*nl = 0;
  375|     27|		len = 0;
  376|     27|	} else
  377|   198M|		len = get_line_size(*b, *avail, nl);
  378|       |	/*
  379|       |	 * Read bytes more while it does not reach the end of line.
  380|       |	 */
  381|   198M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (381:9): [True: 292, False: 198M]
  |  Branch (381:21): [True: 76, False: 216]
  |  Branch (381:38): [True: 74, False: 2]
  ------------------
  382|     74|		ssize_t diff = *ravail - *avail;
  383|     74|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  384|     74|		ssize_t tested;
  385|       |
  386|       |		/*
  387|       |		 * Place an arbitrary limit on the line length.
  388|       |		 * mtree is almost free-form input and without line length limits,
  389|       |		 * it can consume a lot of memory.
  390|       |		 */
  391|     74|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   82|     74|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (391:7): [True: 0, False: 74]
  ------------------
  392|      0|			return (-1);
  393|       |
  394|       |		/* Increase reading bytes if it is not enough to at least
  395|       |		 * new two lines. */
  396|     74|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (396:7): [True: 69, False: 5]
  ------------------
  397|     69|			nbytes_req <<= 1;
  398|       |
  399|     74|		*b = __archive_read_ahead(a, nbytes_req, avail);
  400|     74|		if (*b == NULL) {
  ------------------
  |  Branch (400:7): [True: 9, False: 65]
  ------------------
  401|      9|			if (*ravail >= *avail)
  ------------------
  |  Branch (401:8): [True: 4, False: 5]
  ------------------
  402|      4|				return (0);
  403|       |			/* Reading bytes reaches the end of file. */
  404|      5|			*b = __archive_read_ahead(a, *avail, avail);
  405|      5|			quit = 1;
  406|      5|		}
  407|     70|		*ravail = *avail;
  408|     70|		*b += diff;
  409|     70|		*avail -= diff;
  410|     70|		tested = len;/* Skip some bytes we already determined. */
  411|     70|		len = get_line_size(*b + len, *avail - len, nl);
  412|     70|		if (len >= 0)
  ------------------
  |  Branch (412:7): [True: 70, False: 0]
  ------------------
  413|     70|			len += tested;
  414|     70|	}
  415|   198M|	return (len);
  416|   198M|}
archive_read_support_format_mtree.c:get_line_size:
  324|   198M|{
  325|   198M|	ssize_t len;
  326|       |
  327|   198M|	len = 0;
  328|   402M|	while (len < avail) {
  ------------------
  |  Branch (328:9): [True: 402M, False: 49]
  ------------------
  329|   402M|		switch (*b) {
  330|    216|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (330:3): [True: 216, False: 402M]
  ------------------
  331|    216|			if (nlsize != NULL)
  ------------------
  |  Branch (331:8): [True: 216, False: 0]
  ------------------
  332|    216|				*nlsize = 0;
  333|    216|			return (-1);
  334|      2|		case '\r':
  ------------------
  |  Branch (334:3): [True: 2, False: 402M]
  ------------------
  335|      2|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (335:8): [True: 2, False: 0]
  |  Branch (335:25): [True: 1, False: 1]
  ------------------
  336|      1|				if (nlsize != NULL)
  ------------------
  |  Branch (336:9): [True: 1, False: 0]
  ------------------
  337|      1|					*nlsize = 2;
  338|      1|				return (len+2);
  339|      1|			}
  340|       |			/* FALL THROUGH */
  341|   198M|		case '\n':
  ------------------
  |  Branch (341:3): [True: 198M, False: 204M]
  ------------------
  342|   198M|			if (nlsize != NULL)
  ------------------
  |  Branch (342:8): [True: 198M, False: 0]
  ------------------
  343|   198M|				*nlsize = 1;
  344|   198M|			return (len+1);
  345|   204M|		default:
  ------------------
  |  Branch (345:3): [True: 204M, False: 198M]
  ------------------
  346|   204M|			b++;
  347|   204M|			len++;
  348|   204M|			break;
  349|   402M|		}
  350|   402M|	}
  351|     49|	if (nlsize != NULL)
  ------------------
  |  Branch (351:6): [True: 49, False: 0]
  ------------------
  352|     49|		*nlsize = 0;
  353|     49|	return (avail);
  354|   198M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  525|     17|{
  526|     17|	int l;
  527|     17|	int keycnt = 0;
  528|       |
  529|     21|	while (len > 0 && *p) {
  ------------------
  |  Branch (529:9): [True: 21, False: 0]
  |  Branch (529:20): [True: 21, False: 0]
  ------------------
  530|     21|		int blank = 0;
  531|       |
  532|       |		/* Test whether there are blank characters in the line. */
  533|  39.1M|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (533:10): [True: 39.1M, False: 4]
  |  Branch (533:21): [True: 39.1M, False: 25]
  |  Branch (533:34): [True: 8, False: 17]
  ------------------
  534|  39.1M|			++p;
  535|  39.1M|			--len;
  536|  39.1M|			blank = 1;
  537|  39.1M|		}
  538|     21|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (538:7): [True: 6, False: 15]
  |  Branch (538:21): [True: 1, False: 14]
  ------------------
  539|      7|			break;
  540|     14|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (540:7): [True: 0, False: 14]
  |  Branch (540:24): [True: 0, False: 0]
  |  Branch (540:40): [True: 0, False: 0]
  ------------------
  541|      0|			break;
  542|     14|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (542:7): [True: 4, False: 10]
  |  Branch (542:17): [True: 0, False: 4]
  ------------------
  543|      0|			return (-1);
  544|     14|		if (last_is_path && len == 0)
  ------------------
  |  Branch (544:7): [True: 8, False: 6]
  |  Branch (544:23): [True: 4, False: 4]
  ------------------
  545|      4|				return (keycnt);
  546|       |
  547|     10|		if (unset) {
  ------------------
  |  Branch (547:7): [True: 0, False: 10]
  ------------------
  548|      0|			l = bid_keycmp(p, "all", len);
  549|      0|			if (l > 0)
  ------------------
  |  Branch (549:8): [True: 0, False: 0]
  ------------------
  550|      0|				return (1);
  551|      0|		}
  552|       |		/* Test whether there is a correct key in the line. */
  553|     10|		l = bid_keyword(p, len);
  554|     10|		if (l == 0)
  ------------------
  |  Branch (554:7): [True: 6, False: 4]
  ------------------
  555|      6|			return (-1);/* Unknown keyword was found. */
  556|      4|		p += l;
  557|      4|		len -= l;
  558|      4|		keycnt++;
  559|       |
  560|       |		/* Skip value */
  561|      4|		if (*p == '=') {
  ------------------
  |  Branch (561:7): [True: 4, False: 0]
  ------------------
  562|      4|			int value = 0;
  563|      4|			++p;
  564|      4|			--len;
  565|      8|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (565:11): [True: 8, False: 0]
  |  Branch (565:22): [True: 8, False: 0]
  |  Branch (565:35): [True: 4, False: 4]
  ------------------
  566|      4|				++p;
  567|      4|				--len;
  568|      4|				value = 1;
  569|      4|			}
  570|       |			/* A keyword should have a its value unless
  571|       |			 * "/unset" operation. */ 
  572|      4|			if (!unset && value == 0)
  ------------------
  |  Branch (572:8): [True: 4, False: 0]
  |  Branch (572:18): [True: 0, False: 4]
  ------------------
  573|      0|				return (-1);
  574|      4|		}
  575|      4|	}
  576|      7|	return (keycnt);
  577|     17|}
archive_read_support_format_mtree.c:bid_keycmp:
  425|     17|{
  426|     17|	int match_len = 0;
  427|       |
  428|     42|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (428:9): [True: 42, False: 0]
  |  Branch (428:20): [True: 42, False: 0]
  |  Branch (428:26): [True: 38, False: 4]
  ------------------
  429|     38|		if (*p == *key) {
  ------------------
  |  Branch (429:7): [True: 25, False: 13]
  ------------------
  430|     25|			--len;
  431|     25|			++p;
  432|     25|			++key;
  433|     25|			++match_len;
  434|     25|			continue;
  435|     25|		}
  436|     13|		return (0);/* Not match */
  437|     38|	}
  438|      4|	if (*key != '\0')
  ------------------
  |  Branch (438:6): [True: 0, False: 4]
  ------------------
  439|      0|		return (0);/* Not match */
  440|       |
  441|       |	/* A following character should be specified characters */
  442|      4|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (442:6): [True: 4, False: 0]
  |  Branch (442:21): [True: 0, False: 0]
  |  Branch (442:36): [True: 0, False: 0]
  ------------------
  443|      4|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (443:6): [True: 0, False: 0]
  |  Branch (443:22): [True: 0, False: 0]
  ------------------
  444|      4|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (444:6): [True: 0, False: 0]
  |  Branch (444:23): [True: 0, False: 0]
  |  Branch (444:39): [True: 0, False: 0]
  ------------------
  445|      4|		return (match_len);
  446|      0|	return (0);/* Not match */
  447|      4|}
archive_read_support_format_mtree.c:bid_keyword:
  456|     10|{
  457|     10|	static const char * const keys_c[] = {
  458|     10|		"content", "contents", "cksum", NULL
  459|     10|	};
  460|     10|	static const char * const keys_df[] = {
  461|     10|		"device", "flags", NULL
  462|     10|	};
  463|     10|	static const char * const keys_g[] = {
  464|     10|		"gid", "gname", NULL
  465|     10|	};
  466|     10|	static const char * const keys_il[] = {
  467|     10|		"ignore", "inode", "link", NULL
  468|     10|	};
  469|     10|	static const char * const keys_m[] = {
  470|     10|		"md5", "md5digest", "mode", NULL
  471|     10|	};
  472|     10|	static const char * const keys_no[] = {
  473|     10|		"nlink", "nochange", "optional", NULL
  474|     10|	};
  475|     10|	static const char * const keys_r[] = {
  476|     10|		"resdevice", "rmd160", "rmd160digest", NULL
  477|     10|	};
  478|     10|	static const char * const keys_s[] = {
  479|     10|		"sha1", "sha1digest",
  480|     10|		"sha256", "sha256digest",
  481|     10|		"sha384", "sha384digest",
  482|     10|		"sha512", "sha512digest",
  483|     10|		"size", NULL
  484|     10|	};
  485|     10|	static const char * const keys_t[] = {
  486|     10|		"tags", "time", "type", NULL
  487|     10|	};
  488|     10|	static const char * const keys_u[] = {
  489|     10|		"uid", "uname",	NULL
  490|     10|	};
  491|     10|	const char * const *keys;
  492|     10|	int i;
  493|       |
  494|     10|	switch (*p) {
  495|      0|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (495:2): [True: 0, False: 10]
  ------------------
  496|      0|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (496:2): [True: 0, False: 10]
  |  Branch (496:12): [True: 0, False: 10]
  ------------------
  497|      6|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (497:2): [True: 6, False: 4]
  ------------------
  498|      0|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (498:2): [True: 0, False: 10]
  |  Branch (498:12): [True: 0, False: 10]
  ------------------
  499|      0|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (499:2): [True: 0, False: 10]
  ------------------
  500|      0|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (500:2): [True: 0, False: 10]
  |  Branch (500:12): [True: 0, False: 10]
  ------------------
  501|      0|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (501:2): [True: 0, False: 10]
  ------------------
  502|      1|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (502:2): [True: 1, False: 9]
  ------------------
  503|      0|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (503:2): [True: 0, False: 10]
  ------------------
  504|      0|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (504:2): [True: 0, False: 10]
  ------------------
  505|      3|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (505:2): [True: 3, False: 7]
  ------------------
  506|     10|	}
  507|       |
  508|     20|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (508:14): [True: 17, False: 3]
  ------------------
  509|     17|		int l = bid_keycmp(p, keys[i], len);
  510|     17|		if (l > 0)
  ------------------
  |  Branch (510:7): [True: 4, False: 13]
  ------------------
  511|      4|			return (l);
  512|     17|	}
  513|      3|	return (0);/* Unknown key */
  514|      7|}
archive_read_support_format_mtree.c:bid_entry:
  581|     22|{
  582|     22|	int f = 0;
  583|     22|	static const unsigned char safe_char[256] = {
  584|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  585|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  586|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  587|     22|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  588|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  589|     22|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  590|       |		/* @ABCDEFGHIJKLMNO */
  591|     22|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  592|       |		/* PQRSTUVWXYZ[\]^_  */
  593|     22|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  594|       |		/* `abcdefghijklmno */
  595|     22|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  596|       |		/* pqrstuvwxyz{|}~ */
  597|     22|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  598|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  599|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  600|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  601|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  602|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  603|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  604|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  605|     22|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  606|     22|	};
  607|     22|	ssize_t ll;
  608|     22|	const char *pp = p;
  609|     22|	const char * const pp_end = pp + len;
  610|       |
  611|     22|	*last_is_path = 0;
  612|       |	/*
  613|       |	 * Skip the path-name which is quoted.
  614|       |	 */
  615|  39.2M|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (615:8): [True: 39.2M, False: 0]
  ------------------
  616|  39.2M|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (616:7): [True: 22, False: 39.2M]
  ------------------
  617|     22|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (617:8): [True: 16, False: 6]
  |  Branch (617:22): [True: 16, False: 0]
  |  Branch (617:37): [True: 15, False: 1]
  ------------------
  618|     22|			    && *pp != '\n')
  ------------------
  |  Branch (618:11): [True: 9, False: 6]
  ------------------
  619|      9|				f = 0;
  620|     22|			break;
  621|     22|		}
  622|  39.2M|		f = 1;
  623|  39.2M|	}
  624|     22|	ll = pp_end - pp;
  625|       |
  626|       |	/* If a path-name was not found at the first, try to check
  627|       |	 * a mtree format(a.k.a form D) ``NetBSD's mtree -D'' creates,
  628|       |	 * which places the path-name at the last. */
  629|     22|	if (f == 0) {
  ------------------
  |  Branch (629:6): [True: 9, False: 13]
  ------------------
  630|      9|		const char *pb = p + len - nl;
  631|      9|		int name_len = 0;
  632|      9|		int slash;
  633|       |
  634|       |		/* The form D accepts only a single line for an entry. */
  635|      9|		if (pb-2 >= p &&
  ------------------
  |  Branch (635:7): [True: 9, False: 0]
  ------------------
  636|      9|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (636:7): [True: 0, False: 9]
  |  Branch (636:26): [True: 0, False: 0]
  |  Branch (636:43): [True: 0, False: 0]
  ------------------
  637|      0|			return (-1);
  638|      9|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (638:7): [True: 9, False: 0]
  |  Branch (638:20): [True: 0, False: 9]
  ------------------
  639|      0|			return (-1);
  640|       |
  641|      9|		slash = 0;
  642|     17|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (642:10): [True: 17, False: 0]
  |  Branch (642:23): [True: 17, False: 0]
  |  Branch (642:37): [True: 13, False: 4]
  ------------------
  643|     13|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (643:8): [True: 5, False: 8]
  ------------------
  644|      5|				return (-1);
  645|      8|			name_len++;
  646|       |			/* The pathname should have a slash in this
  647|       |			 * format. */
  648|      8|			if (*pb == '/')
  ------------------
  |  Branch (648:8): [True: 4, False: 4]
  ------------------
  649|      4|				slash = 1;
  650|      8|		}
  651|      4|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (651:7): [True: 0, False: 4]
  |  Branch (651:24): [True: 0, False: 4]
  ------------------
  652|      0|			return (-1);
  653|       |		/* If '/' is placed at the first in this field, this is not
  654|       |		 * a valid filename. */
  655|      4|		if (pb[1] == '/')
  ------------------
  |  Branch (655:7): [True: 0, False: 4]
  ------------------
  656|      0|			return (-1);
  657|      4|		ll = len - nl - name_len;
  658|      4|		pp = p;
  659|      4|		*last_is_path = 1;
  660|      4|	}
  661|       |
  662|     17|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  663|     22|}
archive_read_support_format_mtree.c:read_header:
 1114|  2.78k|{
 1115|  2.78k|	struct mtree *mtree;
 1116|  2.78k|	char *p;
 1117|  2.78k|	int r, use_next;
 1118|       |
 1119|  2.78k|	mtree = (struct mtree *)(a->format->data);
 1120|       |
 1121|  2.78k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1121:6): [True: 0, False: 2.78k]
  ------------------
 1122|      0|		close(mtree->fd);
 1123|      0|		mtree->fd = -1;
 1124|      0|	}
 1125|       |
 1126|  2.78k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1126:6): [True: 1, False: 2.78k]
  ------------------
 1127|      1|		mtree->resolver = archive_entry_linkresolver_new();
 1128|      1|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1128:7): [True: 0, False: 1]
  ------------------
 1129|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1130|      1|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1131|      1|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  338|      1|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1132|      1|		r = read_mtree(a, mtree);
 1133|      1|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1133:7): [True: 0, False: 1]
  ------------------
 1134|      0|			return (r);
 1135|      1|	}
 1136|       |
 1137|  2.78k|	a->archive.archive_format = mtree->archive_format;
 1138|  2.78k|	a->archive.archive_format_name = mtree->archive_format_name;
 1139|       |
 1140|  9.68k|	for (;;) {
 1141|  9.68k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1141:7): [True: 1, False: 9.68k]
  ------------------
 1142|      1|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1143|  9.68k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1143:7): [True: 0, False: 9.68k]
  ------------------
 1144|      0|			mtree->this_entry->used = 1;
 1145|      0|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1145:8): [True: 0, False: 0]
  ------------------
 1146|       |				/* Roll back current path. */
 1147|      0|				p = mtree->current_dir.s
 1148|      0|				    + mtree->current_dir.length - 1;
 1149|      0|				while (p >= mtree->current_dir.s && *p != '/')
  ------------------
  |  Branch (1149:12): [True: 0, False: 0]
  |  Branch (1149:41): [True: 0, False: 0]
  ------------------
 1150|      0|					--p;
 1151|      0|				if (p >= mtree->current_dir.s)
  ------------------
  |  Branch (1151:9): [True: 0, False: 0]
  ------------------
 1152|      0|					--p;
 1153|      0|				mtree->current_dir.length
 1154|      0|				    = p - mtree->current_dir.s + 1;
 1155|      0|			}
 1156|      0|		}
 1157|  9.68k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1157:7): [True: 2.78k, False: 6.90k]
  ------------------
 1158|  2.78k|			use_next = 0;
 1159|  2.78k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1160|  2.78k|				&use_next);
 1161|  2.78k|			if (use_next == 0)
  ------------------
  |  Branch (1161:8): [True: 2.78k, False: 0]
  ------------------
 1162|  2.78k|				return (r);
 1163|  2.78k|		}
 1164|  6.90k|		mtree->this_entry = mtree->this_entry->next;
 1165|  6.90k|	}
 1166|  2.78k|}
archive_read_support_format_mtree.c:read_mtree:
 1035|      1|{
 1036|      1|	ssize_t len;
 1037|      1|	uintmax_t counter;
 1038|      1|	char *p, *s;
 1039|      1|	struct mtree_option *global;
 1040|      1|	struct mtree_entry *last_entry;
 1041|      1|	int r, is_form_d;
 1042|       |
 1043|      1|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  338|      1|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1044|      1|	mtree->archive_format_name = "mtree";
 1045|       |
 1046|      1|	global = NULL;
 1047|      1|	last_entry = NULL;
 1048|       |
 1049|      1|	(void)detect_form(a, &is_form_d);
 1050|       |
 1051|  6.94k|	for (counter = 1; ; ++counter) {
 1052|  6.94k|		r = ARCHIVE_OK;
  ------------------
  |  |  192|  6.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1053|  6.94k|		len = readline(a, mtree, &p, 65536);
 1054|  6.94k|		if (len == 0) {
  ------------------
  |  Branch (1054:7): [True: 1, False: 6.94k]
  ------------------
 1055|      1|			mtree->this_entry = mtree->entries;
 1056|      1|			free_options(global);
 1057|      1|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1058|      1|		}
 1059|  6.94k|		if (len < 0) {
  ------------------
  |  Branch (1059:7): [True: 0, False: 6.94k]
  ------------------
 1060|      0|			free_options(global);
 1061|      0|			return ((int)len);
 1062|      0|		}
 1063|       |		/* Leading whitespace is never significant, ignore it. */
 1064|  7.10k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1064:10): [True: 0, False: 7.10k]
  |  Branch (1064:23): [True: 154, False: 6.94k]
  ------------------
 1065|    154|			++p;
 1066|    154|			--len;
 1067|    154|		}
 1068|       |		/* Skip content lines and blank lines. */
 1069|  6.94k|		if (*p == '#')
  ------------------
  |  Branch (1069:7): [True: 0, False: 6.94k]
  ------------------
 1070|      0|			continue;
 1071|  6.94k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1071:7): [True: 0, False: 6.94k]
  |  Branch (1071:21): [True: 0, False: 6.94k]
  |  Branch (1071:35): [True: 0, False: 6.94k]
  ------------------
 1072|      0|			continue;
 1073|       |		/* Non-printable characters are not allowed */
 1074|   210k|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1074:14): [True: 203k, False: 6.94k]
  ------------------
 1075|   203k|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1075:8): [True: 5.70k, False: 197k]
  |  Branch (1075:39): [True: 0, False: 5.70k]
  ------------------
 1076|      0|				r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1077|      0|				break;
 1078|      0|			}
 1079|   203k|		}
 1080|  6.94k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  6.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1080:7): [True: 0, False: 6.94k]
  ------------------
 1081|      0|			break;
 1082|  6.94k|		if (*p != '/') {
  ------------------
  |  Branch (1082:7): [True: 6.90k, False: 41]
  ------------------
 1083|  6.90k|			r = process_add_entry(a, mtree, &global, p, len,
 1084|  6.90k|			    &last_entry, is_form_d);
 1085|  6.90k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1085:14): [True: 41, False: 0]
  |  Branch (1085:25): [True: 41, False: 0]
  ------------------
 1086|     41|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1086:8): [True: 0, False: 41]
  |  Branch (1086:23): [True: 0, False: 0]
  ------------------
 1087|      0|				break;
 1088|     41|			r = process_global_set(a, &global, p);
 1089|     41|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1089:14): [True: 0, False: 0]
  |  Branch (1089:25): [True: 0, False: 0]
  ------------------
 1090|      0|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1090:8): [True: 0, False: 0]
  |  Branch (1090:23): [True: 0, False: 0]
  ------------------
 1091|      0|				break;
 1092|      0|			r = process_global_unset(a, &global, p);
 1093|      0|		} else
 1094|      0|			break;
 1095|       |
 1096|  6.94k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|  6.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1096:7): [True: 0, False: 6.94k]
  ------------------
 1097|      0|			free_options(global);
 1098|      0|			return r;
 1099|      0|		}
 1100|  6.94k|	}
 1101|       |
 1102|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1103|      0|	    "Can't parse line %ju", counter);
 1104|      0|	free_options(global);
 1105|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1106|      1|}
archive_read_support_format_mtree.c:readline:
 2091|  6.94k|{
 2092|  6.94k|	ssize_t bytes_read;
 2093|  6.94k|	ssize_t total_size = 0;
 2094|  6.94k|	ssize_t find_off = 0;
 2095|  6.94k|	const void *t;
 2096|  6.94k|	void *nl;
 2097|  6.94k|	char *u;
 2098|       |
 2099|       |	/* Accumulate line in a line buffer. */
 2100|  6.95k|	for (;;) {
 2101|       |		/* Read some more. */
 2102|  6.95k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2103|  6.95k|		if (t == NULL)
  ------------------
  |  Branch (2103:7): [True: 1, False: 6.95k]
  ------------------
 2104|      1|			return (0);
 2105|  6.95k|		if (bytes_read < 0)
  ------------------
  |  Branch (2105:7): [True: 0, False: 6.95k]
  ------------------
 2106|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2107|  6.95k|		nl = memchr(t, '\n', bytes_read);
 2108|       |		/* If we found '\n', trim the read to end exactly there. */
 2109|  6.95k|		if (nl != NULL) {
  ------------------
  |  Branch (2109:7): [True: 6.95k, False: 1]
  ------------------
 2110|  6.95k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2111|  6.95k|		}
 2112|  6.95k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2112:7): [True: 0, False: 6.95k]
  ------------------
 2113|      0|			archive_set_error(&a->archive,
 2114|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2115|      0|			    "Line too long");
 2116|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2117|      0|		}
 2118|  6.95k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2118:7): [True: 0, False: 6.95k]
  ------------------
 2119|  6.95k|			total_size + bytes_read + 1) == NULL) {
 2120|      0|			archive_set_error(&a->archive, ENOMEM,
 2121|      0|			    "Can't allocate working buffer");
 2122|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2123|      0|		}
 2124|       |		/* Append new bytes to string. */
 2125|  6.95k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2126|  6.95k|		__archive_read_consume(a, bytes_read);
 2127|  6.95k|		total_size += bytes_read;
 2128|  6.95k|		mtree->line.s[total_size] = '\0';
 2129|       |
 2130|   210k|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2130:38): [True: 210k, False: 9]
  ------------------
 2131|   210k|			if (u[0] == '\n') {
  ------------------
  |  Branch (2131:8): [True: 6.94k, False: 203k]
  ------------------
 2132|       |				/* Ends with unescaped newline. */
 2133|  6.94k|				*start = mtree->line.s;
 2134|  6.94k|				return total_size;
 2135|   203k|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2135:15): [True: 1, False: 203k]
  ------------------
 2136|       |				/* Ends with comment sequence #...\n */
 2137|      1|				if (nl == NULL) {
  ------------------
  |  Branch (2137:9): [True: 0, False: 1]
  ------------------
 2138|       |					/* But we've not found the \n yet */
 2139|      0|					break;
 2140|      0|				}
 2141|   203k|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2141:15): [True: 371, False: 202k]
  ------------------
 2142|    371|				if (u[1] == '\n') {
  ------------------
  |  Branch (2142:9): [True: 0, False: 371]
  ------------------
 2143|       |					/* Trim escaped newline. */
 2144|      0|					total_size -= 2;
 2145|      0|					mtree->line.s[total_size] = '\0';
 2146|      0|					break;
 2147|    371|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2147:16): [True: 371, False: 0]
  ------------------
 2148|       |					/* Skip the two-char escape sequence */
 2149|    371|					++u;
 2150|    371|				}
 2151|    371|			}
 2152|   210k|		}
 2153|      9|		find_off = u - mtree->line.s;
 2154|      9|	}
 2155|  6.94k|}
archive_read_support_format_mtree.c:process_add_entry:
  921|  6.90k|{
  922|  6.90k|	struct mtree_entry *entry;
  923|  6.90k|	struct mtree_option *iter;
  924|  6.90k|	const char *next, *eq, *name, *end;
  925|  6.90k|	size_t name_len, len;
  926|  6.90k|	int r, i;
  927|       |
  928|  6.90k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (928:6): [True: 0, False: 6.90k]
  ------------------
  929|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  930|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  931|      0|	}
  932|  6.90k|	entry->next = NULL;
  933|  6.90k|	entry->options = NULL;
  934|  6.90k|	entry->name = NULL;
  935|  6.90k|	entry->used = 0;
  936|  6.90k|	entry->full = 0;
  937|       |
  938|       |	/* Add this entry to list. */
  939|  6.90k|	if (*last_entry == NULL)
  ------------------
  |  Branch (939:6): [True: 1, False: 6.90k]
  ------------------
  940|      1|		mtree->entries = entry;
  941|  6.90k|	else
  942|  6.90k|		(*last_entry)->next = entry;
  943|  6.90k|	*last_entry = entry;
  944|       |
  945|  6.90k|	if (is_form_d) {
  ------------------
  |  Branch (945:6): [True: 6.90k, False: 0]
  ------------------
  946|       |		/* Filename is last item on line. */
  947|       |		/* Adjust line_len to trim trailing whitespace */
  948|  13.8k|		while (line_len > 0) {
  ------------------
  |  Branch (948:10): [True: 13.8k, False: 0]
  ------------------
  949|  13.8k|			char last_character = line[line_len - 1];
  950|  13.8k|			if (last_character == '\r'
  ------------------
  |  Branch (950:8): [True: 0, False: 13.8k]
  ------------------
  951|  13.8k|			    || last_character == '\n'
  ------------------
  |  Branch (951:11): [True: 6.90k, False: 6.90k]
  ------------------
  952|  13.8k|			    || last_character == '\t'
  ------------------
  |  Branch (952:11): [True: 0, False: 6.90k]
  ------------------
  953|  13.8k|			    || last_character == ' ') {
  ------------------
  |  Branch (953:11): [True: 0, False: 6.90k]
  ------------------
  954|  6.90k|				line_len--;
  955|  6.90k|			} else {
  956|  6.90k|				break;
  957|  6.90k|			}
  958|  13.8k|		}
  959|       |		/* Name starts after the last whitespace separator */
  960|  6.90k|		name = line;
  961|   208k|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (961:15): [True: 201k, False: 6.90k]
  ------------------
  962|   201k|			if (line[i] == '\r'
  ------------------
  |  Branch (962:8): [True: 0, False: 201k]
  ------------------
  963|   201k|			    || line[i] == '\n'
  ------------------
  |  Branch (963:11): [True: 0, False: 201k]
  ------------------
  964|   201k|			    || line[i] == '\t'
  ------------------
  |  Branch (964:11): [True: 5.51k, False: 196k]
  ------------------
  965|   201k|			    || line[i] == ' ') {
  ------------------
  |  Branch (965:11): [True: 1.32k, False: 194k]
  ------------------
  966|  6.83k|				name = line + i + 1;
  967|  6.83k|			}
  968|   201k|		}
  969|  6.90k|		name_len = line + line_len - name;
  970|  6.90k|		end = name;
  971|  6.90k|	} else {
  972|       |		/* Filename is first item on line */
  973|      0|		name_len = strcspn(line, " \t\r\n");
  974|      0|		name = line;
  975|      0|		line += name_len;
  976|      0|		end = line + line_len;
  977|      0|	}
  978|       |	/* name/name_len is the name within the line. */
  979|       |	/* line..end brackets the entire line except the name */
  980|       |
  981|  6.90k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (981:6): [True: 0, False: 6.90k]
  ------------------
  982|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  983|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  984|      0|	}
  985|       |
  986|  6.90k|	memcpy(entry->name, name, name_len);
  987|  6.90k|	entry->name[name_len] = '\0';
  988|  6.90k|	parse_escapes(entry->name, entry);
  989|       |
  990|  6.90k|	entry->next_dup = NULL;
  991|  6.90k|	if (entry->full) {
  ------------------
  |  Branch (991:6): [True: 4.14k, False: 2.76k]
  ------------------
  992|  4.14k|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (992:7): [True: 4.12k, False: 19]
  ------------------
  993|  4.12k|			struct mtree_entry *alt;
  994|  4.12k|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
  995|  4.12k|			    &mtree->rbtree, entry->name);
  996|  4.12k|			if (alt != NULL) {
  ------------------
  |  Branch (996:8): [True: 4.12k, False: 0]
  ------------------
  997|  3.67M|				while (alt->next_dup)
  ------------------
  |  Branch (997:12): [True: 3.67M, False: 4.12k]
  ------------------
  998|  3.67M|					alt = alt->next_dup;
  999|  4.12k|				alt->next_dup = entry;
 1000|  4.12k|			}
 1001|  4.12k|		}
 1002|  4.14k|	}
 1003|       |
 1004|   147k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1004:23): [True: 140k, False: 6.90k]
  ------------------
 1005|   140k|		r = add_option(a, &entry->options, iter->value,
 1006|   140k|		    strlen(iter->value));
 1007|   140k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|   140k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1007:7): [True: 0, False: 140k]
  ------------------
 1008|      0|			return (r);
 1009|   140k|	}
 1010|       |
 1011|  11.4k|	for (;;) {
 1012|  11.4k|		next = line + strspn(line, " \t\r\n");
 1013|  11.4k|		if (*next == '\0')
  ------------------
  |  Branch (1013:7): [True: 0, False: 11.4k]
  ------------------
 1014|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1015|  11.4k|		if (next >= end)
  ------------------
  |  Branch (1015:7): [True: 6.90k, False: 4.55k]
  ------------------
 1016|  6.90k|			return (ARCHIVE_OK);
  ------------------
  |  |  192|  6.90k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1017|  4.55k|		line = next;
 1018|  4.55k|		next = line + strcspn(line, " \t\r\n");
 1019|  4.55k|		eq = strchr(line, '=');
 1020|  4.55k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (1020:7): [True: 876, False: 3.68k]
  |  Branch (1020:21): [True: 1.32k, False: 2.35k]
  ------------------
 1021|  2.19k|			len = next - line;
 1022|  2.35k|		else
 1023|  2.35k|			len = eq - line;
 1024|       |
 1025|  4.55k|		remove_option(&entry->options, line, len);
 1026|  4.55k|		r = add_option(a, &entry->options, line, next - line);
 1027|  4.55k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  4.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1027:7): [True: 0, False: 4.55k]
  ------------------
 1028|      0|			return (r);
 1029|  4.55k|		line = next;
 1030|  4.55k|	}
 1031|  6.90k|}
archive_read_support_format_mtree.c:parse_escapes:
 1943|  6.90k|{
 1944|  6.90k|	char *dest = src;
 1945|  6.90k|	char c;
 1946|       |
 1947|  6.90k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1947:6): [True: 6.90k, False: 0]
  |  Branch (1947:24): [True: 0, False: 6.90k]
  ------------------
 1948|      0|		mentry->full = 1;
 1949|       |
 1950|  77.8k|	while (*src != '\0') {
  ------------------
  |  Branch (1950:9): [True: 70.9k, False: 6.90k]
  ------------------
 1951|  70.9k|		c = *src++;
 1952|  70.9k|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1952:7): [True: 4.19k, False: 66.7k]
  |  Branch (1952:19): [True: 4.19k, False: 0]
  ------------------
 1953|  4.19k|			mentry->full = 1;
 1954|  70.9k|		if (c == '\\') {
  ------------------
  |  Branch (1954:7): [True: 23, False: 70.9k]
  ------------------
 1955|     23|			switch (src[0]) {
  ------------------
  |  Branch (1955:12): [True: 18, False: 5]
  ------------------
 1956|      0|			case '0':
  ------------------
  |  Branch (1956:4): [True: 0, False: 23]
  ------------------
 1957|      0|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1957:9): [True: 0, False: 0]
  |  Branch (1957:25): [True: 0, False: 0]
  ------------------
 1958|      0|					c = 0;
 1959|      0|					++src;
 1960|      0|					break;
 1961|      0|				}
 1962|       |				/* FALLTHROUGH */
 1963|      0|			case '1':
  ------------------
  |  Branch (1963:4): [True: 0, False: 23]
  ------------------
 1964|      0|			case '2':
  ------------------
  |  Branch (1964:4): [True: 0, False: 23]
  ------------------
 1965|      0|			case '3':
  ------------------
  |  Branch (1965:4): [True: 0, False: 23]
  ------------------
 1966|      0|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1966:9): [True: 0, False: 0]
  |  Branch (1966:26): [True: 0, False: 0]
  ------------------
 1967|      0|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1967:9): [True: 0, False: 0]
  |  Branch (1967:26): [True: 0, False: 0]
  ------------------
 1968|      0|					c = (src[0] - '0') << 6;
 1969|      0|					c |= (src[1] - '0') << 3;
 1970|      0|					c |= (src[2] - '0');
 1971|      0|					src += 3;
 1972|      0|				}
 1973|      0|				break;
 1974|      0|			case 'a':
  ------------------
  |  Branch (1974:4): [True: 0, False: 23]
  ------------------
 1975|      0|				c = '\a';
 1976|      0|				++src;
 1977|      0|				break;
 1978|      0|			case 'b':
  ------------------
  |  Branch (1978:4): [True: 0, False: 23]
  ------------------
 1979|      0|				c = '\b';
 1980|      0|				++src;
 1981|      0|				break;
 1982|      0|			case 'f':
  ------------------
  |  Branch (1982:4): [True: 0, False: 23]
  ------------------
 1983|      0|				c = '\f';
 1984|      0|				++src;
 1985|      0|				break;
 1986|      0|			case 'n':
  ------------------
  |  Branch (1986:4): [True: 0, False: 23]
  ------------------
 1987|      0|				c = '\n';
 1988|      0|				++src;
 1989|      0|				break;
 1990|      0|			case 'r':
  ------------------
  |  Branch (1990:4): [True: 0, False: 23]
  ------------------
 1991|      0|				c = '\r';
 1992|      0|				++src;
 1993|      0|				break;
 1994|      0|			case 's':
  ------------------
  |  Branch (1994:4): [True: 0, False: 23]
  ------------------
 1995|      0|				c = ' ';
 1996|      0|				++src;
 1997|      0|				break;
 1998|      0|			case 't':
  ------------------
  |  Branch (1998:4): [True: 0, False: 23]
  ------------------
 1999|      0|				c = '\t';
 2000|      0|				++src;
 2001|      0|				break;
 2002|      5|			case 'v':
  ------------------
  |  Branch (2002:4): [True: 5, False: 18]
  ------------------
 2003|      5|				c = '\v';
 2004|      5|				++src;
 2005|      5|				break;
 2006|      0|			case '\\':
  ------------------
  |  Branch (2006:4): [True: 0, False: 23]
  ------------------
 2007|      0|				c = '\\';
 2008|      0|				++src;
 2009|      0|				break;
 2010|     23|			}
 2011|     23|		}
 2012|  70.9k|		*dest++ = c;
 2013|  70.9k|	}
 2014|  6.90k|	*dest = '\0';
 2015|  6.90k|}
archive_read_support_format_mtree.c:add_option:
  814|   145k|{
  815|   145k|	struct mtree_option *opt;
  816|       |
  817|   145k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (817:6): [True: 0, False: 145k]
  ------------------
  818|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  819|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  820|      0|	}
  821|   145k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (821:6): [True: 0, False: 145k]
  ------------------
  822|      0|		free(opt);
  823|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  824|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  825|      0|	}
  826|   145k|	memcpy(opt->value, value, len);
  827|   145k|	opt->value[len] = '\0';
  828|   145k|	opt->next = *global;
  829|   145k|	*global = opt;
  830|   145k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|   145k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  831|   145k|}
archive_read_support_format_mtree.c:remove_option:
  835|  4.83k|{
  836|  4.83k|	struct mtree_option *iter, *last;
  837|       |
  838|  4.83k|	last = NULL;
  839|  99.7k|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (839:23): [True: 95.2k, False: 4.56k]
  ------------------
  840|  95.2k|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (840:7): [True: 1.35k, False: 93.8k]
  ------------------
  841|  95.2k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (841:8): [True: 228, False: 1.13k]
  ------------------
  842|  1.35k|		     iter->value[len] == '='))
  ------------------
  |  Branch (842:8): [True: 38, False: 1.09k]
  ------------------
  843|    266|			break;
  844|  95.2k|	}
  845|  4.83k|	if (iter == NULL)
  ------------------
  |  Branch (845:6): [True: 4.56k, False: 266]
  ------------------
  846|  4.56k|		return;
  847|    266|	if (last == NULL)
  ------------------
  |  Branch (847:6): [True: 0, False: 266]
  ------------------
  848|      0|		*global = iter->next;
  849|    266|	else
  850|    266|		last->next = iter->next;
  851|       |
  852|    266|	free(iter->value);
  853|    266|	free(iter);
  854|    266|}
archive_read_support_format_mtree.c:process_global_set:
  859|     41|{
  860|     41|	const char *next, *eq;
  861|     41|	size_t len;
  862|     41|	int r;
  863|       |
  864|     41|	line += 4;
  865|    317|	for (;;) {
  866|    317|		next = line + strspn(line, " \t\r\n");
  867|    317|		if (*next == '\0')
  ------------------
  |  Branch (867:7): [True: 41, False: 276]
  ------------------
  868|     41|			return (ARCHIVE_OK);
  ------------------
  |  |  192|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  869|    276|		line = next;
  870|    276|		next = line + strcspn(line, " \t\r\n");
  871|    276|		eq = strchr(line, '=');
  872|    276|		if (eq > next)
  ------------------
  |  Branch (872:7): [True: 196, False: 80]
  ------------------
  873|    196|			len = next - line;
  874|     80|		else
  875|     80|			len = eq - line;
  876|       |
  877|    276|		remove_option(global, line, len);
  878|    276|		r = add_option(a, global, line, next - line);
  879|    276|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    276|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (879:7): [True: 0, False: 276]
  ------------------
  880|      0|			return (r);
  881|    276|		line = next;
  882|    276|	}
  883|     41|}
archive_read_support_format_mtree.c:parse_file:
 1176|  2.78k|{
 1177|  2.78k|	const char *path;
 1178|  2.78k|	struct stat st_storage, *st;
 1179|  2.78k|	struct mtree_entry *mp;
 1180|  2.78k|	struct archive_entry *sparse_entry;
 1181|  2.78k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  192|  2.78k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1182|       |
 1183|  2.78k|	mentry->used = 1;
 1184|       |
 1185|       |	/* Initialize reasonable defaults. */
 1186|  2.78k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|  2.78k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1187|  2.78k|	archive_entry_set_size(entry, 0);
 1188|  2.78k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  2.78k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1189|       |
 1190|       |	/* Parse options from this line. */
 1191|  2.78k|	parsed_kws = 0;
 1192|  2.78k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1193|       |
 1194|  2.78k|	if (mentry->full) {
  ------------------
  |  Branch (1194:6): [True: 19, False: 2.76k]
  ------------------
 1195|     19|		archive_entry_copy_pathname(entry, mentry->name);
 1196|       |		/*
 1197|       |		 * "Full" entries are allowed to have multiple lines
 1198|       |		 * and those lines aren't required to be adjacent.  We
 1199|       |		 * don't support multiple lines for "relative" entries
 1200|       |		 * nor do we make any attempt to merge data from
 1201|       |		 * separate "relative" and "full" entries.  (Merging
 1202|       |		 * "relative" and "full" entries would require dealing
 1203|       |		 * with pathname canonicalization, which is a very
 1204|       |		 * tricky subject.)
 1205|       |		 */
 1206|     19|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1207|     19|		    &mtree->rbtree, mentry->name);
 1208|  4.16k|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1208:10): [True: 4.14k, False: 19]
  ------------------
 1209|  4.14k|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1209:8): [True: 4.14k, False: 0]
  |  Branch (1209:20): [True: 4.12k, False: 19]
  ------------------
 1210|       |				/* Later lines override earlier ones. */
 1211|  4.12k|				mp->used = 1;
 1212|  4.12k|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1213|  4.12k|				if (r1 < r)
  ------------------
  |  Branch (1213:9): [True: 0, False: 4.12k]
  ------------------
 1214|      0|					r = r1;
 1215|  4.12k|			}
 1216|  4.14k|		}
 1217|  2.76k|	} else {
 1218|       |		/*
 1219|       |		 * Relative entries require us to construct
 1220|       |		 * the full path and possibly update the
 1221|       |		 * current directory.
 1222|       |		 */
 1223|  2.76k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  2.76k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1224|  2.76k|		if (n > 0)
  ------------------
  |  Branch (1224:7): [True: 0, False: 2.76k]
  ------------------
 1225|      0|			archive_strcat(&mtree->current_dir, "/");
 1226|  2.76k|		archive_strcat(&mtree->current_dir, mentry->name);
 1227|  2.76k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1228|  2.76k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  190|  2.76k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1228:7): [True: 2.76k, False: 0]
  ------------------
 1229|  2.76k|			mtree->current_dir.length = n;
 1230|  2.76k|	}
 1231|       |
 1232|  2.78k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1232:6): [True: 0, False: 2.78k]
  ------------------
 1233|       |		/*
 1234|       |		 * Try to open and stat the file to get the real size
 1235|       |		 * and other file info.  It would be nice to avoid
 1236|       |		 * this here so that getting a listing of an mtree
 1237|       |		 * wouldn't require opening every referenced contents
 1238|       |		 * file.  But then we wouldn't know the actual
 1239|       |		 * contents size, so I don't see a really viable way
 1240|       |		 * around this.  (Also, we may want to someday pull
 1241|       |		 * other unspecified info from the contents file on
 1242|       |		 * disk.)
 1243|       |		 */
 1244|      0|		mtree->fd = -1;
 1245|      0|		if (archive_strlen(&mtree->contents_name) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1245:7): [True: 0, False: 0]
  ------------------
 1246|      0|			path = mtree->contents_name.s;
 1247|      0|		else
 1248|      0|			path = archive_entry_pathname(entry);
 1249|       |
 1250|      0|		if (archive_entry_filetype(entry) == AE_IFREG ||
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1250:7): [True: 0, False: 0]
  ------------------
 1251|      0|				archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1251:5): [True: 0, False: 0]
  ------------------
 1252|      0|			mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
  ------------------
  |  |   61|      0|#define	O_BINARY 0
  ------------------
 1253|      0|			__archive_ensure_cloexec_flag(mtree->fd);
 1254|      0|			if (mtree->fd == -1 && (
  ------------------
  |  Branch (1254:8): [True: 0, False: 0]
  ------------------
 1255|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1256|       |        /*
 1257|       |         * On Windows, attempting to open a file with an
 1258|       |         * invalid name result in EINVAL (Error 22)
 1259|       |         */
 1260|       |				(errno != ENOENT && errno != EINVAL)
 1261|       |#else
 1262|      0|				errno != ENOENT
  ------------------
  |  Branch (1262:5): [True: 0, False: 0]
  ------------------
 1263|      0|#endif
 1264|      0|        || archive_strlen(&mtree->contents_name) > 0)) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1264:12): [True: 0, False: 0]
  ------------------
 1265|      0|				archive_set_error(&a->archive, errno,
 1266|      0|						"Can't open %s", path);
 1267|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1268|      0|			}
 1269|      0|		}
 1270|       |
 1271|      0|		st = &st_storage;
 1272|      0|		if (mtree->fd >= 0) {
  ------------------
  |  Branch (1272:7): [True: 0, False: 0]
  ------------------
 1273|      0|			if (fstat(mtree->fd, st) == -1) {
  ------------------
  |  Branch (1273:8): [True: 0, False: 0]
  ------------------
 1274|      0|				archive_set_error(&a->archive, errno,
 1275|      0|						"Could not fstat %s", path);
 1276|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1277|       |				/* If we can't stat it, don't keep it open. */
 1278|      0|				close(mtree->fd);
 1279|      0|				mtree->fd = -1;
 1280|      0|				st = NULL;
 1281|      0|			}
 1282|      0|		}
 1283|      0|#ifdef HAVE_LSTAT
 1284|      0|		else if (lstat(path, st) == -1)
  ------------------
  |  Branch (1284:12): [True: 0, False: 0]
  ------------------
 1285|       |#else
 1286|       |		else if (la_stat(path, st) == -1)
 1287|       |#endif
 1288|      0|		{
 1289|      0|			st = NULL;
 1290|      0|		}
 1291|       |
 1292|       |		/*
 1293|       |		 * Check for a mismatch between the type in the specification
 1294|       |		 * and the type of the contents object on disk.
 1295|       |		 */
 1296|      0|		if (st != NULL) {
  ------------------
  |  Branch (1296:7): [True: 0, False: 0]
  ------------------
 1297|      0|			if (((st->st_mode & S_IFMT) == S_IFREG &&
  ------------------
  |  Branch (1297:9): [True: 0, False: 0]
  ------------------
 1298|      0|			      archive_entry_filetype(entry) == AE_IFREG)
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1298:10): [True: 0, False: 0]
  ------------------
 1299|      0|#ifdef S_IFLNK
 1300|      0|			  ||((st->st_mode & S_IFMT) == S_IFLNK &&
  ------------------
  |  Branch (1300:9): [True: 0, False: 0]
  ------------------
 1301|      0|			      archive_entry_filetype(entry) == AE_IFLNK)
  ------------------
  |  |  186|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1301:10): [True: 0, False: 0]
  ------------------
 1302|      0|#endif
 1303|      0|#ifdef S_IFSOCK
 1304|      0|			  ||((st->st_mode & S_IFSOCK) == S_IFSOCK &&
  ------------------
  |  Branch (1304:9): [True: 0, False: 0]
  ------------------
 1305|      0|			      archive_entry_filetype(entry) == AE_IFSOCK)
  ------------------
  |  |  187|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
  |  Branch (1305:10): [True: 0, False: 0]
  ------------------
 1306|      0|#endif
 1307|      0|#ifdef S_IFCHR
 1308|      0|			  ||((st->st_mode & S_IFMT) == S_IFCHR &&
  ------------------
  |  Branch (1308:9): [True: 0, False: 0]
  ------------------
 1309|      0|			      archive_entry_filetype(entry) == AE_IFCHR)
  ------------------
  |  |  188|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1309:10): [True: 0, False: 0]
  ------------------
 1310|      0|#endif
 1311|      0|#ifdef S_IFBLK
 1312|      0|			  ||((st->st_mode & S_IFMT) == S_IFBLK &&
  ------------------
  |  Branch (1312:9): [True: 0, False: 0]
  ------------------
 1313|      0|			      archive_entry_filetype(entry) == AE_IFBLK)
  ------------------
  |  |  189|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1313:10): [True: 0, False: 0]
  ------------------
 1314|      0|#endif
 1315|      0|			  ||((st->st_mode & S_IFMT) == S_IFDIR &&
  ------------------
  |  Branch (1315:9): [True: 0, False: 0]
  ------------------
 1316|      0|			      archive_entry_filetype(entry) == AE_IFDIR)
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1316:10): [True: 0, False: 0]
  ------------------
 1317|      0|#ifdef S_IFIFO
 1318|      0|			  ||((st->st_mode & S_IFMT) == S_IFIFO &&
  ------------------
  |  Branch (1318:9): [True: 0, False: 0]
  ------------------
 1319|      0|			      archive_entry_filetype(entry) == AE_IFIFO)
  ------------------
  |  |  191|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1319:10): [True: 0, False: 0]
  ------------------
 1320|      0|#endif
 1321|      0|			) {
 1322|       |				/* Types match. */
 1323|      0|			} else {
 1324|       |				/* Types don't match; bail out gracefully. */
 1325|      0|				if (mtree->fd >= 0)
  ------------------
  |  Branch (1325:9): [True: 0, False: 0]
  ------------------
 1326|      0|					close(mtree->fd);
 1327|      0|				mtree->fd = -1;
 1328|      0|				if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   79|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1328:9): [True: 0, False: 0]
  ------------------
 1329|       |					/* It's not an error for an optional
 1330|       |					 * entry to not match disk. */
 1331|      0|					*use_next = 1;
 1332|      0|				} else if (r == ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1332:16): [True: 0, False: 0]
  ------------------
 1333|      0|					archive_set_error(&a->archive,
 1334|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1335|      0|					    "mtree specification has different"
 1336|      0|					    " type for %s",
 1337|      0|					    archive_entry_pathname(entry));
 1338|      0|					r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1339|      0|				}
 1340|      0|				return (r);
 1341|      0|			}
 1342|      0|		}
 1343|       |
 1344|       |		/*
 1345|       |		 * If there is a contents file on disk, pick some of the
 1346|       |		 * metadata from that file.  For most of these, we only
 1347|       |		 * set it from the contents if it wasn't already parsed
 1348|       |		 * from the specification.
 1349|       |		 */
 1350|      0|		if (st != NULL) {
  ------------------
  |  Branch (1350:7): [True: 0, False: 0]
  ------------------
 1351|      0|			if (((parsed_kws & MTREE_HAS_DEVICE) == 0 ||
  ------------------
  |  |   67|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
  |  Branch (1351:9): [True: 0, False: 0]
  ------------------
 1352|      0|				(parsed_kws & MTREE_HAS_NOCHANGE) != 0) &&
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1352:5): [True: 0, False: 0]
  ------------------
 1353|      0|				(archive_entry_filetype(entry) == AE_IFCHR ||
  ------------------
  |  |  188|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1353:6): [True: 0, False: 0]
  ------------------
 1354|      0|				 archive_entry_filetype(entry) == AE_IFBLK))
  ------------------
  |  |  189|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1354:6): [True: 0, False: 0]
  ------------------
 1355|      0|				archive_entry_set_rdev(entry, st->st_rdev);
 1356|      0|			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   69|      0|#define	MTREE_HAS_GID		0x0004
  ------------------
              			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   70|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
  |  Branch (1356:8): [True: 0, False: 0]
  ------------------
 1357|      0|				== 0 ||
 1358|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1358:8): [True: 0, False: 0]
  ------------------
 1359|      0|				archive_entry_set_gid(entry, st->st_gid);
 1360|      0|			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   76|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
              			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   77|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
  |  Branch (1360:8): [True: 0, False: 0]
  ------------------
 1361|      0|				== 0 ||
 1362|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1362:8): [True: 0, False: 0]
  ------------------
 1363|      0|				archive_entry_set_uid(entry, st->st_uid);
 1364|      0|			if ((parsed_kws & MTREE_HAS_MTIME) == 0 ||
  ------------------
  |  |   71|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
  |  Branch (1364:8): [True: 0, False: 0]
  ------------------
 1365|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0) {
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1365:8): [True: 0, False: 0]
  ------------------
 1366|       |#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
 1367|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1368|       |						st->st_mtimespec.tv_nsec);
 1369|       |#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 1370|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1371|      0|						st->st_mtim.tv_nsec);
 1372|       |#elif HAVE_STRUCT_STAT_ST_MTIME_N
 1373|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1374|       |						st->st_mtime_n);
 1375|       |#elif HAVE_STRUCT_STAT_ST_UMTIME
 1376|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1377|       |						st->st_umtime*1000);
 1378|       |#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
 1379|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1380|       |						st->st_mtime_usec*1000);
 1381|       |#else
 1382|       |				archive_entry_set_mtime(entry, st->st_mtime, 0);
 1383|       |#endif
 1384|      0|			}
 1385|      0|			if ((parsed_kws & MTREE_HAS_NLINK) == 0 ||
  ------------------
  |  |   72|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
  |  Branch (1385:8): [True: 0, False: 0]
  ------------------
 1386|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1386:8): [True: 0, False: 0]
  ------------------
 1387|      0|				archive_entry_set_nlink(entry, st->st_nlink);
 1388|      0|			if ((parsed_kws & MTREE_HAS_PERM) == 0 ||
  ------------------
  |  |   73|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
  |  Branch (1388:8): [True: 0, False: 0]
  ------------------
 1389|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1389:8): [True: 0, False: 0]
  ------------------
 1390|      0|				archive_entry_set_perm(entry, st->st_mode);
 1391|      0|			if ((parsed_kws & MTREE_HAS_SIZE) == 0 ||
  ------------------
  |  |   74|      0|#define	MTREE_HAS_SIZE		0x0080
  ------------------
  |  Branch (1391:8): [True: 0, False: 0]
  ------------------
 1392|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1392:8): [True: 0, False: 0]
  ------------------
 1393|      0|				archive_entry_set_size(entry, st->st_size);
 1394|      0|			archive_entry_set_ino(entry, st->st_ino);
 1395|      0|			archive_entry_set_dev(entry, st->st_dev);
 1396|       |
 1397|      0|			archive_entry_linkify(mtree->resolver, &entry,
 1398|      0|				&sparse_entry);
 1399|      0|		} else if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   79|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1399:14): [True: 0, False: 0]
  ------------------
 1400|       |			/*
 1401|       |			 * Couldn't open the entry, stat it or the on-disk type
 1402|       |			 * didn't match.  If this entry is optional, just
 1403|       |			 * ignore it and read the next header entry.
 1404|       |			 */
 1405|      0|			*use_next = 1;
 1406|      0|			return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1407|      0|		}
 1408|      0|	}
 1409|       |
 1410|  2.78k|	mtree->cur_size = archive_entry_size(entry);
 1411|  2.78k|	mtree->offset = 0;
 1412|       |
 1413|  2.78k|	return r;
 1414|  2.78k|}
archive_read_support_format_mtree.c:parse_line:
 1422|  6.90k|{
 1423|  6.90k|	struct mtree_option *iter;
 1424|  6.90k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  192|  6.90k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1425|       |
 1426|   152k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1426:27): [True: 145k, False: 6.90k]
  ------------------
 1427|   145k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1428|   145k|		if (r1 < r)
  ------------------
  |  Branch (1428:7): [True: 6.55k, False: 138k]
  ------------------
 1429|  6.55k|			r = r1;
 1430|   145k|	}
 1431|  6.90k|	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |  192|  13.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |   75|    352|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1431:6): [True: 352, False: 6.55k]
  |  Branch (1431:25): [True: 352, False: 0]
  ------------------
 1432|    352|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|    352|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1433|    352|		    "Missing type keyword in mtree specification");
 1434|    352|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|    352|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1435|    352|	}
 1436|  6.55k|	return (r);
 1437|  6.90k|}
archive_read_support_format_mtree.c:parse_keyword:
 1603|   145k|{
 1604|   145k|	char *val, *key;
 1605|       |
 1606|   145k|	key = opt->value;
 1607|       |
 1608|   145k|	if (*key == '\0')
  ------------------
  |  Branch (1608:6): [True: 0, False: 145k]
  ------------------
 1609|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1610|       |
 1611|   145k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1611:6): [True: 0, False: 145k]
  ------------------
 1612|      0|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   80|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1613|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1614|      0|	}
 1615|   145k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1615:6): [True: 0, False: 145k]
  ------------------
 1616|      0|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   79|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1617|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1618|      0|	}
 1619|   145k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1619:6): [True: 0, False: 145k]
  ------------------
 1620|       |		/*
 1621|       |		 * The mtree processing is not recursive, so
 1622|       |		 * recursion will only happen for explicitly listed
 1623|       |		 * entries.
 1624|       |		 */
 1625|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1626|      0|	}
 1627|       |
 1628|   145k|	val = strchr(key, '=');
 1629|   145k|	if (val == NULL) {
  ------------------
  |  Branch (1629:6): [True: 136k, False: 8.68k]
  ------------------
 1630|   136k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|   136k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1631|   136k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1632|   136k|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|   136k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1633|   136k|	}
 1634|       |
 1635|  8.68k|	*val = '\0';
 1636|  8.68k|	++val;
 1637|       |
 1638|  8.68k|	switch (key[0]) {
 1639|  6.29k|	case 'c':
  ------------------
  |  Branch (1639:2): [True: 6.29k, False: 2.39k]
  ------------------
 1640|  6.29k|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1640:7): [True: 0, False: 6.29k]
  ------------------
 1641|  6.29k|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1641:10): [True: 0, False: 6.29k]
  ------------------
 1642|      0|			parse_escapes(val, NULL);
 1643|      0|			archive_strcpy(&mtree->contents_name, val);
  ------------------
  |  |  165|      0|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1644|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1645|      0|		}
 1646|  6.29k|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1646:7): [True: 6.29k, False: 0]
  ------------------
 1647|  6.29k|			return (ARCHIVE_OK);
  ------------------
  |  |  192|  6.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1648|      0|		break;
 1649|     39|	case 'd':
  ------------------
  |  Branch (1649:2): [True: 39, False: 8.64k]
  ------------------
 1650|     39|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1650:7): [True: 0, False: 39]
  ------------------
 1651|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1652|       |			 * of a char/block special file */
 1653|      0|			int r;
 1654|      0|			dev_t dev;
 1655|       |
 1656|      0|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   67|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1657|      0|			r = parse_device(&dev, &a->archive, val);
 1658|      0|			if (r == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1658:8): [True: 0, False: 0]
  ------------------
 1659|      0|				archive_entry_set_rdev(entry, dev);
 1660|      0|			return r;
 1661|      0|		}
 1662|     39|		break;
 1663|     39|	case 'f':
  ------------------
  |  Branch (1663:2): [True: 1, False: 8.68k]
  ------------------
 1664|      1|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1664:7): [True: 0, False: 1]
  ------------------
 1665|      0|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   68|      0|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1666|      0|			archive_entry_copy_fflags_text(entry, val);
 1667|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1668|      0|		}
 1669|      1|		break;
 1670|  1.14k|	case 'g':
  ------------------
  |  Branch (1670:2): [True: 1.14k, False: 7.54k]
  ------------------
 1671|  1.14k|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1671:7): [True: 1.08k, False: 59]
  ------------------
 1672|  1.08k|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   69|  1.08k|#define	MTREE_HAS_GID		0x0004
  ------------------
 1673|  1.08k|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1674|  1.08k|			return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1675|  1.08k|		}
 1676|     59|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1676:7): [True: 0, False: 59]
  ------------------
 1677|      0|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   70|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1678|      0|			archive_entry_copy_gname(entry, val);
 1679|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1680|      0|		}
 1681|     59|		break;
 1682|     59|	case 'i':
  ------------------
  |  Branch (1682:2): [True: 36, False: 8.65k]
  ------------------
 1683|     36|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1683:7): [True: 0, False: 36]
  ------------------
 1684|      0|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1685|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1686|      0|		}
 1687|     36|		break;
 1688|     36|	case 'l':
  ------------------
  |  Branch (1688:2): [True: 22, False: 8.66k]
  ------------------
 1689|     22|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1689:7): [True: 0, False: 22]
  ------------------
 1690|      0|			parse_escapes(val, NULL);
 1691|      0|			archive_entry_copy_symlink(entry, val);
 1692|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1693|      0|		}
 1694|     22|		break;
 1695|     22|	case 'm':
  ------------------
  |  Branch (1695:2): [True: 0, False: 8.68k]
  ------------------
 1696|      0|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1696:7): [True: 0, False: 0]
  |  Branch (1696:34): [True: 0, False: 0]
  ------------------
 1697|      0|			return parse_digest(a, entry, val,
 1698|      0|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  413|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1699|      0|		}
 1700|      0|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 0]
  ------------------
 1701|      0|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1701:8): [True: 0, False: 0]
  |  Branch (1701:24): [True: 0, False: 0]
  ------------------
 1702|      0|				archive_set_error(&a->archive,
 1703|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1704|      0|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1705|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1706|      0|			}
 1707|      0|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   73|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1708|      0|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1709|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1710|      0|		}
 1711|      0|		break;
 1712|      0|	case 'n':
  ------------------
  |  Branch (1712:2): [True: 0, False: 8.68k]
  ------------------
 1713|      0|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1713:7): [True: 0, False: 0]
  ------------------
 1714|      0|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   72|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1715|      0|			archive_entry_set_nlink(entry,
 1716|      0|				(unsigned int)mtree_atol(&val, 10));
 1717|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1718|      0|		}
 1719|      0|		break;
 1720|    961|	case 'r':
  ------------------
  |  Branch (1720:2): [True: 961, False: 7.72k]
  ------------------
 1721|    961|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1721:7): [True: 887, False: 74]
  ------------------
 1722|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1723|       |			 * inode resides */
 1724|    887|			int r;
 1725|    887|			dev_t dev;
 1726|       |
 1727|    887|			r = parse_device(&dev, &a->archive, val);
 1728|    887|			if (r == ARCHIVE_OK)
  ------------------
  |  |  192|    887|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1728:8): [True: 221, False: 666]
  ------------------
 1729|    221|				archive_entry_set_dev(entry, dev);
 1730|    887|			return r;
 1731|    887|		}
 1732|     74|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1732:7): [True: 0, False: 74]
  ------------------
 1733|     74|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1733:7): [True: 0, False: 74]
  ------------------
 1734|      0|			return parse_digest(a, entry, val,
 1735|      0|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  414|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1736|      0|		}
 1737|     74|		break;
 1738|     74|	case 's':
  ------------------
  |  Branch (1738:2): [True: 0, False: 8.68k]
  ------------------
 1739|      0|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1739:7): [True: 0, False: 0]
  ------------------
 1740|      0|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1740:7): [True: 0, False: 0]
  ------------------
 1741|      0|			return parse_digest(a, entry, val,
 1742|      0|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  415|      0|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1743|      0|		}
 1744|      0|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1744:7): [True: 0, False: 0]
  ------------------
 1745|      0|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1745:7): [True: 0, False: 0]
  ------------------
 1746|      0|			return parse_digest(a, entry, val,
 1747|      0|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  416|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1748|      0|		}
 1749|      0|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1749:7): [True: 0, False: 0]
  ------------------
 1750|      0|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1750:7): [True: 0, False: 0]
  ------------------
 1751|      0|			return parse_digest(a, entry, val,
 1752|      0|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  417|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1753|      0|		}
 1754|      0|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1754:7): [True: 0, False: 0]
  ------------------
 1755|      0|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1755:7): [True: 0, False: 0]
  ------------------
 1756|      0|			return parse_digest(a, entry, val,
 1757|      0|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  418|      0|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1758|      0|		}
 1759|      0|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1759:7): [True: 0, False: 0]
  ------------------
 1760|      0|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1761|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1762|      0|		}
 1763|      0|		break;
 1764|     39|	case 't':
  ------------------
  |  Branch (1764:2): [True: 39, False: 8.64k]
  ------------------
 1765|     39|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1765:7): [True: 0, False: 39]
  ------------------
 1766|       |			/*
 1767|       |			 * Comma delimited list of tags.
 1768|       |			 * Ignore the tags for now, but the interface
 1769|       |			 * should be extended to allow inclusion/exclusion.
 1770|       |			 */
 1771|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1772|      0|		}
 1773|     39|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1773:7): [True: 0, False: 39]
  ------------------
 1774|      0|			int64_t m;
 1775|      0|			int64_t my_time_t_max = get_time_t_max();
 1776|      0|			int64_t my_time_t_min = get_time_t_min();
 1777|      0|			long ns = 0;
 1778|       |
 1779|      0|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   71|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1780|      0|			m = mtree_atol(&val, 10);
 1781|       |			/* Replicate an old mtree bug:
 1782|       |			 * 123456789.1 represents 123456789
 1783|       |			 * seconds and 1 nanosecond. */
 1784|      0|			if (*val == '.') {
  ------------------
  |  Branch (1784:8): [True: 0, False: 0]
  ------------------
 1785|      0|				++val;
 1786|      0|				ns = (long)mtree_atol(&val, 10);
 1787|      0|				if (ns < 0)
  ------------------
  |  Branch (1787:9): [True: 0, False: 0]
  ------------------
 1788|      0|					ns = 0;
 1789|      0|				else if (ns > 999999999)
  ------------------
  |  Branch (1789:14): [True: 0, False: 0]
  ------------------
 1790|      0|					ns = 999999999;
 1791|      0|			}
 1792|      0|			if (m > my_time_t_max)
  ------------------
  |  Branch (1792:8): [True: 0, False: 0]
  ------------------
 1793|      0|				m = my_time_t_max;
 1794|      0|			else if (m < my_time_t_min)
  ------------------
  |  Branch (1794:13): [True: 0, False: 0]
  ------------------
 1795|      0|				m = my_time_t_min;
 1796|      0|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1797|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1798|      0|		}
 1799|     39|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1799:7): [True: 34, False: 5]
  ------------------
 1800|     34|			switch (val[0]) {
 1801|      0|			case 'b':
  ------------------
  |  Branch (1801:4): [True: 0, False: 34]
  ------------------
 1802|      0|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1802:9): [True: 0, False: 0]
  ------------------
 1803|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1804|      0|					archive_entry_set_filetype(entry,
 1805|      0|						AE_IFBLK);
  ------------------
  |  |  189|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1806|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1807|      0|				}
 1808|      0|				break;
 1809|      0|			case 'c':
  ------------------
  |  Branch (1809:4): [True: 0, False: 34]
  ------------------
 1810|      0|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1810:9): [True: 0, False: 0]
  ------------------
 1811|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1812|      0|					archive_entry_set_filetype(entry,
 1813|      0|						AE_IFCHR);
  ------------------
  |  |  188|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1814|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1815|      0|				}
 1816|      0|				break;
 1817|      0|			case 'd':
  ------------------
  |  Branch (1817:4): [True: 0, False: 34]
  ------------------
 1818|      0|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1818:9): [True: 0, False: 0]
  ------------------
 1819|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1820|      0|					archive_entry_set_filetype(entry,
 1821|      0|						AE_IFDIR);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1822|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1823|      0|				}
 1824|      0|				break;
 1825|      0|			case 'f':
  ------------------
  |  Branch (1825:4): [True: 0, False: 34]
  ------------------
 1826|      0|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1826:9): [True: 0, False: 0]
  ------------------
 1827|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1828|      0|					archive_entry_set_filetype(entry,
 1829|      0|						AE_IFIFO);
  ------------------
  |  |  191|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1830|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1831|      0|				}
 1832|      0|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1834|      0|					archive_entry_set_filetype(entry,
 1835|      0|						AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1836|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1837|      0|				}
 1838|      0|				break;
 1839|     34|			case 'l':
  ------------------
  |  Branch (1839:4): [True: 34, False: 0]
  ------------------
 1840|     34|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1840:9): [True: 0, False: 34]
  ------------------
 1841|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1842|      0|					archive_entry_set_filetype(entry,
 1843|      0|						AE_IFLNK);
  ------------------
  |  |  186|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1844|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1845|      0|				}
 1846|     34|				break;
 1847|     34|			default:
  ------------------
  |  Branch (1847:4): [True: 0, False: 34]
  ------------------
 1848|      0|				break;
 1849|     34|			}
 1850|     34|			archive_set_error(&a->archive,
 1851|     34|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|     34|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1852|     34|			    "Unrecognized file type \"%s\"; "
 1853|     34|			    "assuming \"file\"", val);
 1854|     34|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|     34|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1855|     34|			return (ARCHIVE_WARN);
  ------------------
  |  |  194|     34|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1856|     34|		}
 1857|      5|		break;
 1858|      5|	case 'u':
  ------------------
  |  Branch (1858:2): [True: 0, False: 8.68k]
  ------------------
 1859|      0|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1859:7): [True: 0, False: 0]
  ------------------
 1860|      0|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   76|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
 1861|      0|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1862|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1863|      0|		}
 1864|      0|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1864:7): [True: 0, False: 0]
  ------------------
 1865|      0|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1866|      0|			archive_entry_copy_uname(entry, val);
 1867|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1868|      0|		}
 1869|      0|		break;
 1870|    146|	default:
  ------------------
  |  Branch (1870:2): [True: 146, False: 8.54k]
  ------------------
 1871|    146|		break;
 1872|  8.68k|	}
 1873|    382|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|    382|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1874|    382|	    "Unrecognized key %s=%s", key, val);
 1875|    382|	return (ARCHIVE_WARN);
  ------------------
  |  |  194|    382|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1876|  8.68k|}
archive_read_support_format_mtree.c:parse_device:
 1464|    887|{
 1465|    887|#define MAX_PACK_ARGS 3
 1466|    887|	unsigned long numbers[MAX_PACK_ARGS];
 1467|    887|	char *p, *dev;
 1468|    887|	int argc;
 1469|    887|	pack_t *pack;
 1470|    887|	dev_t result;
 1471|    887|	const char *error = NULL;
 1472|       |
 1473|    887|	memset(pdev, 0, sizeof(*pdev));
 1474|    887|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1474:6): [True: 887, False: 0]
  ------------------
 1475|       |		/*
 1476|       |		 * Device's major/minor are given in a specified format.
 1477|       |		 * Decode and pack it accordingly.
 1478|       |		 */
 1479|    887|		*dev++ = '\0';
 1480|    887|		if ((pack = pack_find(val)) == NULL) {
  ------------------
  |  Branch (1480:7): [True: 0, False: 887]
  ------------------
 1481|      0|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1482|      0|			    "Unknown format `%s'", val);
 1483|      0|			return ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1484|      0|		}
 1485|    887|		argc = 0;
 1486|  2.52k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1486:10): [True: 1.64k, False: 884]
  ------------------
 1487|  1.64k|			if (*p == '\0') {
  ------------------
  |  Branch (1487:8): [True: 0, False: 1.64k]
  ------------------
 1488|      0|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1489|      0|				    "Missing number");
 1490|      0|				return ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1491|      0|			}
 1492|  1.64k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1465|  1.64k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1492:8): [True: 3, False: 1.63k]
  ------------------
 1493|      3|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1494|      3|				    "Too many arguments");
 1495|      3|				return ARCHIVE_WARN;
  ------------------
  |  |  194|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1496|      3|			}
 1497|  1.63k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1498|  1.63k|		}
 1499|    884|		if (argc < 2) {
  ------------------
  |  Branch (1499:7): [True: 333, False: 551]
  ------------------
 1500|    333|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|    333|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1501|    333|			    "Not enough arguments");
 1502|    333|			return ARCHIVE_WARN;
  ------------------
  |  |  194|    333|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1503|    333|		}
 1504|    551|		result = (*pack)(argc, numbers, &error);
 1505|    551|		if (error != NULL) {
  ------------------
  |  Branch (1505:7): [True: 330, False: 221]
  ------------------
 1506|    330|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|    330|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1507|    330|			    "%s", error);
 1508|    330|			return ARCHIVE_WARN;
  ------------------
  |  |  194|    330|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1509|    330|		}
 1510|    551|	} else {
 1511|       |		/* file system raw value. */
 1512|      0|		result = (dev_t)mtree_atol(&val, 0);
 1513|      0|	}
 1514|    221|	*pdev = result;
 1515|    221|	return ARCHIVE_OK;
  ------------------
  |  |  192|    221|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1516|    887|#undef MAX_PACK_ARGS
 1517|    887|}
archive_read_support_format_mtree.c:la_strsep:
 1450|  2.52k|{
 1451|  2.52k|	char *p, *s;
 1452|  2.52k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1452:6): [True: 0, False: 2.52k]
  |  Branch (1452:20): [True: 0, False: 2.52k]
  |  Branch (1452:35): [True: 884, False: 1.64k]
  ------------------
 1453|    884|		return(NULL);
 1454|  1.64k|	s = *sp;
 1455|  1.64k|	p = s + strcspn(s, sep);
 1456|  1.64k|	if (*p != '\0')
  ------------------
  |  Branch (1456:6): [True: 755, False: 887]
  ------------------
 1457|    755|		*p++ = '\0';
 1458|  1.64k|	*sp = p;
 1459|  1.64k|	return(s);
 1460|  2.52k|}
archive_read_support_format_mtree.c:mtree_atol:
 2038|  2.72k|{
 2039|  2.72k|	int64_t l, limit;
 2040|  2.72k|	int digit, last_digit_limit;
 2041|       |
 2042|  2.72k|	if (base == 0) {
  ------------------
  |  Branch (2042:6): [True: 1.63k, False: 1.08k]
  ------------------
 2043|  1.63k|		if (**p != '0')
  ------------------
  |  Branch (2043:7): [True: 1.63k, False: 0]
  ------------------
 2044|  1.63k|			base = 10;
 2045|      0|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (2045:12): [True: 0, False: 0]
  |  Branch (2045:30): [True: 0, False: 0]
  ------------------
 2046|      0|			*p += 2;
 2047|      0|			base = 16;
 2048|      0|		} else {
 2049|      0|			base = 8;
 2050|      0|		}
 2051|  1.63k|	}
 2052|       |
 2053|  2.72k|	if (**p == '-') {
  ------------------
  |  Branch (2053:6): [True: 148, False: 2.57k]
  ------------------
 2054|    148|		limit = INT64_MIN / base;
 2055|    148|		last_digit_limit = -(INT64_MIN % base);
 2056|    148|		++(*p);
 2057|       |
 2058|    148|		l = 0;
 2059|    148|		digit = parsedigit(**p);
 2060|  1.02k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2060:10): [True: 876, False: 148]
  |  Branch (2060:24): [True: 876, False: 0]
  ------------------
 2061|    876|			if (l < limit || (l == limit && digit >= last_digit_limit))
  ------------------
  |  Branch (2061:8): [True: 0, False: 876]
  |  Branch (2061:22): [True: 0, False: 876]
  |  Branch (2061:36): [True: 0, False: 0]
  ------------------
 2062|      0|				return INT64_MIN;
 2063|    876|			l = (l * base) - digit;
 2064|    876|			digit = parsedigit(*++(*p));
 2065|    876|		}
 2066|    148|		return l;
 2067|  2.57k|	} else {
 2068|  2.57k|		limit = INT64_MAX / base;
 2069|  2.57k|		last_digit_limit = INT64_MAX % base;
 2070|       |
 2071|  2.57k|		l = 0;
 2072|  2.57k|		digit = parsedigit(**p);
 2073|  2.57k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2073:10): [True: 0, False: 2.57k]
  |  Branch (2073:24): [True: 0, False: 0]
  ------------------
 2074|      0|			if (l > limit || (l == limit && digit > last_digit_limit))
  ------------------
  |  Branch (2074:8): [True: 0, False: 0]
  |  Branch (2074:22): [True: 0, False: 0]
  |  Branch (2074:36): [True: 0, False: 0]
  ------------------
 2075|      0|				return INT64_MAX;
 2076|      0|			l = (l * base) + digit;
 2077|      0|			digit = parsedigit(*++(*p));
 2078|      0|		}
 2079|  2.57k|		return l;
 2080|  2.57k|	}
 2081|  2.72k|}
archive_read_support_format_mtree.c:parsedigit:
 2020|  3.60k|{
 2021|  3.60k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (2021:6): [True: 3.60k, False: 0]
  |  Branch (2021:18): [True: 876, False: 2.72k]
  ------------------
 2022|    876|		return c - '0';
 2023|  2.72k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (2023:11): [True: 2.72k, False: 0]
  |  Branch (2023:23): [True: 0, False: 2.72k]
  ------------------
 2024|      0|		return c - 'a';
 2025|  2.72k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (2025:11): [True: 2.72k, False: 0]
  |  Branch (2025:23): [True: 0, False: 2.72k]
  ------------------
 2026|      0|		return c - 'A';
 2027|  2.72k|	else
 2028|  2.72k|		return -1;
 2029|  3.60k|}
archive_read_support_format_mtree.c:read_data:
 1881|  2.78k|{
 1882|  2.78k|	size_t bytes_to_read;
 1883|  2.78k|	ssize_t bytes_read;
 1884|  2.78k|	struct mtree *mtree;
 1885|       |
 1886|  2.78k|	mtree = (struct mtree *)(a->format->data);
 1887|  2.78k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1887:6): [True: 2.78k, False: 0]
  ------------------
 1888|  2.78k|		*buff = NULL;
 1889|  2.78k|		*offset = 0;
 1890|  2.78k|		*size = 0;
 1891|  2.78k|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|  2.78k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1892|  2.78k|	}
 1893|      0|	if (mtree->buff == NULL) {
  ------------------
  |  Branch (1893:6): [True: 0, False: 0]
  ------------------
 1894|      0|		mtree->buffsize = 64 * 1024;
 1895|      0|		mtree->buff = malloc(mtree->buffsize);
 1896|      0|		if (mtree->buff == NULL) {
  ------------------
  |  Branch (1896:7): [True: 0, False: 0]
  ------------------
 1897|      0|			archive_set_error(&a->archive, ENOMEM,
 1898|      0|			    "Can't allocate memory");
 1899|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1900|      0|		}
 1901|      0|	}
 1902|       |
 1903|      0|	*buff = mtree->buff;
 1904|      0|	*offset = mtree->offset;
 1905|      0|	if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
  ------------------
  |  Branch (1905:6): [True: 0, False: 0]
  ------------------
 1906|      0|		bytes_to_read = (size_t)(mtree->cur_size - mtree->offset);
 1907|      0|	else
 1908|      0|		bytes_to_read = mtree->buffsize;
 1909|      0|	bytes_read = read(mtree->fd, mtree->buff, bytes_to_read);
 1910|      0|	if (bytes_read < 0) {
  ------------------
  |  Branch (1910:6): [True: 0, False: 0]
  ------------------
 1911|      0|		archive_set_error(&a->archive, errno, "Can't read");
 1912|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1913|      0|	}
 1914|      0|	if (bytes_read == 0) {
  ------------------
  |  Branch (1914:6): [True: 0, False: 0]
  ------------------
 1915|      0|		*size = 0;
 1916|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1917|      0|	}
 1918|      0|	mtree->offset += bytes_read;
 1919|      0|	*size = bytes_read;
 1920|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1921|      0|}
archive_read_support_format_mtree.c:skip:
 1926|  2.78k|{
 1927|  2.78k|	struct mtree *mtree;
 1928|       |
 1929|  2.78k|	mtree = (struct mtree *)(a->format->data);
 1930|  2.78k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1930:6): [True: 0, False: 2.78k]
  ------------------
 1931|      0|		close(mtree->fd);
 1932|      0|		mtree->fd = -1;
 1933|      0|	}
 1934|  2.78k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  2.78k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1935|  2.78k|}

archive_read_support_format_rar:
  729|    238|{
  730|    238|  struct archive_read *a = (struct archive_read *)_a;
  731|    238|  struct rar *rar;
  732|    238|  int r;
  733|       |
  734|    238|  archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  735|    238|                      "archive_read_support_format_rar");
  736|       |
  737|    238|  rar = (struct rar *)calloc(1, sizeof(*rar));
  738|    238|  if (rar == NULL)
  ------------------
  |  Branch (738:7): [True: 0, False: 238]
  ------------------
  739|      0|  {
  740|      0|    archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
  741|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  742|      0|  }
  743|       |
  744|       |	/*
  745|       |	 * Until enough data has been read, we cannot tell about
  746|       |	 * any encrypted entries yet.
  747|       |	 */
  748|    238|	rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|    238|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  749|       |
  750|    238|  r = __archive_read_register_format(a,
  751|    238|                                     rar,
  752|    238|                                     "rar",
  753|    238|                                     archive_read_format_rar_bid,
  754|    238|                                     archive_read_format_rar_options,
  755|    238|                                     archive_read_format_rar_read_header,
  756|    238|                                     archive_read_format_rar_read_data,
  757|    238|                                     archive_read_format_rar_read_data_skip,
  758|    238|                                     archive_read_format_rar_seek_data,
  759|    238|                                     archive_read_format_rar_cleanup,
  760|    238|                                     archive_read_support_format_rar_capabilities,
  761|    238|                                     archive_read_format_rar_has_encrypted_entries);
  762|       |
  763|    238|  if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (763:7): [True: 0, False: 238]
  ------------------
  764|      0|    free(rar);
  765|    238|  return (r);
  766|    238|}
archive_read_support_format_rar.c:archive_read_support_format_rar_capabilities:
  770|     36|{
  771|     36|	(void)a; /* UNUSED */
  772|     36|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  357|     36|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  773|     36|			| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  358|     36|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  774|     36|}
archive_read_support_format_rar.c:archive_read_format_rar_has_encrypted_entries:
  778|     18|{
  779|     18|	if (_a && _a->format) {
  ------------------
  |  Branch (779:6): [True: 18, False: 0]
  |  Branch (779:12): [True: 18, False: 0]
  ------------------
  780|     18|		struct rar * rar = (struct rar *)_a->format->data;
  781|     18|		if (rar) {
  ------------------
  |  Branch (781:7): [True: 18, False: 0]
  ------------------
  782|     18|			return rar->has_encrypted_entries;
  783|     18|		}
  784|     18|	}
  785|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  786|     18|}
archive_read_support_format_rar.c:archive_read_format_rar_bid:
  791|    236|{
  792|    236|  const char *p;
  793|       |
  794|       |  /* If there's already a bid > 30, we'll never win. */
  795|    236|  if (best_bid > 30)
  ------------------
  |  Branch (795:7): [True: 25, False: 211]
  ------------------
  796|     25|	  return (-1);
  797|       |
  798|    211|  if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (798:7): [True: 5, False: 206]
  ------------------
  799|      5|    return (-1);
  800|       |
  801|    206|  if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|    206|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (801:7): [True: 18, False: 188]
  ------------------
  802|     18|    return (30);
  803|       |
  804|    188|  if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (804:8): [True: 20, False: 168]
  |  Branch (804:23): [True: 20, False: 0]
  |  Branch (804:39): [True: 0, False: 168]
  ------------------
  805|       |    /* This is a PE file */
  806|     20|    ssize_t offset = 0x10000;
  807|     20|    ssize_t window = 4096;
  808|     20|    ssize_t bytes_avail;
  809|     37|    while (offset + window <= (1024 * 128)) {
  ------------------
  |  Branch (809:12): [True: 20, False: 17]
  ------------------
  810|     20|      const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
  811|     20|      if (buff == NULL) {
  ------------------
  |  Branch (811:11): [True: 0, False: 20]
  ------------------
  812|       |        /* Remaining bytes are less than window. */
  813|      0|        window >>= 1;
  814|      0|        if (window < 0x40)
  ------------------
  |  Branch (814:13): [True: 0, False: 0]
  ------------------
  815|      0|          return (0);
  816|      0|        continue;
  817|      0|      }
  818|     20|      p = buff + offset;
  819|   306k|      while (p + 7 < buff + bytes_avail) {
  ------------------
  |  Branch (819:14): [True: 306k, False: 17]
  ------------------
  820|   306k|        if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|   306k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (820:13): [True: 3, False: 306k]
  ------------------
  821|      3|          return (30);
  822|   306k|        p += 0x10;
  823|   306k|      }
  824|     17|      offset = p - buff;
  825|     17|    }
  826|     20|  }
  827|    185|  return (0);
  828|    188|}
archive_read_support_format_rar.c:archive_read_format_rar_read_header:
  909|     18|{
  910|     18|  const void *h;
  911|     18|  const char *p;
  912|     18|  struct rar *rar;
  913|     18|  size_t skip;
  914|     18|  char head_type;
  915|     18|  int ret;
  916|     18|  unsigned flags;
  917|     18|  unsigned long crc32_expected;
  918|       |
  919|     18|  a->archive.archive_format = ARCHIVE_FORMAT_RAR;
  ------------------
  |  |  343|     18|#define	ARCHIVE_FORMAT_RAR			0xD0000
  ------------------
  920|     18|  if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (920:7): [True: 18, False: 0]
  ------------------
  921|     18|    a->archive.archive_format_name = "RAR";
  922|       |
  923|     18|  rar = (struct rar *)(a->format->data);
  924|       |
  925|       |  /*
  926|       |   * It should be sufficient to call archive_read_next_header() for
  927|       |   * a reader to determine if an entry is encrypted or not. If the
  928|       |   * encryption of an entry is only detectable when calling
  929|       |   * archive_read_data(), so be it. We'll do the same check there
  930|       |   * as well.
  931|       |   */
  932|     18|  if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|     18|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (932:7): [True: 18, False: 0]
  ------------------
  933|     18|	  rar->has_encrypted_entries = 0;
  934|     18|  }
  935|       |
  936|       |  /* RAR files can be generated without EOF headers, so return ARCHIVE_EOF if
  937|       |  * this fails.
  938|       |  */
  939|     18|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (939:7): [True: 0, False: 18]
  ------------------
  940|      0|    return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  941|       |
  942|     18|  p = h;
  943|     18|  if (rar->found_first_header == 0 &&
  ------------------
  |  Branch (943:7): [True: 18, False: 0]
  ------------------
  944|     18|     ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)) {
  ------------------
  |  Branch (944:8): [True: 0, False: 18]
  |  Branch (944:23): [True: 0, False: 0]
  |  Branch (944:39): [True: 0, False: 18]
  ------------------
  945|       |    /* This is an executable ? Must be self-extracting... */
  946|      0|    ret = skip_sfx(a);
  947|      0|    if (ret < ARCHIVE_WARN)
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (947:9): [True: 0, False: 0]
  ------------------
  948|      0|      return (ret);
  949|      0|  }
  950|     18|  rar->found_first_header = 1;
  951|       |
  952|     45|  while (1)
  ------------------
  |  Branch (952:10): [Folded - Ignored]
  ------------------
  953|     45|  {
  954|     45|    unsigned long crc32_val;
  955|       |
  956|     45|    if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (956:9): [True: 0, False: 45]
  ------------------
  957|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|     45|    p = h;
  959|       |
  960|     45|    head_type = p[2];
  961|     45|    switch(head_type)
  962|     45|    {
  963|     18|    case MARK_HEAD:
  ------------------
  |  |   53|     18|#define MARK_HEAD    0x72
  ------------------
  |  Branch (963:5): [True: 18, False: 27]
  ------------------
  964|     18|      if (memcmp(p, RAR_SIGNATURE, 7) != 0) {
  ------------------
  |  |   50|     18|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (964:11): [True: 0, False: 18]
  ------------------
  965|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  966|      0|          "Invalid marker header");
  967|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  968|      0|      }
  969|     18|      __archive_read_consume(a, 7);
  970|     18|      break;
  971|       |
  972|      9|    case MAIN_HEAD:
  ------------------
  |  |   54|      9|#define MAIN_HEAD    0x73
  ------------------
  |  Branch (972:5): [True: 9, False: 36]
  ------------------
  973|      9|      rar->main_flags = archive_le16dec(p + 3);
  974|      9|      skip = archive_le16dec(p + 5);
  975|      9|      if (skip < 7 + sizeof(rar->reserved1) + sizeof(rar->reserved2)) {
  ------------------
  |  Branch (975:11): [True: 0, False: 9]
  ------------------
  976|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  977|      0|          "Invalid header size");
  978|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  979|      0|      }
  980|      9|      if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (980:11): [True: 0, False: 9]
  ------------------
  981|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  982|      9|      p = h;
  983|      9|      memcpy(rar->reserved1, p + 7, sizeof(rar->reserved1));
  984|      9|      memcpy(rar->reserved2, p + 7 + sizeof(rar->reserved1),
  985|      9|             sizeof(rar->reserved2));
  986|      9|      if (rar->main_flags & MHD_ENCRYPTVER) {
  ------------------
  |  |   74|      9|#define MHD_ENCRYPTVER   0x0200
  ------------------
  |  Branch (986:11): [True: 0, False: 9]
  ------------------
  987|      0|        if (skip < 7 + sizeof(rar->reserved1) + sizeof(rar->reserved2)+1) {
  ------------------
  |  Branch (987:13): [True: 0, False: 0]
  ------------------
  988|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  989|      0|            "Invalid header size");
  990|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  991|      0|        }
  992|      0|        rar->encryptver = *(p + 7 + sizeof(rar->reserved1) +
  993|      0|                            sizeof(rar->reserved2));
  994|      0|      }
  995|       |
  996|       |      /* Main header is password encrypted, so we cannot read any
  997|       |         file names or any other info about files from the header. */
  998|      9|      if (rar->main_flags & MHD_PASSWORD)
  ------------------
  |  |   72|      9|#define MHD_PASSWORD     0x0080
  ------------------
  |  Branch (998:11): [True: 0, False: 9]
  ------------------
  999|      0|      {
 1000|      0|        archive_entry_set_is_metadata_encrypted(entry, 1);
 1001|      0|        archive_entry_set_is_data_encrypted(entry, 1);
 1002|      0|        rar->has_encrypted_entries = 1;
 1003|      0|         archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1004|      0|                          "RAR encryption support unavailable.");
 1005|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1006|      0|      }
 1007|       |
 1008|      9|      crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
 1009|      9|      if ((crc32_val & 0xffff) != archive_le16dec(p)) {
  ------------------
  |  Branch (1009:11): [True: 0, False: 9]
  ------------------
 1010|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1011|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1012|       |          "Header CRC error");
 1013|       |        return (ARCHIVE_FATAL);
 1014|       |#endif
 1015|      0|      }
 1016|      9|      __archive_read_consume(a, skip);
 1017|      9|      break;
 1018|       |
 1019|     17|    case FILE_HEAD:
  ------------------
  |  |   55|     17|#define FILE_HEAD    0x74
  ------------------
  |  Branch (1019:5): [True: 17, False: 28]
  ------------------
 1020|     17|      return read_header(a, entry, head_type);
 1021|       |
 1022|      1|    case COMM_HEAD:
  ------------------
  |  |   56|      1|#define COMM_HEAD    0x75
  ------------------
  |  Branch (1022:5): [True: 1, False: 44]
  ------------------
 1023|      1|    case AV_HEAD:
  ------------------
  |  |   57|      1|#define AV_HEAD      0x76
  ------------------
  |  Branch (1023:5): [True: 0, False: 45]
  ------------------
 1024|      1|    case SUB_HEAD:
  ------------------
  |  |   58|      1|#define SUB_HEAD     0x77
  ------------------
  |  Branch (1024:5): [True: 0, False: 45]
  ------------------
 1025|      1|    case PROTECT_HEAD:
  ------------------
  |  |   59|      1|#define PROTECT_HEAD 0x78
  ------------------
  |  Branch (1025:5): [True: 0, False: 45]
  ------------------
 1026|      1|    case SIGN_HEAD:
  ------------------
  |  |   60|      1|#define SIGN_HEAD    0x79
  ------------------
  |  Branch (1026:5): [True: 0, False: 45]
  ------------------
 1027|      1|    case ENDARC_HEAD:
  ------------------
  |  |   62|      1|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1027:5): [True: 0, False: 45]
  ------------------
 1028|      1|      flags = archive_le16dec(p + 3);
 1029|      1|      skip = archive_le16dec(p + 5);
 1030|      1|      if (skip < 7) {
  ------------------
  |  Branch (1030:11): [True: 0, False: 1]
  ------------------
 1031|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1032|      0|          "Invalid header size too small");
 1033|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1034|      0|      }
 1035|      1|      if (flags & HD_ADD_SIZE_PRESENT)
  ------------------
  |  |   78|      1|#define HD_ADD_SIZE_PRESENT 0x8000
  ------------------
  |  Branch (1035:11): [True: 1, False: 0]
  ------------------
 1036|      1|      {
 1037|      1|        if (skip < 7 + 4) {
  ------------------
  |  Branch (1037:13): [True: 0, False: 1]
  ------------------
 1038|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1039|      0|            "Invalid header size too small");
 1040|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1041|      0|        }
 1042|      1|        if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (1042:13): [True: 0, False: 1]
  ------------------
 1043|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1044|      1|        p = h;
 1045|      1|        skip += archive_le32dec(p + 7);
 1046|      1|      }
 1047|       |
 1048|       |      /* Skip over the 2-byte CRC at the beginning of the header. */
 1049|      1|      crc32_expected = archive_le16dec(p);
 1050|      1|      __archive_read_consume(a, 2);
 1051|      1|      skip -= 2;
 1052|       |
 1053|       |      /* Skim the entire header and compute the CRC. */
 1054|      1|      crc32_val = 0;
 1055|      8|      while (skip > 0) {
  ------------------
  |  Branch (1055:14): [True: 8, False: 0]
  ------------------
 1056|      8|	      size_t to_read = skip;
 1057|      8|	      if (to_read > 32 * 1024)
  ------------------
  |  Branch (1057:12): [True: 8, False: 0]
  ------------------
 1058|      8|		      to_read = 32 * 1024;
 1059|      8|	      if ((h = __archive_read_ahead(a, to_read, NULL)) == NULL) {
  ------------------
  |  Branch (1059:12): [True: 1, False: 7]
  ------------------
 1060|      1|		      archive_set_error(&a->archive,  ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1061|      1|			  "Bad RAR file");
 1062|      1|		      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1063|      1|	      }
 1064|      7|	      p = h;
 1065|      7|	      crc32_val = crc32(crc32_val, (const unsigned char *)p, (unsigned int)to_read);
 1066|      7|	      __archive_read_consume(a, to_read);
 1067|      7|	      skip -= to_read;
 1068|      7|      }
 1069|      0|      if ((crc32_val & 0xffff) != crc32_expected) {
  ------------------
  |  Branch (1069:11): [True: 0, False: 0]
  ------------------
 1070|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1071|       |	      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1072|       |		  "Header CRC error");
 1073|       |	      return (ARCHIVE_FATAL);
 1074|       |#endif
 1075|      0|      }
 1076|      0|      if (head_type == ENDARC_HEAD)
  ------------------
  |  |   62|      0|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1076:11): [True: 0, False: 0]
  ------------------
 1077|      0|	      return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1078|      0|      break;
 1079|       |
 1080|      0|    case NEWSUB_HEAD:
  ------------------
  |  |   61|      0|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1080:5): [True: 0, False: 45]
  ------------------
 1081|      0|      if ((ret = read_header(a, entry, head_type)) < ARCHIVE_WARN)
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1081:11): [True: 0, False: 0]
  ------------------
 1082|      0|        return ret;
 1083|      0|      break;
 1084|       |
 1085|      0|    default:
  ------------------
  |  Branch (1085:5): [True: 0, False: 45]
  ------------------
 1086|      0|      archive_set_error(&a->archive,  ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1087|      0|                        "Bad RAR file");
 1088|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1089|     45|    }
 1090|     45|  }
 1091|     18|}
archive_read_support_format_rar.c:read_header:
 1360|     17|{
 1361|     17|  const void *h;
 1362|     17|  const char *p, *endp;
 1363|     17|  struct rar *rar;
 1364|     17|  struct rar_header rar_header;
 1365|     17|  struct rar_file_header file_header;
 1366|     17|  int64_t header_size;
 1367|     17|  unsigned filename_size, end;
 1368|     17|  char *filename;
 1369|     17|  char *strp;
 1370|     17|  char packed_size[8];
 1371|     17|  char unp_size[8];
 1372|     17|  int ttime;
 1373|     17|  struct archive_string_conv *sconv, *fn_sconv;
 1374|     17|  unsigned long crc32_val;
 1375|     17|  int ret = (ARCHIVE_OK), ret2;
  ------------------
  |  |  192|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1376|     17|  char *newptr;
 1377|     17|  size_t newsize;
 1378|       |
 1379|     17|  rar = (struct rar *)(a->format->data);
 1380|       |
 1381|       |  /* Setup a string conversion object for non-rar-unicode filenames. */
 1382|     17|  sconv = rar->opt_sconv;
 1383|     17|  if (sconv == NULL) {
  ------------------
  |  Branch (1383:7): [True: 17, False: 0]
  ------------------
 1384|     17|    if (!rar->init_default_conversion) {
  ------------------
  |  Branch (1384:9): [True: 17, False: 0]
  ------------------
 1385|     17|      rar->sconv_default =
 1386|     17|          archive_string_default_conversion_for_read(
 1387|     17|            &(a->archive));
 1388|     17|      rar->init_default_conversion = 1;
 1389|     17|    }
 1390|     17|    sconv = rar->sconv_default;
 1391|     17|  }
 1392|       |
 1393|       |
 1394|     17|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1394:7): [True: 0, False: 17]
  ------------------
 1395|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1396|     17|  p = h;
 1397|     17|  memcpy(&rar_header, p, sizeof(rar_header));
 1398|     17|  rar->file_flags = archive_le16dec(rar_header.flags);
 1399|     17|  header_size = archive_le16dec(rar_header.size);
 1400|     17|  if (header_size < (int64_t)sizeof(file_header) + 7) {
  ------------------
  |  Branch (1400:7): [True: 0, False: 17]
  ------------------
 1401|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1402|      0|      "Invalid header size");
 1403|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1404|      0|  }
 1405|     17|  crc32_val = crc32(0, (const unsigned char *)p + 2, 7 - 2);
 1406|     17|  __archive_read_consume(a, 7);
 1407|       |
 1408|     17|  if (!(rar->file_flags & FHD_SOLID))
  ------------------
  |  |   85|     17|#define FHD_SOLID        0x0010
  ------------------
  |  Branch (1408:7): [True: 17, False: 0]
  ------------------
 1409|     17|  {
 1410|     17|    rar->compression_method = 0;
 1411|     17|    rar->packed_size = 0;
 1412|     17|    rar->unp_size = 0;
 1413|     17|    rar->mtime = 0;
 1414|     17|    rar->ctime = 0;
 1415|     17|    rar->atime = 0;
 1416|     17|    rar->arctime = 0;
 1417|     17|    rar->mode = 0;
 1418|     17|    memset(&rar->salt, 0, sizeof(rar->salt));
 1419|     17|    rar->atime = 0;
 1420|     17|    rar->ansec = 0;
 1421|     17|    rar->ctime = 0;
 1422|     17|    rar->cnsec = 0;
 1423|     17|    rar->mtime = 0;
 1424|     17|    rar->mnsec = 0;
 1425|     17|    rar->arctime = 0;
 1426|     17|    rar->arcnsec = 0;
 1427|     17|  }
 1428|      0|  else
 1429|      0|  {
 1430|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1431|      0|                      "RAR solid archive support unavailable.");
 1432|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1433|      0|  }
 1434|       |
 1435|     17|  if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL)
  ------------------
  |  Branch (1435:7): [True: 0, False: 17]
  ------------------
 1436|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1437|       |
 1438|       |  /* File Header CRC check. */
 1439|     17|  crc32_val = crc32(crc32_val, h, (unsigned)(header_size - 7));
 1440|     17|  if ((crc32_val & 0xffff) != archive_le16dec(rar_header.crc)) {
  ------------------
  |  Branch (1440:7): [True: 16, False: 1]
  ------------------
 1441|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1442|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1443|       |      "Header CRC error");
 1444|       |    return (ARCHIVE_FATAL);
 1445|       |#endif
 1446|     16|  }
 1447|       |  /* If no CRC error, Go on parsing File Header. */
 1448|     17|  p = h;
 1449|     17|  endp = p + header_size - 7;
 1450|     17|  memcpy(&file_header, p, sizeof(file_header));
 1451|     17|  p += sizeof(file_header);
 1452|       |
 1453|     17|  rar->compression_method = file_header.method;
 1454|       |
 1455|     17|  ttime = archive_le32dec(file_header.file_time);
 1456|     17|  rar->mtime = get_time(ttime);
 1457|       |
 1458|     17|  rar->file_crc = archive_le32dec(file_header.file_crc);
 1459|       |
 1460|     17|  if (rar->file_flags & FHD_PASSWORD)
  ------------------
  |  |   83|     17|#define FHD_PASSWORD     0x0004
  ------------------
  |  Branch (1460:7): [True: 3, False: 14]
  ------------------
 1461|      3|  {
 1462|      3|	archive_entry_set_is_data_encrypted(entry, 1);
 1463|      3|	rar->has_encrypted_entries = 1;
 1464|      3|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1465|      3|                      "RAR encryption support unavailable.");
 1466|       |    /* Since it is only the data part itself that is encrypted we can at least
 1467|       |       extract information about the currently processed entry and don't need
 1468|       |       to return ARCHIVE_FATAL here. */
 1469|       |    /*return (ARCHIVE_FATAL);*/
 1470|      3|  }
 1471|       |
 1472|     17|  if (rar->file_flags & FHD_LARGE)
  ------------------
  |  |   86|     17|#define FHD_LARGE        0x0100
  ------------------
  |  Branch (1472:7): [True: 1, False: 16]
  ------------------
 1473|      1|  {
 1474|      1|    if (p + 8 > endp) {
  ------------------
  |  Branch (1474:9): [True: 0, False: 1]
  ------------------
 1475|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1476|      0|                        "Invalid header size");
 1477|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1478|      0|    }
 1479|      1|    memcpy(packed_size, file_header.pack_size, 4);
 1480|      1|    memcpy(packed_size + 4, p, 4); /* High pack size */
 1481|      1|    p += 4;
 1482|      1|    memcpy(unp_size, file_header.unp_size, 4);
 1483|      1|    memcpy(unp_size + 4, p, 4); /* High unpack size */
 1484|      1|    p += 4;
 1485|      1|    rar->packed_size = archive_le64dec(&packed_size);
 1486|      1|    rar->unp_size = archive_le64dec(&unp_size);
 1487|      1|  }
 1488|     16|  else
 1489|     16|  {
 1490|     16|    rar->packed_size = archive_le32dec(file_header.pack_size);
 1491|     16|    rar->unp_size = archive_le32dec(file_header.unp_size);
 1492|     16|  }
 1493|       |
 1494|     17|  if (rar->packed_size < 0 || rar->unp_size < 0)
  ------------------
  |  Branch (1494:7): [True: 0, False: 17]
  |  Branch (1494:31): [True: 0, False: 17]
  ------------------
 1495|      0|  {
 1496|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1497|      0|                      "Invalid sizes specified.");
 1498|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1499|      0|  }
 1500|       |
 1501|     17|  rar->bytes_remaining = rar->packed_size;
 1502|       |
 1503|       |  /* TODO: RARv3 subblocks contain comments. For now the complete block is
 1504|       |   * consumed at the end.
 1505|       |   */
 1506|     17|  if (head_type == NEWSUB_HEAD) {
  ------------------
  |  |   61|     17|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1506:7): [True: 0, False: 17]
  ------------------
 1507|      0|    size_t distance = p - (const char *)h;
 1508|      0|    header_size += rar->packed_size;
 1509|       |    /* Make sure we have the extended data. */
 1510|      0|    if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL)
  ------------------
  |  Branch (1510:9): [True: 0, False: 0]
  ------------------
 1511|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1512|      0|    p = h;
 1513|      0|    endp = p + header_size - 7;
 1514|      0|    p += distance;
 1515|      0|  }
 1516|       |
 1517|     17|  filename_size = archive_le16dec(file_header.name_size);
 1518|     17|  if (p + filename_size > endp) {
  ------------------
  |  Branch (1518:7): [True: 0, False: 17]
  ------------------
 1519|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1520|      0|      "Invalid filename size");
 1521|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1522|      0|  }
 1523|     17|  if (rar->filename_allocated < filename_size * 2 + 2) {
  ------------------
  |  Branch (1523:7): [True: 17, False: 0]
  ------------------
 1524|     17|    newsize = filename_size * 2 + 2;
 1525|     17|    newptr = realloc(rar->filename, newsize);
 1526|     17|    if (newptr == NULL) {
  ------------------
  |  Branch (1526:9): [True: 0, False: 17]
  ------------------
 1527|      0|      archive_set_error(&a->archive, ENOMEM,
 1528|      0|                        "Couldn't allocate memory.");
 1529|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1530|      0|    }
 1531|     17|    rar->filename = newptr;
 1532|     17|    rar->filename_allocated = newsize;
 1533|     17|  }
 1534|     17|  filename = rar->filename;
 1535|     17|  memcpy(filename, p, filename_size);
 1536|     17|  filename[filename_size] = '\0';
 1537|     17|  if (rar->file_flags & FHD_UNICODE)
  ------------------
  |  |   87|     17|#define FHD_UNICODE      0x0200
  ------------------
  |  Branch (1537:7): [True: 2, False: 15]
  ------------------
 1538|      2|  {
 1539|      2|    if (filename_size != strlen(filename))
  ------------------
  |  Branch (1539:9): [True: 2, False: 0]
  ------------------
 1540|      2|    {
 1541|      2|      unsigned char highbyte, flagbits, flagbyte;
 1542|      2|      unsigned fn_end, offset;
 1543|       |
 1544|      2|      end = filename_size;
 1545|      2|      fn_end = filename_size * 2;
 1546|      2|      filename_size = 0;
 1547|      2|      offset = (unsigned)strlen(filename) + 1;
 1548|      2|      highbyte = offset >= end ? 0 : *(p + offset++);
  ------------------
  |  Branch (1548:18): [True: 0, False: 2]
  ------------------
 1549|      2|      flagbits = 0;
 1550|      2|      flagbyte = 0;
 1551|     28|      while (offset < end && filename_size < fn_end)
  ------------------
  |  Branch (1551:14): [True: 28, False: 0]
  |  Branch (1551:30): [True: 26, False: 2]
  ------------------
 1552|     26|      {
 1553|     26|        if (!flagbits)
  ------------------
  |  Branch (1553:13): [True: 8, False: 18]
  ------------------
 1554|      8|        {
 1555|      8|          flagbyte = *(p + offset++);
 1556|      8|          flagbits = 8;
 1557|      8|        }
 1558|       |
 1559|     26|        flagbits -= 2;
 1560|     26|        switch((flagbyte >> flagbits) & 3)
  ------------------
  |  Branch (1560:16): [True: 0, False: 26]
  ------------------
 1561|     26|        {
 1562|      8|          case 0:
  ------------------
  |  Branch (1562:11): [True: 8, False: 18]
  ------------------
 1563|      8|            if (offset >= end)
  ------------------
  |  Branch (1563:17): [True: 0, False: 8]
  ------------------
 1564|      0|              continue;
 1565|      8|            filename[filename_size++] = '\0';
 1566|      8|            filename[filename_size++] = *(p + offset++);
 1567|      8|            break;
 1568|     10|          case 1:
  ------------------
  |  Branch (1568:11): [True: 10, False: 16]
  ------------------
 1569|     10|            if (offset >= end)
  ------------------
  |  Branch (1569:17): [True: 0, False: 10]
  ------------------
 1570|      0|              continue;
 1571|     10|            filename[filename_size++] = highbyte;
 1572|     10|            filename[filename_size++] = *(p + offset++);
 1573|     10|            break;
 1574|      4|          case 2:
  ------------------
  |  Branch (1574:11): [True: 4, False: 22]
  ------------------
 1575|      4|            if (offset >= end - 1) {
  ------------------
  |  Branch (1575:17): [True: 0, False: 4]
  ------------------
 1576|      0|              offset = end;
 1577|      0|              continue;
 1578|      0|            }
 1579|      4|            filename[filename_size++] = *(p + offset + 1);
 1580|      4|            filename[filename_size++] = *(p + offset);
 1581|      4|            offset += 2;
 1582|      4|            break;
 1583|      4|          case 3:
  ------------------
  |  Branch (1583:11): [True: 4, False: 22]
  ------------------
 1584|      4|          {
 1585|      4|            char extra, high;
 1586|      4|            uint8_t length;
 1587|       |
 1588|      4|            if (offset >= end)
  ------------------
  |  Branch (1588:17): [True: 0, False: 4]
  ------------------
 1589|      0|              continue;
 1590|       |
 1591|      4|            length = *(p + offset++);
 1592|      4|            if (length & 0x80) {
  ------------------
  |  Branch (1592:17): [True: 0, False: 4]
  ------------------
 1593|      0|              if (offset >= end)
  ------------------
  |  Branch (1593:19): [True: 0, False: 0]
  ------------------
 1594|      0|                continue;
 1595|      0|              extra = *(p + offset++);
 1596|      0|              high = (char)highbyte;
 1597|      0|            } else
 1598|      4|              extra = high = 0;
 1599|      4|            length = (length & 0x7f) + 2;
 1600|     38|            while (length && filename_size < fn_end) {
  ------------------
  |  Branch (1600:20): [True: 34, False: 4]
  |  Branch (1600:30): [True: 34, False: 0]
  ------------------
 1601|     34|              unsigned cp = filename_size >> 1;
 1602|     34|              filename[filename_size++] = high;
 1603|     34|              filename[filename_size++] = p[cp] + extra;
 1604|     34|              length--;
 1605|     34|            }
 1606|      4|          }
 1607|      0|          break;
 1608|     26|        }
 1609|     26|      }
 1610|      2|      if (filename_size > fn_end) {
  ------------------
  |  Branch (1610:11): [True: 0, False: 2]
  ------------------
 1611|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1612|      0|          "Invalid filename");
 1613|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1614|      0|      }
 1615|      2|      filename[filename_size++] = '\0';
 1616|       |      /*
 1617|       |       * Do not increment filename_size here as the computations below
 1618|       |       * add the space for the terminating NUL explicitly.
 1619|       |       */
 1620|      2|      filename[filename_size] = '\0';
 1621|       |
 1622|       |      /* Decoded unicode form is UTF-16BE, so we have to update a string
 1623|       |       * conversion object for it. */
 1624|      2|      if (rar->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1624:11): [True: 2, False: 0]
  ------------------
 1625|      2|        rar->sconv_utf16be = archive_string_conversion_from_charset(
 1626|      2|           &a->archive, "UTF-16BE", 1);
 1627|      2|        if (rar->sconv_utf16be == NULL)
  ------------------
  |  Branch (1627:13): [True: 0, False: 2]
  ------------------
 1628|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1629|      2|      }
 1630|      2|      fn_sconv = rar->sconv_utf16be;
 1631|       |
 1632|      2|      strp = filename;
 1633|     44|      while (memcmp(strp, "\x00\x00", 2))
  ------------------
  |  Branch (1633:14): [True: 42, False: 2]
  ------------------
 1634|     42|      {
 1635|     42|        if (!memcmp(strp, "\x00\\", 2))
  ------------------
  |  Branch (1635:13): [True: 0, False: 42]
  ------------------
 1636|      0|          *(strp + 1) = '/';
 1637|     42|        strp += 2;
 1638|     42|      }
 1639|      2|      p += offset;
 1640|      2|    } else {
 1641|       |      /*
 1642|       |       * If FHD_UNICODE is set but no unicode data, this file name form
 1643|       |       * is UTF-8, so we have to update a string conversion object for
 1644|       |       * it accordingly.
 1645|       |       */
 1646|      0|      if (rar->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1646:11): [True: 0, False: 0]
  ------------------
 1647|      0|        rar->sconv_utf8 = archive_string_conversion_from_charset(
 1648|      0|           &a->archive, "UTF-8", 1);
 1649|      0|        if (rar->sconv_utf8 == NULL)
  ------------------
  |  Branch (1649:13): [True: 0, False: 0]
  ------------------
 1650|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1651|      0|      }
 1652|      0|      fn_sconv = rar->sconv_utf8;
 1653|      0|      while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1653:14): [True: 0, False: 0]
  ------------------
 1654|      0|        *strp = '/';
 1655|      0|      p += filename_size;
 1656|      0|    }
 1657|      2|  }
 1658|     15|  else
 1659|     15|  {
 1660|     15|    fn_sconv = sconv;
 1661|     15|    while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1661:12): [True: 0, False: 15]
  ------------------
 1662|      0|      *strp = '/';
 1663|     15|    p += filename_size;
 1664|     15|  }
 1665|       |
 1666|       |  /* Split file in multivolume RAR. No more need to process header. */
 1667|     17|  if (rar->filename_save &&
  ------------------
  |  Branch (1667:7): [True: 0, False: 17]
  ------------------
 1668|     17|    filename_size == rar->filename_save_size &&
  ------------------
  |  Branch (1668:5): [True: 0, False: 0]
  ------------------
 1669|     17|    !memcmp(rar->filename, rar->filename_save, filename_size + 1))
  ------------------
  |  Branch (1669:5): [True: 0, False: 0]
  ------------------
 1670|      0|  {
 1671|      0|    __archive_read_consume(a, header_size - 7);
 1672|      0|    rar->cursor++;
 1673|      0|    if (rar->cursor >= rar->nodes)
  ------------------
  |  Branch (1673:9): [True: 0, False: 0]
  ------------------
 1674|      0|    {
 1675|      0|      struct data_block_offsets *newdbo;
 1676|       |
 1677|      0|      newsize = sizeof(*rar->dbo) * (rar->nodes + 1);
 1678|      0|      if ((newdbo = realloc(rar->dbo, newsize)) == NULL)
  ------------------
  |  Branch (1678:11): [True: 0, False: 0]
  ------------------
 1679|      0|      {
 1680|      0|        archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
 1681|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1682|      0|      }
 1683|      0|      rar->dbo = newdbo;
 1684|      0|      rar->nodes++;
 1685|      0|      rar->dbo[rar->cursor].header_size = header_size;
 1686|      0|      rar->dbo[rar->cursor].start_offset = -1;
 1687|      0|      rar->dbo[rar->cursor].end_offset = -1;
 1688|      0|    }
 1689|      0|    if (rar->dbo[rar->cursor].start_offset < 0)
  ------------------
  |  Branch (1689:9): [True: 0, False: 0]
  ------------------
 1690|      0|    {
 1691|      0|      rar->dbo[rar->cursor].start_offset = a->filter->position;
 1692|      0|      rar->dbo[rar->cursor].end_offset = rar->dbo[rar->cursor].start_offset +
 1693|      0|        rar->packed_size;
 1694|      0|    }
 1695|      0|    return ret;
 1696|      0|  }
 1697|     17|  else if (rar->filename_must_match)
  ------------------
  |  Branch (1697:12): [True: 0, False: 17]
  ------------------
 1698|      0|  {
 1699|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1700|      0|      "Mismatch of file parts split across multi-volume archive");
 1701|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1702|      0|  }
 1703|       |
 1704|     17|  newsize = filename_size + 1;
 1705|     17|  if ((newptr = realloc(rar->filename_save, newsize)) == NULL)
  ------------------
  |  Branch (1705:7): [True: 0, False: 17]
  ------------------
 1706|      0|  {
 1707|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
 1708|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1709|      0|  }
 1710|     17|  rar->filename_save = newptr;
 1711|     17|  memcpy(rar->filename_save, rar->filename, newsize);
 1712|     17|  rar->filename_save_size = filename_size;
 1713|       |
 1714|       |  /* Set info for seeking */
 1715|     17|  free(rar->dbo);
 1716|     17|  if ((rar->dbo = calloc(1, sizeof(*rar->dbo))) == NULL)
  ------------------
  |  Branch (1716:7): [True: 0, False: 17]
  ------------------
 1717|      0|  {
 1718|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
 1719|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1720|      0|  }
 1721|     17|  rar->dbo[0].header_size = header_size;
 1722|     17|  rar->dbo[0].start_offset = -1;
 1723|     17|  rar->dbo[0].end_offset = -1;
 1724|     17|  rar->cursor = 0;
 1725|     17|  rar->nodes = 1;
 1726|       |
 1727|     17|  if (rar->file_flags & FHD_SALT)
  ------------------
  |  |   88|     17|#define FHD_SALT         0x0400
  ------------------
  |  Branch (1727:7): [True: 1, False: 16]
  ------------------
 1728|      1|  {
 1729|      1|    if (p + 8 > endp) {
  ------------------
  |  Branch (1729:9): [True: 0, False: 1]
  ------------------
 1730|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1731|      0|        "Invalid header size");
 1732|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1733|      0|    }
 1734|      1|    memcpy(rar->salt, p, 8);
 1735|      1|    p += 8;
 1736|      1|  }
 1737|       |
 1738|     17|  if (rar->file_flags & FHD_EXTTIME) {
  ------------------
  |  |   90|     17|#define FHD_EXTTIME      0x1000
  ------------------
  |  Branch (1738:7): [True: 7, False: 10]
  ------------------
 1739|      7|    if (read_exttime(p, rar, endp) < 0) {
  ------------------
  |  Branch (1739:9): [True: 0, False: 7]
  ------------------
 1740|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1741|      0|        "Invalid header size");
 1742|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1743|      0|    }
 1744|      7|  }
 1745|       |
 1746|     17|  __archive_read_consume(a, header_size - 7);
 1747|     17|  rar->dbo[0].start_offset = a->filter->position;
 1748|     17|  rar->dbo[0].end_offset = rar->dbo[0].start_offset + rar->packed_size;
 1749|       |
 1750|     17|  switch(file_header.host_os)
 1751|     17|  {
 1752|      5|  case OS_MSDOS:
  ------------------
  |  |  105|      5|#define OS_MSDOS  0
  ------------------
  |  Branch (1752:3): [True: 5, False: 12]
  ------------------
 1753|      5|  case OS_OS2:
  ------------------
  |  |  106|      5|#define OS_OS2    1
  ------------------
  |  Branch (1753:3): [True: 0, False: 17]
  ------------------
 1754|      5|  case OS_WIN32:
  ------------------
  |  |  107|      5|#define OS_WIN32  2
  ------------------
  |  Branch (1754:3): [True: 0, False: 17]
  ------------------
 1755|      5|    rar->mode = archive_le32dec(file_header.file_attr);
 1756|      5|    if (rar->mode & FILE_ATTRIBUTE_DIRECTORY)
  ------------------
  |  |  158|      5|#define FILE_ATTRIBUTE_DIRECTORY 0x10
  ------------------
  |  Branch (1756:9): [True: 5, False: 0]
  ------------------
 1757|      5|      rar->mode = AE_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
  ------------------
  |  |  190|      5|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1758|      0|    else
 1759|      0|      rar->mode = AE_IFREG;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1760|      5|    rar->mode |= S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
 1761|      5|    break;
 1762|       |
 1763|      9|  case OS_UNIX:
  ------------------
  |  |  108|      9|#define OS_UNIX   3
  ------------------
  |  Branch (1763:3): [True: 9, False: 8]
  ------------------
 1764|     12|  case OS_MAC_OS:
  ------------------
  |  |  109|     12|#define OS_MAC_OS 4
  ------------------
  |  Branch (1764:3): [True: 3, False: 14]
  ------------------
 1765|     12|  case OS_BEOS:
  ------------------
  |  |  110|     12|#define OS_BEOS   5
  ------------------
  |  Branch (1765:3): [True: 0, False: 17]
  ------------------
 1766|     12|    rar->mode = archive_le32dec(file_header.file_attr);
 1767|     12|    break;
 1768|       |
 1769|      0|  default:
  ------------------
  |  Branch (1769:3): [True: 0, False: 17]
  ------------------
 1770|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1771|      0|                      "Unknown file attributes from RAR file's host OS");
 1772|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1773|     17|  }
 1774|       |
 1775|     17|  rar->bytes_uncopied = rar->bytes_unconsumed = 0;
 1776|     17|  rar->lzss.position = rar->offset = 0;
 1777|     17|  rar->offset_seek = 0;
 1778|     17|  rar->dictionary_size = 0;
 1779|     17|  rar->offset_outgoing = 0;
 1780|     17|  rar->br.cache_avail = 0;
 1781|     17|  rar->br.avail_in = 0;
 1782|     17|  rar->crc_calculated = 0;
 1783|     17|  rar->entry_eof = 0;
 1784|     17|  rar->valid = 1;
 1785|     17|  rar->is_ppmd_block = 0;
 1786|     17|  rar->start_new_table = 1;
 1787|     17|  free(rar->unp_buffer);
 1788|     17|  rar->unp_buffer = NULL;
 1789|     17|  rar->unp_offset = 0;
 1790|     17|  rar->unp_buffer_size = UNP_BUFFER_SIZE;
  ------------------
  |  |  154|     17|#define UNP_BUFFER_SIZE   (128 * 1024)
  ------------------
 1791|     17|  memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 1792|     17|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1793|     17|  rar->ppmd_valid = rar->ppmd_eod = 0;
 1794|     17|  rar->filters.filterstart = INT64_MAX;
 1795|       |
 1796|       |  /* Don't set any archive entries for non-file header types */
 1797|     17|  if (head_type == NEWSUB_HEAD)
  ------------------
  |  |   61|     17|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1797:7): [True: 0, False: 17]
  ------------------
 1798|      0|    return ret;
 1799|       |
 1800|     17|  archive_entry_set_mtime(entry, rar->mtime, rar->mnsec);
 1801|     17|  archive_entry_set_ctime(entry, rar->ctime, rar->cnsec);
 1802|     17|  archive_entry_set_atime(entry, rar->atime, rar->ansec);
 1803|     17|  archive_entry_set_size(entry, rar->unp_size);
 1804|     17|  archive_entry_set_mode(entry, rar->mode);
 1805|       |
 1806|     17|  if (archive_entry_copy_pathname_l(entry, filename, filename_size, fn_sconv))
  ------------------
  |  |   80|     17|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1806:7): [True: 2, False: 15]
  ------------------
 1807|      2|  {
 1808|      2|    if (errno == ENOMEM)
  ------------------
  |  Branch (1808:9): [True: 0, False: 2]
  ------------------
 1809|      0|    {
 1810|      0|      archive_set_error(&a->archive, ENOMEM,
 1811|      0|                        "Can't allocate memory for Pathname");
 1812|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1813|      0|    }
 1814|      2|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1815|      2|                      "Pathname cannot be converted from %s to current locale.",
 1816|      2|                      archive_string_conversion_charset_name(fn_sconv));
 1817|      2|    ret = (ARCHIVE_WARN);
  ------------------
  |  |  194|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1818|      2|  }
 1819|       |
 1820|     17|  if (((rar->mode) & AE_IFMT) == AE_IFLNK)
  ------------------
  |  |  184|     17|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
                if (((rar->mode) & AE_IFMT) == AE_IFLNK)
  ------------------
  |  |  186|     17|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1820:7): [True: 0, False: 17]
  ------------------
 1821|      0|  {
 1822|       |    /* Make sure a symbolic-link file does not have its body. */
 1823|      0|    rar->bytes_remaining = 0;
 1824|      0|    archive_entry_set_size(entry, 0);
 1825|       |
 1826|       |    /* Read a symbolic-link name. */
 1827|      0|    if ((ret2 = read_symlink_stored(a, entry, sconv)) < (ARCHIVE_WARN))
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1827:9): [True: 0, False: 0]
  ------------------
 1828|      0|      return ret2;
 1829|      0|    if (ret > ret2)
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|      0|      ret = ret2;
 1831|      0|  }
 1832|       |
 1833|     17|  if (rar->bytes_remaining == 0)
  ------------------
  |  Branch (1833:7): [True: 0, False: 17]
  ------------------
 1834|      0|    rar->entry_eof = 1;
 1835|       |
 1836|     17|  return ret;
 1837|     17|}
archive_read_support_format_rar.c:get_time:
 1841|     19|{
 1842|     19|  struct tm tm;
 1843|     19|  tm.tm_sec = 2 * (ttime & 0x1f);
 1844|     19|  tm.tm_min = (ttime >> 5) & 0x3f;
 1845|     19|  tm.tm_hour = (ttime >> 11) & 0x1f;
 1846|     19|  tm.tm_mday = (ttime >> 16) & 0x1f;
 1847|     19|  tm.tm_mon = ((ttime >> 21) & 0x0f) - 1;
 1848|     19|  tm.tm_year = ((ttime >> 25) & 0x7f) + 80;
 1849|     19|  tm.tm_isdst = -1;
 1850|     19|  return mktime(&tm);
 1851|     19|}
archive_read_support_format_rar.c:read_exttime:
 1855|      7|{
 1856|      7|  unsigned rmode, flags, rem, j, count;
 1857|      7|  int ttime, i;
 1858|      7|  struct tm *tm;
 1859|      7|  time_t t;
 1860|      7|  long nsec;
 1861|      7|#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
 1862|      7|  struct tm tmbuf;
 1863|      7|#endif
 1864|       |
 1865|      7|  if (p + 2 > endp)
  ------------------
  |  Branch (1865:7): [True: 0, False: 7]
  ------------------
 1866|      0|    return (-1);
 1867|      7|  flags = archive_le16dec(p);
 1868|      7|  p += 2;
 1869|       |
 1870|     35|  for (i = 3; i >= 0; i--)
  ------------------
  |  Branch (1870:15): [True: 28, False: 7]
  ------------------
 1871|     28|  {
 1872|     28|    t = 0;
 1873|     28|    if (i == 3)
  ------------------
  |  Branch (1873:9): [True: 7, False: 21]
  ------------------
 1874|      7|      t = rar->mtime;
 1875|     28|    rmode = flags >> i * 4;
 1876|     28|    if (rmode & 8)
  ------------------
  |  Branch (1876:9): [True: 9, False: 19]
  ------------------
 1877|      9|    {
 1878|      9|      if (!t)
  ------------------
  |  Branch (1878:11): [True: 2, False: 7]
  ------------------
 1879|      2|      {
 1880|      2|        if (p + 4 > endp)
  ------------------
  |  Branch (1880:13): [True: 0, False: 2]
  ------------------
 1881|      0|          return (-1);
 1882|      2|        ttime = archive_le32dec(p);
 1883|      2|        t = get_time(ttime);
 1884|      2|        p += 4;
 1885|      2|      }
 1886|      9|      rem = 0;
 1887|      9|      count = rmode & 3;
 1888|      9|      if (p + count > endp)
  ------------------
  |  Branch (1888:11): [True: 0, False: 9]
  ------------------
 1889|      0|        return (-1);
 1890|     34|      for (j = 0; j < count; j++)
  ------------------
  |  Branch (1890:19): [True: 25, False: 9]
  ------------------
 1891|     25|      {
 1892|     25|        rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
 1893|     25|        p++;
 1894|     25|      }
 1895|       |#if defined(HAVE_LOCALTIME_S)
 1896|       |      tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
 1897|       |#elif defined(HAVE_LOCALTIME_R)
 1898|       |      tm = localtime_r(&t, &tmbuf);
 1899|       |#else
 1900|       |      tm = localtime(&t);
 1901|       |#endif
 1902|      9|      nsec = tm->tm_sec + rem / NS_UNIT;
  ------------------
  |  |  124|      9|#define NS_UNIT 10000000
  ------------------
 1903|      9|      if (rmode & 4)
  ------------------
  |  Branch (1903:11): [True: 4, False: 5]
  ------------------
 1904|      4|      {
 1905|      4|        tm->tm_sec++;
 1906|      4|        t = mktime(tm);
 1907|      4|      }
 1908|      9|      if (i == 3)
  ------------------
  |  Branch (1908:11): [True: 7, False: 2]
  ------------------
 1909|      7|      {
 1910|      7|        rar->mtime = t;
 1911|      7|        rar->mnsec = nsec;
 1912|      7|      }
 1913|      2|      else if (i == 2)
  ------------------
  |  Branch (1913:16): [True: 2, False: 0]
  ------------------
 1914|      2|      {
 1915|      2|        rar->ctime = t;
 1916|      2|        rar->cnsec = nsec;
 1917|      2|      }
 1918|      0|      else if (i == 1)
  ------------------
  |  Branch (1918:16): [True: 0, False: 0]
  ------------------
 1919|      0|      {
 1920|      0|        rar->atime = t;
 1921|      0|        rar->ansec = nsec;
 1922|      0|      }
 1923|      0|      else
 1924|      0|      {
 1925|      0|        rar->arctime = t;
 1926|      0|        rar->arcnsec = nsec;
 1927|      0|      }
 1928|      9|    }
 1929|     28|  }
 1930|      7|  return (0);
 1931|      7|}
archive_read_support_format_rar.c:rar_read_ahead:
 3183|  20.1k|{
 3184|  20.1k|  struct rar *rar = (struct rar *)(a->format->data);
 3185|  20.1k|  const void *h = __archive_read_ahead(a, min, avail);
 3186|  20.1k|  int ret;
 3187|  20.1k|  if (avail)
  ------------------
  |  Branch (3187:7): [True: 20.1k, False: 0]
  ------------------
 3188|  20.1k|  {
 3189|  20.1k|    if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested)
  ------------------
  |  Branch (3189:9): [True: 20.1k, False: 0]
  |  Branch (3189:47): [True: 20.1k, False: 38]
  ------------------
 3190|  20.1k|      *avail = a->archive.read_data_requested;
 3191|  20.1k|    if (*avail > rar->bytes_remaining)
  ------------------
  |  Branch (3191:9): [True: 0, False: 20.1k]
  ------------------
 3192|      0|      *avail = (ssize_t)rar->bytes_remaining;
 3193|  20.1k|    if (*avail < 0)
  ------------------
  |  Branch (3193:9): [True: 0, False: 20.1k]
  ------------------
 3194|      0|      return NULL;
 3195|  20.1k|    else if (*avail == 0 && rar->main_flags & MHD_VOLUME &&
  ------------------
  |  |   65|  20.1k|#define MHD_VOLUME       0x0001
  ------------------
  |  Branch (3195:14): [True: 25, False: 20.1k]
  |  Branch (3195:29): [True: 0, False: 25]
  ------------------
 3196|  20.1k|      rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|      0|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (3196:7): [True: 0, False: 0]
  ------------------
 3197|      0|    {
 3198|      0|      rar->filename_must_match = 1;
 3199|      0|      ret = archive_read_format_rar_read_header(a, a->entry);
 3200|      0|      if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3200:11): [True: 0, False: 0]
  ------------------
 3201|      0|      {
 3202|      0|        rar->has_endarc_header = 1;
 3203|      0|        ret = archive_read_format_rar_read_header(a, a->entry);
 3204|      0|      }
 3205|      0|      rar->filename_must_match = 0;
 3206|      0|      if (ret != (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3206:11): [True: 0, False: 0]
  ------------------
 3207|      0|        return NULL;
 3208|      0|      return rar_read_ahead(a, min, avail);
 3209|      0|    }
 3210|  20.1k|  }
 3211|  20.1k|  return h;
 3212|  20.1k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data:
 1096|  1.12k|{
 1097|  1.12k|  struct rar *rar = (struct rar *)(a->format->data);
 1098|  1.12k|  int ret;
 1099|       |
 1100|  1.12k|  if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|  1.12k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1100:7): [True: 0, False: 1.12k]
  ------------------
 1101|      0|	  rar->has_encrypted_entries = 0;
 1102|      0|  }
 1103|       |
 1104|  1.12k|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1104:7): [True: 218, False: 905]
  ------------------
 1105|       |      /* Consume as much as the decompressor actually used. */
 1106|    218|      __archive_read_consume(a, rar->bytes_unconsumed);
 1107|    218|      rar->bytes_unconsumed = 0;
 1108|    218|  }
 1109|       |
 1110|  1.12k|  *buff = NULL;
 1111|  1.12k|  if (rar->entry_eof || rar->offset_seek >= rar->unp_size) {
  ------------------
  |  Branch (1111:7): [True: 2, False: 1.12k]
  |  Branch (1111:25): [True: 0, False: 1.12k]
  ------------------
 1112|      2|    *size = 0;
 1113|      2|    *offset = rar->offset;
 1114|      2|    if (*offset < rar->unp_size)
  ------------------
  |  Branch (1114:9): [True: 0, False: 2]
  ------------------
 1115|      0|      *offset = rar->unp_size;
 1116|      2|    return (ARCHIVE_EOF);
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1117|      2|  }
 1118|       |
 1119|  1.12k|  switch (rar->compression_method)
 1120|  1.12k|  {
 1121|      0|  case COMPRESS_METHOD_STORE:
  ------------------
  |  |  113|      0|#define COMPRESS_METHOD_STORE   0x30
  ------------------
  |  Branch (1121:3): [True: 0, False: 1.12k]
  ------------------
 1122|      0|    ret = read_data_stored(a, buff, size, offset);
 1123|      0|    break;
 1124|       |
 1125|    398|  case COMPRESS_METHOD_FASTEST:
  ------------------
  |  |  115|    398|#define COMPRESS_METHOD_FASTEST 0x31
  ------------------
  |  Branch (1125:3): [True: 398, False: 723]
  ------------------
 1126|    622|  case COMPRESS_METHOD_FAST:
  ------------------
  |  |  116|    622|#define COMPRESS_METHOD_FAST    0x32
  ------------------
  |  Branch (1126:3): [True: 224, False: 897]
  ------------------
 1127|  1.07k|  case COMPRESS_METHOD_NORMAL:
  ------------------
  |  |  117|  1.07k|#define COMPRESS_METHOD_NORMAL  0x33
  ------------------
  |  Branch (1127:3): [True: 448, False: 673]
  ------------------
 1128|  1.07k|  case COMPRESS_METHOD_GOOD:
  ------------------
  |  |  119|  1.07k|#define COMPRESS_METHOD_GOOD    0x34
  ------------------
  |  Branch (1128:3): [True: 0, False: 1.12k]
  ------------------
 1129|  1.12k|  case COMPRESS_METHOD_BEST:
  ------------------
  |  |  120|  1.12k|#define COMPRESS_METHOD_BEST    0x35
  ------------------
  |  Branch (1129:3): [True: 51, False: 1.07k]
  ------------------
 1130|  1.12k|    ret = read_data_compressed(a, buff, size, offset, 0);
 1131|  1.12k|    if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
  ------------------
  |  |  192|  2.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
                  if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
  ------------------
  |  |  194|     17|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1131:9): [True: 17, False: 1.10k]
  |  Branch (1131:30): [True: 17, False: 0]
  ------------------
 1132|     17|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1133|     17|      rar->start_new_table = 1;
 1134|     17|      rar->ppmd_valid = 0;
 1135|     17|    }
 1136|  1.12k|    break;
 1137|       |
 1138|      0|  default:
  ------------------
  |  Branch (1138:3): [True: 0, False: 1.12k]
  ------------------
 1139|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1140|      0|                      "Unsupported compression method for RAR file.");
 1141|      0|    ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1142|      0|    break;
 1143|  1.12k|  }
 1144|  1.12k|  return (ret);
 1145|  1.12k|}
archive_read_support_format_rar.c:read_data_compressed:
 2013|  2.14k|{
 2014|  2.14k|  if (looper++ > MAX_COMPRESS_DEPTH)
  ------------------
  |  |  165|  2.14k|#define MAX_COMPRESS_DEPTH 1024
  ------------------
  |  Branch (2014:7): [True: 1, False: 2.14k]
  ------------------
 2015|      1|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2016|       |
 2017|  2.14k|  struct rar *rar;
 2018|  2.14k|  int64_t start, end;
 2019|  2.14k|  size_t bs;
 2020|  2.14k|  int ret = (ARCHIVE_OK), sym, code, lzss_offset, length, i;
  ------------------
  |  |  192|  2.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2021|       |
 2022|  2.14k|  rar = (struct rar *)(a->format->data);
 2023|       |
 2024|  6.72k|  do {
 2025|  6.72k|    if (!rar->valid)
  ------------------
  |  Branch (2025:9): [True: 0, False: 6.72k]
  ------------------
 2026|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2027|       |
 2028|  6.72k|    if (rar->filters.bytes_ready > 0)
  ------------------
  |  Branch (2028:9): [True: 255, False: 6.46k]
  ------------------
 2029|    255|    {
 2030|       |      /* Flush unp_buffer first */
 2031|    255|      if (rar->unp_offset > 0)
  ------------------
  |  Branch (2031:11): [True: 123, False: 132]
  ------------------
 2032|    123|      {
 2033|    123|        *buff = rar->unp_buffer;
 2034|    123|        *size = rar->unp_offset;
 2035|    123|        rar->unp_offset = 0;
 2036|    123|        *offset = rar->offset_outgoing;
 2037|    123|        rar->offset_outgoing += *size;
 2038|    123|      }
 2039|    132|      else
 2040|    132|      {
 2041|    132|        *buff = rar->filters.bytes;
 2042|    132|        *size = rar->filters.bytes_ready;
 2043|       |
 2044|    132|        rar->offset += *size;
 2045|    132|        *offset = rar->offset_outgoing;
 2046|    132|        rar->offset_outgoing += *size;
 2047|       |
 2048|    132|        rar->filters.bytes_ready -= *size;
 2049|    132|        rar->filters.bytes += *size;
 2050|    132|      }
 2051|    255|      goto ending_block;
 2052|    255|    }
 2053|       |
 2054|  6.46k|    if (rar->ppmd_eod ||
  ------------------
  |  Branch (2054:9): [True: 0, False: 6.46k]
  ------------------
 2055|  6.46k|       (rar->dictionary_size && rar->offset >= rar->unp_size))
  ------------------
  |  Branch (2055:9): [True: 6.45k, False: 17]
  |  Branch (2055:33): [True: 2, False: 6.44k]
  ------------------
 2056|      2|    {
 2057|      2|      if (rar->unp_offset > 0) {
  ------------------
  |  Branch (2057:11): [True: 0, False: 2]
  ------------------
 2058|       |        /*
 2059|       |         * We have unprocessed extracted data. write it out.
 2060|       |         */
 2061|      0|        *buff = rar->unp_buffer;
 2062|      0|        *size = rar->unp_offset;
 2063|      0|        *offset = rar->offset_outgoing;
 2064|      0|        rar->offset_outgoing += *size;
 2065|       |        /* Calculate File CRC. */
 2066|      0|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2067|      0|          (unsigned)*size);
 2068|      0|        rar->unp_offset = 0;
 2069|      0|        return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2070|      0|      }
 2071|      2|      *buff = NULL;
 2072|      2|      *size = 0;
 2073|      2|      *offset = rar->offset;
 2074|      2|      if (rar->file_crc != rar->crc_calculated) {
  ------------------
  |  Branch (2074:11): [True: 2, False: 0]
  ------------------
 2075|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2076|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2077|       |                          "File CRC error");
 2078|       |        return (ARCHIVE_FATAL);
 2079|       |#endif
 2080|      2|      }
 2081|      2|      rar->entry_eof = 1;
 2082|      2|      return (ARCHIVE_EOF);
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2083|      2|    }
 2084|       |
 2085|  6.46k|    if (!rar->is_ppmd_block && rar->dictionary_size && rar->bytes_uncopied > 0)
  ------------------
  |  Branch (2085:9): [True: 1.47k, False: 4.98k]
  |  Branch (2085:32): [True: 1.45k, False: 17]
  |  Branch (2085:56): [True: 849, False: 610]
  ------------------
 2086|    849|    {
 2087|    849|      if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2087:11): [True: 763, False: 86]
  ------------------
 2088|    763|        bs = rar->unp_buffer_size - rar->unp_offset;
 2089|     86|      else
 2090|     86|        bs = (size_t)rar->bytes_uncopied;
 2091|    849|      ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2092|    849|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    849|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2092:11): [True: 0, False: 849]
  ------------------
 2093|      0|        return (ret);
 2094|    849|      rar->offset += bs;
 2095|    849|      rar->bytes_uncopied -= bs;
 2096|    849|      if (*buff != NULL) {
  ------------------
  |  Branch (2096:11): [True: 763, False: 86]
  ------------------
 2097|    763|        rar->unp_offset = 0;
 2098|    763|        *size = rar->unp_buffer_size;
 2099|    763|        *offset = rar->offset_outgoing;
 2100|    763|        rar->offset_outgoing += *size;
 2101|       |        /* Calculate File CRC. */
 2102|    763|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2103|    763|          (unsigned)*size);
 2104|    763|        return (ret);
 2105|    763|      }
 2106|     86|      continue;
 2107|    849|    }
 2108|       |
 2109|  5.61k|    if (rar->filters.lastend == rar->filters.filterstart)
  ------------------
  |  Branch (2109:9): [True: 132, False: 5.48k]
  ------------------
 2110|    132|    {
 2111|    132|      if (!run_filters(a))
  ------------------
  |  Branch (2111:11): [True: 0, False: 132]
  ------------------
 2112|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2113|    132|      continue;
 2114|    132|    }
 2115|       |
 2116|  5.48k|    if (!rar->br.next_in &&
  ------------------
  |  Branch (2116:9): [True: 17, False: 5.46k]
  ------------------
 2117|  5.48k|      (ret = rar_br_preparation(a, &(rar->br))) < ARCHIVE_WARN)
  ------------------
  |  |  194|     17|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2117:7): [True: 0, False: 17]
  ------------------
 2118|      0|      return (ret);
 2119|  5.48k|    if (rar->start_new_table && ((ret = parse_codes(a)) < (ARCHIVE_WARN)))
  ------------------
  |  |  194|  1.04k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2119:9): [True: 1.04k, False: 4.44k]
  |  Branch (2119:33): [True: 1, False: 1.04k]
  ------------------
 2120|      1|      return (ret);
 2121|       |
 2122|  5.48k|    if (rar->is_ppmd_block)
  ------------------
  |  Branch (2122:9): [True: 4.99k, False: 493]
  ------------------
 2123|  4.99k|    {
 2124|  4.99k|      if ((sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2124:11): [True: 0, False: 4.99k]
  ------------------
 2125|  4.99k|        &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2126|      0|      {
 2127|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2128|      0|                          "Invalid symbol");
 2129|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2130|      0|      }
 2131|  4.99k|      if(sym != rar->ppmd_escape)
  ------------------
  |  Branch (2131:10): [True: 3.96k, False: 1.02k]
  ------------------
 2132|  3.96k|      {
 2133|  3.96k|        lzss_emit_literal(rar, sym);
 2134|  3.96k|        rar->bytes_uncopied++;
 2135|  3.96k|      }
 2136|  1.02k|      else
 2137|  1.02k|      {
 2138|  1.02k|        if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2138:13): [True: 0, False: 1.02k]
  ------------------
 2139|  1.02k|          &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2140|      0|        {
 2141|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2142|      0|                            "Invalid symbol");
 2143|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2144|      0|        }
 2145|       |
 2146|  1.02k|        switch(code)
 2147|  1.02k|        {
 2148|  1.02k|          case 0:
  ------------------
  |  Branch (2148:11): [True: 1.02k, False: 0]
  ------------------
 2149|  1.02k|            rar->start_new_table = 1;
 2150|  1.02k|            return read_data_compressed(a, buff, size, offset, looper);
 2151|       |
 2152|      0|          case 2:
  ------------------
  |  Branch (2152:11): [True: 0, False: 1.02k]
  ------------------
 2153|      0|            rar->ppmd_eod = 1;/* End Of ppmd Data. */
 2154|      0|            continue;
 2155|       |
 2156|      0|          case 3:
  ------------------
  |  Branch (2156:11): [True: 0, False: 1.02k]
  ------------------
 2157|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2158|      0|                              "Parsing filters is unsupported.");
 2159|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2160|       |
 2161|      0|          case 4:
  ------------------
  |  Branch (2161:11): [True: 0, False: 1.02k]
  ------------------
 2162|      0|            lzss_offset = 0;
 2163|      0|            for (i = 2; i >= 0; i--)
  ------------------
  |  Branch (2163:25): [True: 0, False: 0]
  ------------------
 2164|      0|            {
 2165|      0|              if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2165:19): [True: 0, False: 0]
  ------------------
 2166|      0|                &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2167|      0|              {
 2168|      0|                archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2169|      0|                                  "Invalid symbol");
 2170|      0|                return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2171|      0|              }
 2172|      0|              lzss_offset |= code << (i * 8);
 2173|      0|            }
 2174|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2174:17): [True: 0, False: 0]
  ------------------
 2175|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2176|      0|            {
 2177|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2178|      0|                                "Invalid symbol");
 2179|      0|              return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2180|      0|            }
 2181|      0|            lzss_emit_match(rar, lzss_offset + 2, length + 32);
 2182|      0|            rar->bytes_uncopied += length + 32;
 2183|      0|            break;
 2184|       |
 2185|      0|          case 5:
  ------------------
  |  Branch (2185:11): [True: 0, False: 1.02k]
  ------------------
 2186|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2186:17): [True: 0, False: 0]
  ------------------
 2187|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2188|      0|            {
 2189|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2190|      0|                                "Invalid symbol");
 2191|      0|              return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2192|      0|            }
 2193|      0|            lzss_emit_match(rar, 1, length + 4);
 2194|      0|            rar->bytes_uncopied += length + 4;
 2195|      0|            break;
 2196|       |
 2197|      0|         default:
  ------------------
  |  Branch (2197:10): [True: 0, False: 1.02k]
  ------------------
 2198|      0|           lzss_emit_literal(rar, sym);
 2199|      0|           rar->bytes_uncopied++;
 2200|  1.02k|        }
 2201|  1.02k|      }
 2202|  4.99k|    }
 2203|    493|    else
 2204|    493|    {
 2205|    493|      start = rar->offset;
 2206|    493|      end = start + rar->dictionary_size;
 2207|       |
 2208|       |      /* We don't want to overflow the window and overwrite data that we write
 2209|       |       * at 'start'. Therefore, reduce the end length by the maximum match size,
 2210|       |       * which is 260 bytes. You can compute this maximum by looking at the
 2211|       |       * definition of 'expand', in particular when 'symbol >= 271'. */
 2212|       |      /* NOTE: It's possible for 'dictionary_size' to be less than this 260
 2213|       |       * value, however that will only be the case when 'unp_size' is small,
 2214|       |       * which should only happen when the entry size is small and there's no
 2215|       |       * risk of overflowing the buffer */
 2216|    493|      if (rar->dictionary_size > 260) {
  ------------------
  |  Branch (2216:11): [True: 493, False: 0]
  ------------------
 2217|    493|        end -= 260;
 2218|    493|      }
 2219|       |
 2220|    493|      if (rar->filters.filterstart < end) {
  ------------------
  |  Branch (2220:11): [True: 136, False: 357]
  ------------------
 2221|    136|        end = rar->filters.filterstart;
 2222|    136|      }
 2223|       |
 2224|    493|      ret = expand(a, &end);
 2225|    493|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    493|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2225:11): [True: 13, False: 480]
  ------------------
 2226|     13|	      return (ret);
 2227|       |
 2228|    480|      rar->bytes_uncopied = end - start;
 2229|    480|      rar->filters.lastend = end;
 2230|    480|      if (rar->filters.lastend != rar->filters.filterstart && rar->bytes_uncopied == 0) {
  ------------------
  |  Branch (2230:11): [True: 348, False: 132]
  |  Branch (2230:63): [True: 0, False: 348]
  ------------------
 2231|       |          /* Broken RAR files cause this case.
 2232|       |          * NOTE: If this case were possible on a normal RAR file
 2233|       |          * we would find out where it was actually bad and
 2234|       |          * what we would do to solve it. */
 2235|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2236|      0|                            "Internal error extracting RAR file");
 2237|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2238|      0|      }
 2239|    480|    }
 2240|  4.44k|    if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2240:9): [True: 86, False: 4.35k]
  ------------------
 2241|     86|      bs = rar->unp_buffer_size - rar->unp_offset;
 2242|  4.35k|    else
 2243|  4.35k|      bs = (size_t)rar->bytes_uncopied;
 2244|  4.44k|    ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2245|  4.44k|    if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|  4.44k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2245:9): [True: 0, False: 4.44k]
  ------------------
 2246|      0|      return (ret);
 2247|  4.44k|    rar->offset += bs;
 2248|  4.44k|    rar->bytes_uncopied -= bs;
 2249|       |    /*
 2250|       |     * If *buff is NULL, it means unp_buffer is not full.
 2251|       |     * So we have to continue extracting a RAR file.
 2252|       |     */
 2253|  4.66k|  } while (*buff == NULL);
  ------------------
  |  Branch (2253:12): [True: 4.57k, False: 86]
  ------------------
 2254|       |
 2255|     86|  rar->unp_offset = 0;
 2256|     86|  *size = rar->unp_buffer_size;
 2257|     86|  *offset = rar->offset_outgoing;
 2258|     86|  rar->offset_outgoing += *size;
 2259|    341|ending_block:
 2260|       |  /* Calculate File CRC. */
 2261|    341|  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (unsigned)*size);
 2262|    341|  return ret;
 2263|     86|}
archive_read_support_format_rar.c:copy_from_lzss_window_to_unp:
 3126|  5.29k|{
 3127|  5.29k|  int windowoffs, firstpart;
 3128|  5.29k|  struct rar *rar = (struct rar *)(a->format->data);
 3129|       |
 3130|  5.29k|  if (length > rar->unp_buffer_size)
  ------------------
  |  Branch (3130:7): [True: 0, False: 5.29k]
  ------------------
 3131|      0|  {
 3132|      0|    goto fatal;
 3133|      0|  }
 3134|       |
 3135|  5.29k|  if (!rar->unp_buffer)
  ------------------
  |  Branch (3135:7): [True: 17, False: 5.27k]
  ------------------
 3136|     17|  {
 3137|     17|    if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
  ------------------
  |  Branch (3137:9): [True: 0, False: 17]
  ------------------
 3138|      0|    {
 3139|      0|      archive_set_error(&a->archive, ENOMEM,
 3140|      0|                        "Unable to allocate memory for uncompressed data.");
 3141|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3142|      0|    }
 3143|     17|  }
 3144|       |
 3145|  5.29k|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3146|  5.29k|  if(windowoffs + length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3146:6): [True: 5.29k, False: 3]
  ------------------
 3147|  5.29k|    memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs],
 3148|  5.29k|           length);
 3149|  5.29k|  } else if (length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3149:14): [True: 3, False: 0]
  ------------------
 3150|      3|    firstpart = lzss_size(&rar->lzss) - windowoffs;
 3151|      3|    if (firstpart < 0) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 3]
  ------------------
 3152|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3153|      0|                        "Bad RAR file data");
 3154|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3155|      0|    }
 3156|      3|    if ((size_t)firstpart < length) {
  ------------------
  |  Branch (3156:9): [True: 3, False: 0]
  ------------------
 3157|      3|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3158|      3|             &rar->lzss.window[windowoffs], firstpart);
 3159|      3|      memcpy(&rar->unp_buffer[rar->unp_offset + firstpart],
 3160|      3|             &rar->lzss.window[0], length - firstpart);
 3161|      3|    } else {
 3162|      0|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3163|      0|             &rar->lzss.window[windowoffs], length);
 3164|      0|    }
 3165|      3|  } else {
 3166|      0|      goto fatal;
 3167|      0|  }
 3168|  5.29k|  rar->unp_offset += (unsigned int) length;
 3169|  5.29k|  if (rar->unp_offset >= rar->unp_buffer_size)
  ------------------
  |  Branch (3169:7): [True: 849, False: 4.44k]
  ------------------
 3170|    849|    *buffer = rar->unp_buffer;
 3171|  4.44k|  else
 3172|  4.44k|    *buffer = NULL;
 3173|  5.29k|  return (ARCHIVE_OK);
  ------------------
  |  |  192|  5.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3174|       |
 3175|      0|fatal:
 3176|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3177|      0|                    "Bad RAR file data");
 3178|      0|  return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3179|  5.29k|}
archive_read_support_format_rar.c:lzss_offset_for_position:
  646|  9.17M|{
  647|  9.17M|  return (int)(pos & lzss->mask);
  648|  9.17M|}
archive_read_support_format_rar.c:lzss_size:
  640|  2.23M|{
  641|  2.23M|  return lzss->mask + 1;
  642|  2.23M|}
archive_read_support_format_rar.c:run_filters:
 3380|    132|{
 3381|    132|  struct rar *rar = (struct rar *)(a->format->data);
 3382|    132|  struct rar_filters *filters = &rar->filters;
 3383|    132|  struct rar_filter *filter = filters->stack;
 3384|    132|  struct rar_filter *f;
 3385|    132|  size_t start, end;
 3386|    132|  int64_t tend;
 3387|    132|  uint32_t lastfilteraddress;
 3388|    132|  uint32_t lastfilterlength;
 3389|    132|  int ret;
 3390|       |
 3391|    132|  if (filters == NULL || filter == NULL)
  ------------------
  |  Branch (3391:7): [True: 0, False: 132]
  |  Branch (3391:26): [True: 0, False: 132]
  ------------------
 3392|      0|    return (0);
 3393|       |
 3394|    132|  start = (size_t)filters->filterstart;
 3395|    132|  end = start + filter->blocklength;
 3396|       |
 3397|    132|  filters->filterstart = INT64_MAX;
 3398|    132|  tend = (int64_t)end;
 3399|    132|  ret = expand(a, &tend);
 3400|    132|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3400:7): [True: 0, False: 132]
  ------------------
 3401|      0|    return 0;
 3402|       |
 3403|       |  /* Check if filter stack was modified in expand() */
 3404|    132|  ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|    132|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3405|    132|  f = filters->stack;
 3406|    132|  while (f)
  ------------------
  |  Branch (3406:10): [True: 132, False: 0]
  ------------------
 3407|    132|  {
 3408|    132|    if (f == filter)
  ------------------
  |  Branch (3408:9): [True: 132, False: 0]
  ------------------
 3409|    132|    {
 3410|    132|      ret = ARCHIVE_OK;
  ------------------
  |  |  192|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3411|    132|      break;
 3412|    132|    }
 3413|      0|    f = f->next;
 3414|      0|  }
 3415|    132|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3415:7): [True: 0, False: 132]
  ------------------
 3416|      0|    return 0;
 3417|       |
 3418|    132|  if (tend < 0)
  ------------------
  |  Branch (3418:7): [True: 0, False: 132]
  ------------------
 3419|      0|    return 0;
 3420|    132|  end = (size_t)tend;
 3421|    132|  if (end != start + filter->blocklength)
  ------------------
  |  Branch (3421:7): [True: 0, False: 132]
  ------------------
 3422|      0|    return 0;
 3423|       |
 3424|    132|  if (!filters->vm)
  ------------------
  |  Branch (3424:7): [True: 9, False: 123]
  ------------------
 3425|      9|  {
 3426|      9|    filters->vm = calloc(1, sizeof(*filters->vm));
 3427|      9|    if (!filters->vm)
  ------------------
  |  Branch (3427:9): [True: 0, False: 9]
  ------------------
 3428|      0|      return 0;
 3429|      9|  }
 3430|       |
 3431|    132|  ret = copy_from_lzss_window(a, filters->vm->memory, start, filter->blocklength);
 3432|    132|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3432:7): [True: 0, False: 132]
  ------------------
 3433|      0|    return 0;
 3434|    132|  if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3434:7): [True: 0, False: 132]
  ------------------
 3435|      0|    return 0;
 3436|       |
 3437|    132|  lastfilteraddress = filter->filteredblockaddress;
 3438|    132|  lastfilterlength = filter->filteredblocklength;
 3439|    132|  filters->stack = filter->next;
 3440|    132|  filter->next = NULL;
 3441|    132|  delete_filter(filter);
 3442|       |
 3443|    132|  while ((filter = filters->stack) != NULL && (int64_t)filter->blockstartpos == filters->filterstart && filter->blocklength == lastfilterlength)
  ------------------
  |  Branch (3443:10): [True: 115, False: 17]
  |  Branch (3443:47): [True: 0, False: 115]
  |  Branch (3443:105): [True: 0, False: 0]
  ------------------
 3444|      0|  {
 3445|      0|    memmove(&filters->vm->memory[0], &filters->vm->memory[lastfilteraddress], lastfilterlength);
 3446|      0|    if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3446:9): [True: 0, False: 0]
  ------------------
 3447|      0|      return 0;
 3448|       |
 3449|      0|    lastfilteraddress = filter->filteredblockaddress;
 3450|      0|    lastfilterlength = filter->filteredblocklength;
 3451|      0|    filters->stack = filter->next;
 3452|      0|    filter->next = NULL;
 3453|      0|    delete_filter(filter);
 3454|      0|  }
 3455|       |
 3456|    132|  if (filters->stack)
  ------------------
  |  Branch (3456:7): [True: 115, False: 17]
  ------------------
 3457|    115|  {
 3458|    115|    if (filters->stack->blockstartpos < end)
  ------------------
  |  Branch (3458:9): [True: 0, False: 115]
  ------------------
 3459|      0|      return 0;
 3460|    115|    filters->filterstart = filters->stack->blockstartpos;
 3461|    115|  }
 3462|       |
 3463|    132|  filters->lastend = end;
 3464|    132|  filters->bytes = &filters->vm->memory[lastfilteraddress];
 3465|    132|  filters->bytes_ready = lastfilterlength;
 3466|       |
 3467|    132|  return 1;
 3468|    132|}
archive_read_support_format_rar.c:copy_from_lzss_window:
 3103|    132|{
 3104|    132|  int windowoffs, firstpart;
 3105|    132|  struct rar *rar = (struct rar *)(a->format->data);
 3106|       |
 3107|    132|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3108|    132|  firstpart = lzss_size(&rar->lzss) - windowoffs;
 3109|    132|  if (firstpart < 0) {
  ------------------
  |  Branch (3109:7): [True: 0, False: 132]
  ------------------
 3110|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3111|      0|                      "Bad RAR file data");
 3112|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3113|      0|  }
 3114|    132|  if (firstpart < length) {
  ------------------
  |  Branch (3114:7): [True: 0, False: 132]
  ------------------
 3115|      0|    memcpy(buffer, &rar->lzss.window[windowoffs], firstpart);
 3116|      0|    memcpy(buffer, &rar->lzss.window[0], length - firstpart);
 3117|    132|  } else {
 3118|    132|    memcpy(buffer, &rar->lzss.window[windowoffs], length);
 3119|    132|  }
 3120|    132|  return (ARCHIVE_OK);
  ------------------
  |  |  192|    132|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3121|    132|}
archive_read_support_format_rar.c:execute_filter:
 3824|    132|{
 3825|    132|  if (filter->prog->fingerprint == 0x1D0E06077D)
  ------------------
  |  Branch (3825:7): [True: 1, False: 131]
  ------------------
 3826|      1|    return execute_filter_delta(filter, vm);
 3827|    131|  if (filter->prog->fingerprint == 0x35AD576887)
  ------------------
  |  Branch (3827:7): [True: 131, False: 0]
  ------------------
 3828|    131|    return execute_filter_e8(filter, vm, pos, 0);
 3829|      0|  if (filter->prog->fingerprint == 0x393CD7E57E)
  ------------------
  |  Branch (3829:7): [True: 0, False: 0]
  ------------------
 3830|      0|    return execute_filter_e8(filter, vm, pos, 1);
 3831|      0|  if (filter->prog->fingerprint == 0x951C2C5DC8)
  ------------------
  |  Branch (3831:7): [True: 0, False: 0]
  ------------------
 3832|      0|    return execute_filter_rgb(filter, vm);
 3833|      0|  if (filter->prog->fingerprint == 0xD8BC85E701)
  ------------------
  |  Branch (3833:7): [True: 0, False: 0]
  ------------------
 3834|      0|    return execute_filter_audio(filter, vm);
 3835|       |
 3836|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "No support for RAR VM program filter");
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3837|      0|  return 0;
 3838|      0|}
archive_read_support_format_rar.c:execute_filter_delta:
 3639|      1|{
 3640|      1|  uint32_t length = filter->initialregisters[4];
 3641|      1|  uint32_t numchannels = filter->initialregisters[0];
 3642|      1|  uint8_t *src, *dst;
 3643|      1|  uint32_t i, idx;
 3644|       |
 3645|      1|  if (length > PROGRAM_WORK_SIZE / 2)
  ------------------
  |  |  141|      1|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3645:7): [True: 0, False: 1]
  ------------------
 3646|      0|    return 0;
 3647|       |
 3648|      1|  src = &vm->memory[0];
 3649|      1|  dst = &vm->memory[length];
 3650|      3|  for (i = 0; i < numchannels; i++)
  ------------------
  |  Branch (3650:15): [True: 2, False: 1]
  ------------------
 3651|      2|  {
 3652|      2|    uint8_t lastbyte = 0;
 3653|     50|    for (idx = i; idx < length; idx += numchannels)
  ------------------
  |  Branch (3653:19): [True: 48, False: 2]
  ------------------
 3654|     48|    {
 3655|       |      /*
 3656|       |       * The src block should not overlap with the dst block.
 3657|       |       * If so it would be better to consider this archive is broken.
 3658|       |       */
 3659|     48|      if (src >= dst)
  ------------------
  |  Branch (3659:11): [True: 0, False: 48]
  ------------------
 3660|      0|        return 0;
 3661|     48|      lastbyte = dst[idx] = lastbyte - *src++;
 3662|     48|    }
 3663|      2|  }
 3664|       |
 3665|      1|  filter->filteredblockaddress = length;
 3666|      1|  filter->filteredblocklength = length;
 3667|       |
 3668|      1|  return 1;
 3669|      1|}
archive_read_support_format_rar.c:execute_filter_e8:
 3673|    131|{
 3674|    131|  uint32_t length = filter->initialregisters[4];
 3675|    131|  uint32_t filesize = 0x1000000;
 3676|    131|  uint32_t i;
 3677|       |
 3678|    131|  if (length > PROGRAM_WORK_SIZE || length <= 4)
  ------------------
  |  |  141|    262|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3678:7): [True: 0, False: 131]
  |  Branch (3678:37): [True: 0, False: 131]
  ------------------
 3679|      0|    return 0;
 3680|       |
 3681|   781k|  for (i = 0; i <= length - 5; i++)
  ------------------
  |  Branch (3681:15): [True: 781k, False: 131]
  ------------------
 3682|   781k|  {
 3683|   781k|    if (vm->memory[i] == 0xE8 || (e9also && vm->memory[i] == 0xE9))
  ------------------
  |  Branch (3683:9): [True: 4.03k, False: 777k]
  |  Branch (3683:35): [True: 0, False: 777k]
  |  Branch (3683:45): [True: 0, False: 0]
  ------------------
 3684|  4.03k|    {
 3685|  4.03k|      uint32_t currpos = (uint32_t)pos + i + 1;
 3686|  4.03k|      int32_t address = (int32_t)vm_read_32(vm, i + 1);
 3687|  4.03k|      if (address < 0 && currpos >= -(uint32_t)address)
  ------------------
  |  Branch (3687:11): [True: 2.76k, False: 1.26k]
  |  Branch (3687:26): [True: 4, False: 2.76k]
  ------------------
 3688|      4|        vm_write_32(vm, i + 1, address + filesize);
 3689|  4.02k|      else if (address >= 0 && (uint32_t)address < filesize)
  ------------------
  |  Branch (3689:16): [True: 1.26k, False: 2.76k]
  |  Branch (3689:32): [True: 320, False: 944]
  ------------------
 3690|    320|        vm_write_32(vm, i + 1, address - currpos);
 3691|  4.03k|      i += 4;
 3692|  4.03k|    }
 3693|   781k|  }
 3694|       |
 3695|    131|  filter->filteredblockaddress = 0;
 3696|    131|  filter->filteredblocklength = length;
 3697|       |
 3698|    131|  return 1;
 3699|    131|}
archive_read_support_format_rar.c:vm_read_32:
 3860|  4.03k|{
 3861|  4.03k|  return archive_le32dec(vm->memory + offset);
 3862|  4.03k|}
archive_read_support_format_rar.c:vm_write_32:
 3854|    324|{
 3855|    324|  archive_le32enc(vm->memory + offset, u32);
 3856|    324|}
archive_read_support_format_rar.c:delete_filter:
 3512|    485|{
 3513|    746|  while (filter)
  ------------------
  |  Branch (3513:10): [True: 261, False: 485]
  ------------------
 3514|    261|  {
 3515|    261|    struct rar_filter *next = filter->next;
 3516|    261|    free(filter->globaldata);
 3517|    261|    free(filter);
 3518|    261|    filter = next;
 3519|    261|  }
 3520|    485|}
archive_read_support_format_rar.c:rar_br_preparation:
  596|     17|{
  597|     17|  struct rar *rar = (struct rar *)(a->format->data);
  598|       |
  599|     17|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (599:7): [True: 17, False: 0]
  ------------------
  600|     17|    br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  601|     17|    if (br->next_in == NULL) {
  ------------------
  |  Branch (601:9): [True: 0, False: 17]
  ------------------
  602|      0|      archive_set_error(&a->archive,
  603|      0|          ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  604|      0|          "Truncated RAR file data");
  605|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  606|      0|    }
  607|     17|    if (br->cache_avail == 0)
  ------------------
  |  Branch (607:9): [True: 17, False: 0]
  ------------------
  608|     17|      (void)rar_br_fillup(a, br);
  609|     17|  }
  610|     17|  return (ARCHIVE_OK);
  ------------------
  |  |  192|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  611|     17|}
archive_read_support_format_rar.c:rar_br_fillup:
  501|   708k|{
  502|   708k|  struct rar *rar = (struct rar *)(a->format->data);
  503|   708k|  int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  382|   708k|#define CACHE_BITS	(8 * sizeof(CACHE_TYPE))
  ------------------
  504|       |
  505|   831k|  for (;;) {
  506|   831k|    switch (n >> 3) {
  507|  82.5k|    case 8:
  ------------------
  |  Branch (507:5): [True: 82.5k, False: 749k]
  ------------------
  508|  82.5k|      if (br->avail_in >= 8) {
  ------------------
  |  Branch (508:11): [True: 82.3k, False: 232]
  ------------------
  509|  82.3k|        br->cache_buffer =
  510|  82.3k|            ((uint64_t)br->next_in[0]) << 56 |
  511|  82.3k|            ((uint64_t)br->next_in[1]) << 48 |
  512|  82.3k|            ((uint64_t)br->next_in[2]) << 40 |
  513|  82.3k|            ((uint64_t)br->next_in[3]) << 32 |
  514|  82.3k|            ((uint32_t)br->next_in[4]) << 24 |
  515|  82.3k|            ((uint32_t)br->next_in[5]) << 16 |
  516|  82.3k|            ((uint32_t)br->next_in[6]) << 8 |
  517|  82.3k|             (uint32_t)br->next_in[7];
  518|  82.3k|        br->next_in += 8;
  519|  82.3k|        br->avail_in -= 8;
  520|  82.3k|        br->cache_avail += 8 * 8;
  521|  82.3k|        rar->bytes_unconsumed += 8;
  522|  82.3k|        rar->bytes_remaining -= 8;
  523|  82.3k|        return (1);
  524|  82.3k|      }
  525|    232|      break;
  526|   546k|    case 7:
  ------------------
  |  Branch (526:5): [True: 546k, False: 285k]
  ------------------
  527|   546k|      if (br->avail_in >= 7) {
  ------------------
  |  Branch (527:11): [True: 527k, False: 19.2k]
  ------------------
  528|   527k|        br->cache_buffer =
  529|   527k|           (br->cache_buffer << 56) |
  530|   527k|            ((uint64_t)br->next_in[0]) << 48 |
  531|   527k|            ((uint64_t)br->next_in[1]) << 40 |
  532|   527k|            ((uint64_t)br->next_in[2]) << 32 |
  533|   527k|            ((uint32_t)br->next_in[3]) << 24 |
  534|   527k|            ((uint32_t)br->next_in[4]) << 16 |
  535|   527k|            ((uint32_t)br->next_in[5]) << 8 |
  536|   527k|             (uint32_t)br->next_in[6];
  537|   527k|        br->next_in += 7;
  538|   527k|        br->avail_in -= 7;
  539|   527k|        br->cache_avail += 7 * 8;
  540|   527k|        rar->bytes_unconsumed += 7;
  541|   527k|        rar->bytes_remaining -= 7;
  542|   527k|        return (1);
  543|   527k|      }
  544|  19.2k|      break;
  545|  98.4k|    case 6:
  ------------------
  |  Branch (545:5): [True: 98.4k, False: 733k]
  ------------------
  546|  98.4k|      if (br->avail_in >= 6) {
  ------------------
  |  Branch (546:11): [True: 81.1k, False: 17.3k]
  ------------------
  547|  81.1k|        br->cache_buffer =
  548|  81.1k|           (br->cache_buffer << 48) |
  549|  81.1k|            ((uint64_t)br->next_in[0]) << 40 |
  550|  81.1k|            ((uint64_t)br->next_in[1]) << 32 |
  551|  81.1k|            ((uint32_t)br->next_in[2]) << 24 |
  552|  81.1k|            ((uint32_t)br->next_in[3]) << 16 |
  553|  81.1k|            ((uint32_t)br->next_in[4]) << 8 |
  554|  81.1k|             (uint32_t)br->next_in[5];
  555|  81.1k|        br->next_in += 6;
  556|  81.1k|        br->avail_in -= 6;
  557|  81.1k|        br->cache_avail += 6 * 8;
  558|  81.1k|        rar->bytes_unconsumed += 6;
  559|  81.1k|        rar->bytes_remaining -= 6;
  560|  81.1k|        return (1);
  561|  81.1k|      }
  562|  17.3k|      break;
  563|  17.3k|    case 0:
  ------------------
  |  Branch (563:5): [True: 17.3k, False: 814k]
  ------------------
  564|       |      /* We have enough compressed data in
  565|       |       * the cache buffer.*/
  566|  17.3k|      return (1);
  567|  86.7k|    default:
  ------------------
  |  Branch (567:5): [True: 86.7k, False: 744k]
  ------------------
  568|  86.7k|      break;
  569|   831k|    }
  570|   123k|    if (br->avail_in <= 0) {
  ------------------
  |  Branch (570:9): [True: 20.1k, False: 103k]
  ------------------
  571|       |
  572|  20.1k|      if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (572:11): [True: 20.1k, False: 12]
  ------------------
  573|       |        /* Consume as much as the decompressor
  574|       |         * actually used. */
  575|  20.1k|        __archive_read_consume(a, rar->bytes_unconsumed);
  576|  20.1k|        rar->bytes_unconsumed = 0;
  577|  20.1k|      }
  578|  20.1k|      br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  579|  20.1k|      if (br->next_in == NULL)
  ------------------
  |  Branch (579:11): [True: 25, False: 20.1k]
  ------------------
  580|     25|        return (0);
  581|  20.1k|      if (br->avail_in == 0)
  ------------------
  |  Branch (581:11): [True: 0, False: 20.1k]
  ------------------
  582|      0|        return (0);
  583|  20.1k|    }
  584|   123k|    br->cache_buffer =
  585|   123k|       (br->cache_buffer << 8) | *br->next_in++;
  586|   123k|    br->avail_in--;
  587|   123k|    br->cache_avail += 8;
  588|   123k|    n -= 8;
  589|   123k|    rar->bytes_unconsumed++;
  590|   123k|    rar->bytes_remaining--;
  591|   123k|  }
  592|   708k|}
archive_read_support_format_rar.c:parse_codes:
 2267|  1.30k|{
 2268|  1.30k|  int i, j, val, n, r;
 2269|  1.30k|  unsigned char bitlengths[MAX_SYMBOLS], zerocount, ppmd_flags;
 2270|  1.30k|  unsigned int maxorder;
 2271|  1.30k|  struct huffman_code precode;
 2272|  1.30k|  struct rar *rar = (struct rar *)(a->format->data);
 2273|  1.30k|  struct rar_br *br = &(rar->br);
 2274|       |
 2275|  1.30k|  free_codes(a);
 2276|       |
 2277|       |  /* Skip to the next byte */
 2278|  1.30k|  rar_br_consume_unalined_bits(br);
  ------------------
  |  |  478|  1.30k|#define rar_br_consume_unalined_bits(br) ((br)->cache_avail &= ~7)
  ------------------
 2279|       |
 2280|       |  /* PPMd block flag */
 2281|  1.30k|  if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|  1.30k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  2.60k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.17k, False: 128]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 128, False: 0]
  |  |  ------------------
  ------------------
 2282|      0|    goto truncated_data;
 2283|  1.30k|  if ((rar->is_ppmd_block = rar_br_bits(br, 1)) != 0)
  ------------------
  |  |  465|  1.30k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.30k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2283:7): [True: 1.02k, False: 277]
  ------------------
 2284|  1.02k|  {
 2285|  1.02k|    rar_br_consume(br, 1);
  ------------------
  |  |  477|  1.02k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2286|  1.02k|    if (!rar_br_read_ahead(a, br, 7))
  ------------------
  |  |  475|  1.02k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  2.05k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.02k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2287|      0|      goto truncated_data;
 2288|  1.02k|    ppmd_flags = rar_br_bits(br, 7);
  ------------------
  |  |  465|  1.02k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.02k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2289|  1.02k|    rar_br_consume(br, 7);
  ------------------
  |  |  477|  1.02k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2290|       |
 2291|       |    /* Memory is allocated in MB */
 2292|  1.02k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2292:9): [True: 2, False: 1.02k]
  ------------------
 2293|      2|    {
 2294|      2|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|      2|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      4|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 2295|      0|        goto truncated_data;
 2296|      2|      rar->dictionary_size = (rar_br_bits(br, 8) + 1) << 20;
  ------------------
  |  |  465|      2|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      2|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2297|      2|      rar_br_consume(br, 8);
  ------------------
  |  |  477|      2|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2298|      2|    }
 2299|       |
 2300|  1.02k|    if (ppmd_flags & 0x40)
  ------------------
  |  Branch (2300:9): [True: 1, False: 1.02k]
  ------------------
 2301|      1|    {
 2302|      1|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|      1|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      2|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2303|      0|        goto truncated_data;
 2304|      1|      rar->ppmd_escape = rar->ppmd7_context.InitEsc = rar_br_bits(br, 8);
  ------------------
  |  |  465|      1|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      1|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2305|      1|      rar_br_consume(br, 8);
  ------------------
  |  |  477|      1|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2306|      1|    }
 2307|  1.02k|    else
 2308|  1.02k|      rar->ppmd_escape = 2;
 2309|       |
 2310|  1.02k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2310:9): [True: 2, False: 1.02k]
  ------------------
 2311|      2|    {
 2312|      2|      maxorder = (ppmd_flags & 0x1F) + 1;
 2313|      2|      if(maxorder > 16)
  ------------------
  |  Branch (2313:10): [True: 2, False: 0]
  ------------------
 2314|      2|        maxorder = 16 + (maxorder - 16) * 3;
 2315|       |
 2316|      2|      if (maxorder == 1)
  ------------------
  |  Branch (2316:11): [True: 0, False: 2]
  ------------------
 2317|      0|      {
 2318|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2319|      0|                          "Truncated RAR file data");
 2320|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2321|      0|      }
 2322|       |
 2323|       |      /* Make sure ppmd7_contest is freed before Ppmd7_Construct
 2324|       |       * because reading a broken file cause this abnormal sequence. */
 2325|      2|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 2326|       |
 2327|      2|      rar->bytein.a = a;
 2328|      2|      rar->bytein.Read = &ppmd_read;
 2329|      2|      __archive_ppmd7_functions.PpmdRAR_RangeDec_CreateVTable(&rar->range_dec);
 2330|      2|      rar->range_dec.Stream = &rar->bytein;
 2331|      2|      __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
 2332|       |
 2333|      2|      if (rar->dictionary_size == 0) {
  ------------------
  |  Branch (2333:11): [True: 0, False: 2]
  ------------------
 2334|      0|	      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2335|      0|                          "Invalid zero dictionary size");
 2336|      0|	      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2337|      0|      }
 2338|       |
 2339|      2|      if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context,
  ------------------
  |  Branch (2339:11): [True: 0, False: 2]
  ------------------
 2340|      2|        rar->dictionary_size))
 2341|      0|      {
 2342|      0|        archive_set_error(&a->archive, ENOMEM,
 2343|      0|                          "Out of memory");
 2344|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2345|      0|      }
 2346|      2|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2346:11): [True: 1, False: 1]
  ------------------
 2347|      1|      {
 2348|      1|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2349|      1|                          "Unable to initialize PPMd range decoder");
 2350|      1|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2351|      1|      }
 2352|      1|      __archive_ppmd7_functions.Ppmd7_Init(&rar->ppmd7_context, maxorder);
 2353|      1|      rar->ppmd_valid = 1;
 2354|      1|    }
 2355|  1.02k|    else
 2356|  1.02k|    {
 2357|  1.02k|      if (!rar->ppmd_valid) {
  ------------------
  |  Branch (2357:11): [True: 0, False: 1.02k]
  ------------------
 2358|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2359|      0|                          "Invalid PPMd sequence");
 2360|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2361|      0|      }
 2362|  1.02k|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2362:11): [True: 0, False: 1.02k]
  ------------------
 2363|      0|      {
 2364|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2365|      0|                          "Unable to initialize PPMd range decoder");
 2366|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2367|      0|      }
 2368|  1.02k|    }
 2369|  1.02k|  }
 2370|    277|  else
 2371|    277|  {
 2372|    277|    rar_br_consume(br, 1);
  ------------------
  |  |  477|    277|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2373|       |
 2374|       |    /* Keep existing table flag */
 2375|    277|    if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|    277|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|    554|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 277, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2376|      0|      goto truncated_data;
 2377|    277|    if (!rar_br_bits(br, 1))
  ------------------
  |  |  465|    277|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    277|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2377:9): [True: 277, False: 0]
  ------------------
 2378|    277|      memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 2379|    277|    rar_br_consume(br, 1);
  ------------------
  |  |  477|    277|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2380|       |
 2381|    277|    memset(&bitlengths, 0, sizeof(bitlengths));
 2382|  5.74k|    for (i = 0; i < MAX_SYMBOLS;)
  ------------------
  |  |  136|  5.74k|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2382:17): [True: 5.46k, False: 277]
  ------------------
 2383|  5.46k|    {
 2384|  5.46k|      if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  475|  5.46k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  10.9k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 4.96k, False: 499]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 499, False: 0]
  |  |  ------------------
  ------------------
 2385|      0|        goto truncated_data;
 2386|  5.46k|      bitlengths[i++] = rar_br_bits(br, 4);
  ------------------
  |  |  465|  5.46k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  5.46k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2387|  5.46k|      rar_br_consume(br, 4);
  ------------------
  |  |  477|  5.46k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2388|  5.46k|      if (bitlengths[i-1] == 0xF)
  ------------------
  |  Branch (2388:11): [True: 5, False: 5.46k]
  ------------------
 2389|      5|      {
 2390|      5|        if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  475|      5|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     10|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2391|      0|          goto truncated_data;
 2392|      5|        zerocount = rar_br_bits(br, 4);
  ------------------
  |  |  465|      5|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      5|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2393|      5|        rar_br_consume(br, 4);
  ------------------
  |  |  477|      5|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2394|      5|        if (zerocount)
  ------------------
  |  Branch (2394:13): [True: 5, False: 0]
  ------------------
 2395|      5|        {
 2396|      5|          i--;
 2397|     85|          for (j = 0; j < zerocount + 2 && i < MAX_SYMBOLS; j++)
  ------------------
  |  |  136|     80|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2397:23): [True: 80, False: 5]
  |  Branch (2397:44): [True: 80, False: 0]
  ------------------
 2398|     80|            bitlengths[i++] = 0;
 2399|      5|        }
 2400|      5|      }
 2401|  5.46k|    }
 2402|       |
 2403|    277|    memset(&precode, 0, sizeof(precode));
 2404|    277|    r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    277|#define MAX_SYMBOLS       20
  ------------------
                  r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    277|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2405|    277|    if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|    277|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2405:9): [True: 0, False: 277]
  ------------------
 2406|      0|      free(precode.tree);
 2407|      0|      free(precode.table);
 2408|      0|      return (r);
 2409|      0|    }
 2410|       |
 2411|  52.2k|    for (i = 0; i < HUFFMAN_TABLE_SIZE;)
  ------------------
  |  |  133|  52.2k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|  52.2k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|  52.2k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|  52.2k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|  52.2k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2411:17): [True: 51.9k, False: 277]
  ------------------
 2412|  51.9k|    {
 2413|  51.9k|      if ((val = read_next_symbol(a, &precode)) < 0) {
  ------------------
  |  Branch (2413:11): [True: 0, False: 51.9k]
  ------------------
 2414|      0|        free(precode.tree);
 2415|      0|        free(precode.table);
 2416|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2417|      0|      }
 2418|  51.9k|      if (val < 16)
  ------------------
  |  Branch (2418:11): [True: 44.9k, False: 6.99k]
  ------------------
 2419|  44.9k|      {
 2420|  44.9k|        rar->lengthtable[i] = (rar->lengthtable[i] + val) & 0xF;
 2421|  44.9k|        i++;
 2422|  44.9k|      }
 2423|  6.99k|      else if (val < 18)
  ------------------
  |  Branch (2423:16): [True: 99, False: 6.89k]
  ------------------
 2424|     99|      {
 2425|     99|        if (i == 0)
  ------------------
  |  Branch (2425:13): [True: 0, False: 99]
  ------------------
 2426|      0|        {
 2427|      0|          free(precode.tree);
 2428|      0|          free(precode.table);
 2429|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2430|      0|                            "Internal error extracting RAR file.");
 2431|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2432|      0|        }
 2433|       |
 2434|     99|        if(val == 16) {
  ------------------
  |  Branch (2434:12): [True: 90, False: 9]
  ------------------
 2435|     90|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  475|     90|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|    180|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 90, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2436|      0|            free(precode.tree);
 2437|      0|            free(precode.table);
 2438|      0|            goto truncated_data;
 2439|      0|          }
 2440|     90|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  465|     90|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|     90|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2441|     90|          rar_br_consume(br, 3);
  ------------------
  |  |  477|     90|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2442|     90|        } else {
 2443|      9|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  475|      9|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     18|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2444|      0|            free(precode.tree);
 2445|      0|            free(precode.table);
 2446|      0|            goto truncated_data;
 2447|      0|          }
 2448|      9|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  465|      9|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      9|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2449|      9|          rar_br_consume(br, 7);
  ------------------
  |  |  477|      9|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2450|      9|        }
 2451|       |
 2452|    504|        for (j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  133|    405|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|    405|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|    405|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|    405|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|    405|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2452:21): [True: 405, False: 99]
  |  Branch (2452:30): [True: 405, False: 0]
  ------------------
 2453|    405|        {
 2454|    405|          rar->lengthtable[i] = rar->lengthtable[i-1];
 2455|    405|          i++;
 2456|    405|        }
 2457|     99|      }
 2458|  6.89k|      else
 2459|  6.89k|      {
 2460|  6.89k|        if(val == 18) {
  ------------------
  |  Branch (2460:12): [True: 6.32k, False: 570]
  ------------------
 2461|  6.32k|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  475|  6.32k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  12.6k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 6.32k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2462|      0|            free(precode.tree);
 2463|      0|            free(precode.table);
 2464|      0|            goto truncated_data;
 2465|      0|          }
 2466|  6.32k|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  465|  6.32k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  6.32k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2467|  6.32k|          rar_br_consume(br, 3);
  ------------------
  |  |  477|  6.32k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2468|  6.32k|        } else {
 2469|    570|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  475|    570|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  1.14k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 565, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 5, False: 0]
  |  |  ------------------
  ------------------
 2470|      0|            free(precode.tree);
 2471|      0|            free(precode.table);
 2472|      0|            goto truncated_data;
 2473|      0|          }
 2474|    570|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  465|    570|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    570|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2475|    570|          rar_br_consume(br, 7);
  ------------------
  |  |  477|    570|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2476|    570|        }
 2477|       |
 2478|  73.4k|        for(j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  133|  66.5k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|  66.5k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|  66.5k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|  66.5k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|  66.5k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2478:20): [True: 66.5k, False: 6.89k]
  |  Branch (2478:29): [True: 66.5k, False: 5]
  ------------------
 2479|  66.5k|          rar->lengthtable[i++] = 0;
 2480|  6.89k|      }
 2481|  51.9k|    }
 2482|    277|    free(precode.tree);
 2483|    277|    free(precode.table);
 2484|       |
 2485|    277|    r = create_code(a, &rar->maincode, &rar->lengthtable[0], MAINCODE_SIZE,
  ------------------
  |  |  128|    277|#define MAINCODE_SIZE      299
  ------------------
 2486|    277|                MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    277|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2487|    277|    if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    277|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2487:9): [True: 0, False: 277]
  ------------------
 2488|      0|      return (r);
 2489|    277|    r = create_code(a, &rar->offsetcode, &rar->lengthtable[MAINCODE_SIZE],
  ------------------
  |  |  128|    277|#define MAINCODE_SIZE      299
  ------------------
 2490|    277|                OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  129|    277|#define OFFSETCODE_SIZE    60
  ------------------
                              OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    277|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2491|    277|    if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    277|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2491:9): [True: 0, False: 277]
  ------------------
 2492|      0|      return (r);
 2493|    277|    r = create_code(a, &rar->lowoffsetcode,
 2494|    277|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  128|    277|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  129|    277|#define OFFSETCODE_SIZE    60
  ------------------
 2495|    277|                LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  130|    277|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    277|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2496|    277|    if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    277|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2496:9): [True: 0, False: 277]
  ------------------
 2497|      0|      return (r);
 2498|    277|    r = create_code(a, &rar->lengthcode,
 2499|    277|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  128|    277|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  129|    277|#define OFFSETCODE_SIZE    60
  ------------------
 2500|    277|                LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  130|    277|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  131|    277|#define LENGTHCODE_SIZE    28
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    277|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2501|    277|    if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    277|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2501:9): [True: 0, False: 277]
  ------------------
 2502|      0|      return (r);
 2503|    277|  }
 2504|       |
 2505|  1.30k|  if (!rar->dictionary_size || !rar->lzss.window)
  ------------------
  |  Branch (2505:7): [True: 16, False: 1.28k]
  |  Branch (2505:32): [True: 1, False: 1.28k]
  ------------------
 2506|     17|  {
 2507|       |    /* Seems as though dictionary sizes are not used. Even so, minimize
 2508|       |     * memory usage as much as possible.
 2509|       |     */
 2510|     17|    void *new_window;
 2511|     17|    unsigned int new_size;
 2512|       |
 2513|     17|    if (rar->unp_size >= DICTIONARY_MAX_SIZE)
  ------------------
  |  |  126|     17|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
  |  Branch (2513:9): [True: 13, False: 4]
  ------------------
 2514|     13|      new_size = DICTIONARY_MAX_SIZE;
  ------------------
  |  |  126|     13|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
 2515|      4|    else
 2516|      4|      new_size = rar_fls((unsigned int)rar->unp_size) << 1;
 2517|     17|    if (new_size == 0) {
  ------------------
  |  Branch (2517:9): [True: 0, False: 17]
  ------------------
 2518|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2519|      0|                        "Zero window size is invalid.");
 2520|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2521|      0|    }
 2522|     17|    new_window = realloc(rar->lzss.window, new_size);
 2523|     17|    if (new_window == NULL) {
  ------------------
  |  Branch (2523:9): [True: 0, False: 17]
  ------------------
 2524|      0|      archive_set_error(&a->archive, ENOMEM,
 2525|      0|                        "Unable to allocate memory for uncompressed data.");
 2526|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2527|      0|    }
 2528|     17|    rar->lzss.window = (unsigned char *)new_window;
 2529|     17|    rar->dictionary_size = new_size;
 2530|     17|    memset(rar->lzss.window, 0, rar->dictionary_size);
 2531|     17|    rar->lzss.mask = rar->dictionary_size - 1;
 2532|     17|  }
 2533|       |
 2534|  1.30k|  rar->start_new_table = 0;
 2535|  1.30k|  return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2536|      0|truncated_data:
 2537|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2538|      0|                    "Truncated RAR file data");
 2539|      0|  rar->valid = 0;
 2540|      0|  return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2541|  1.30k|}
archive_read_support_format_rar.c:free_codes:
 2545|  1.54k|{
 2546|  1.54k|  struct rar *rar = (struct rar *)(a->format->data);
 2547|  1.54k|  free(rar->maincode.tree);
 2548|  1.54k|  free(rar->offsetcode.tree);
 2549|  1.54k|  free(rar->lowoffsetcode.tree);
 2550|  1.54k|  free(rar->lengthcode.tree);
 2551|  1.54k|  free(rar->maincode.table);
 2552|  1.54k|  free(rar->offsetcode.table);
 2553|  1.54k|  free(rar->lowoffsetcode.table);
 2554|  1.54k|  free(rar->lengthcode.table);
 2555|  1.54k|  memset(&rar->maincode, 0, sizeof(rar->maincode));
 2556|  1.54k|  memset(&rar->offsetcode, 0, sizeof(rar->offsetcode));
 2557|  1.54k|  memset(&rar->lowoffsetcode, 0, sizeof(rar->lowoffsetcode));
 2558|  1.54k|  memset(&rar->lengthcode, 0, sizeof(rar->lengthcode));
 2559|  1.54k|}
archive_read_support_format_rar.c:ppmd_read:
  710|  4.10k|{
  711|  4.10k|  struct archive_read *a = ((IByteIn*)p)->a;
  712|  4.10k|  struct rar *rar = (struct rar *)(a->format->data);
  713|  4.10k|  struct rar_br *br = &(rar->br);
  714|  4.10k|  Byte b;
  715|  4.10k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|  4.10k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  8.21k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 3.59k, False: 513]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 513, False: 0]
  |  |  ------------------
  ------------------
  716|      0|  {
  717|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  718|      0|                      "Truncated RAR file data");
  719|      0|    rar->valid = 0;
  720|      0|    return 0;
  721|      0|  }
  722|  4.10k|  b = rar_br_bits(br, 8);
  ------------------
  |  |  465|  4.10k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  4.10k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  723|  4.10k|  rar_br_consume(br, 8);
  ------------------
  |  |  477|  4.10k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
  724|  4.10k|  return b;
  725|  4.10k|}
archive_read_support_format_rar.c:create_code:
 2637|  1.38k|{
 2638|  1.38k|  int i, j, codebits = 0, symbolsleft = numsymbols;
 2639|       |
 2640|  1.38k|  code->numentries = 0;
 2641|  1.38k|  code->numallocatedentries = 0;
 2642|  1.38k|  if (new_node(code) < 0) {
  ------------------
  |  Branch (2642:7): [True: 0, False: 1.38k]
  ------------------
 2643|      0|    archive_set_error(&a->archive, ENOMEM,
 2644|      0|                      "Unable to allocate memory for node data.");
 2645|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2646|      0|  }
 2647|  1.38k|  code->numentries = 1;
 2648|  1.38k|  code->minlength = INT_MAX;
 2649|  1.38k|  code->maxlength = INT_MIN;
 2650|  1.38k|  codebits = 0;
 2651|  18.8k|  for(i = 1; i <= maxlength; i++)
  ------------------
  |  Branch (2651:14): [True: 17.8k, False: 1.01k]
  ------------------
 2652|  17.8k|  {
 2653|  1.71M|    for(j = 0; j < numsymbols; j++)
  ------------------
  |  Branch (2653:16): [True: 1.69M, False: 17.4k]
  ------------------
 2654|  1.69M|    {
 2655|  1.69M|      if (lengths[j] != i) continue;
  ------------------
  |  Branch (2655:11): [True: 1.64M, False: 48.6k]
  ------------------
 2656|  48.6k|      if (add_value(a, code, j, codebits, i) != ARCHIVE_OK)
  ------------------
  |  |  192|  48.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2656:11): [True: 0, False: 48.6k]
  ------------------
 2657|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2658|  48.6k|      codebits++;
 2659|  48.6k|      if (--symbolsleft <= 0)
  ------------------
  |  Branch (2659:11): [True: 367, False: 48.2k]
  ------------------
 2660|    367|        break;
 2661|  48.6k|    }
 2662|  17.8k|    if (symbolsleft <= 0)
  ------------------
  |  Branch (2662:9): [True: 367, False: 17.4k]
  ------------------
 2663|    367|      break;
 2664|  17.4k|    codebits <<= 1;
 2665|  17.4k|  }
 2666|  1.38k|  return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.38k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2667|  1.38k|}
archive_read_support_format_rar.c:new_node:
 2780|   100k|{
 2781|   100k|  void *new_tree;
 2782|   100k|  if (code->numallocatedentries == code->numentries) {
  ------------------
  |  Branch (2782:7): [True: 1.40k, False: 98.9k]
  ------------------
 2783|  1.40k|    int new_num_entries = 256;
 2784|  1.40k|    if (code->numentries > 0) {
  ------------------
  |  Branch (2784:9): [True: 18, False: 1.38k]
  ------------------
 2785|     18|        new_num_entries = code->numentries * 2;
 2786|     18|    }
 2787|  1.40k|    new_tree = realloc(code->tree, new_num_entries * sizeof(*code->tree));
 2788|  1.40k|    if (new_tree == NULL)
  ------------------
  |  Branch (2788:9): [True: 0, False: 1.40k]
  ------------------
 2789|      0|        return (-1);
 2790|  1.40k|    code->tree = (struct huffman_tree_node *)new_tree;
 2791|  1.40k|    code->numallocatedentries = new_num_entries;
 2792|  1.40k|  }
 2793|   100k|  code->tree[code->numentries].branches[0] = -1;
 2794|   100k|  code->tree[code->numentries].branches[1] = -2;
 2795|   100k|  return 1;
 2796|   100k|}
archive_read_support_format_rar.c:add_value:
 2672|  48.6k|{
 2673|  48.6k|  int lastnode, bitpos, bit;
 2674|       |  /* int repeatpos, repeatnode, nextnode; */
 2675|       |
 2676|  48.6k|  free(code->table);
 2677|  48.6k|  code->table = NULL;
 2678|       |
 2679|  48.6k|  if(length > code->maxlength)
  ------------------
  |  Branch (2679:6): [True: 4.56k, False: 44.0k]
  ------------------
 2680|  4.56k|    code->maxlength = length;
 2681|  48.6k|  if(length < code->minlength)
  ------------------
  |  Branch (2681:6): [True: 1.38k, False: 47.2k]
  ------------------
 2682|  1.38k|    code->minlength = length;
 2683|       |
 2684|       |  /*
 2685|       |   * Dead code, repeatpos was is -1
 2686|       |   *
 2687|       |  repeatpos = -1;
 2688|       |  if (repeatpos == 0 || (repeatpos >= 0
 2689|       |    && (((codebits >> (repeatpos - 1)) & 3) == 0
 2690|       |    || ((codebits >> (repeatpos - 1)) & 3) == 3)))
 2691|       |  {
 2692|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2693|       |                      "Invalid repeat position");
 2694|       |    return (ARCHIVE_FATAL);
 2695|       |  }
 2696|       |  */
 2697|       |
 2698|  48.6k|  lastnode = 0;
 2699|   395k|  for (bitpos = length - 1; bitpos >= 0; bitpos--)
  ------------------
  |  Branch (2699:29): [True: 346k, False: 48.6k]
  ------------------
 2700|   346k|  {
 2701|   346k|    bit = (codebits >> bitpos) & 1;
 2702|       |
 2703|       |    /* Leaf node check */
 2704|   346k|    if (code->tree[lastnode].branches[0] ==
  ------------------
  |  Branch (2704:9): [True: 0, False: 346k]
  ------------------
 2705|   346k|      code->tree[lastnode].branches[1])
 2706|      0|    {
 2707|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2708|      0|                        "Prefix found");
 2709|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2710|      0|    }
 2711|       |
 2712|       |    /*
 2713|       |     * Dead code, repeatpos was -1, bitpos >=0
 2714|       |     *
 2715|       |    if (bitpos == repeatpos)
 2716|       |    {
 2717|       |      * Open branch check *
 2718|       |      if (!(code->tree[lastnode].branches[bit] < 0))
 2719|       |      {
 2720|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2721|       |                          "Invalid repeating code");
 2722|       |        return (ARCHIVE_FATAL);
 2723|       |      }
 2724|       |
 2725|       |      if ((repeatnode = new_node(code)) < 0) {
 2726|       |        archive_set_error(&a->archive, ENOMEM,
 2727|       |                          "Unable to allocate memory for node data.");
 2728|       |        return (ARCHIVE_FATAL);
 2729|       |      }
 2730|       |      if ((nextnode = new_node(code)) < 0) {
 2731|       |        archive_set_error(&a->archive, ENOMEM,
 2732|       |                          "Unable to allocate memory for node data.");
 2733|       |        return (ARCHIVE_FATAL);
 2734|       |      }
 2735|       |
 2736|       |      * Set branches *
 2737|       |      code->tree[lastnode].branches[bit] = repeatnode;
 2738|       |      code->tree[repeatnode].branches[bit] = repeatnode;
 2739|       |      code->tree[repeatnode].branches[bit^1] = nextnode;
 2740|       |      lastnode = nextnode;
 2741|       |
 2742|       |      bitpos++; * terminating bit already handled, skip it *
 2743|       |    }
 2744|       |    else
 2745|       |    {
 2746|       |    */
 2747|       |      /* Open branch check */
 2748|   346k|      if (code->tree[lastnode].branches[bit] < 0)
  ------------------
  |  Branch (2748:11): [True: 98.9k, False: 247k]
  ------------------
 2749|  98.9k|      {
 2750|  98.9k|        if (new_node(code) < 0) {
  ------------------
  |  Branch (2750:13): [True: 0, False: 98.9k]
  ------------------
 2751|      0|          archive_set_error(&a->archive, ENOMEM,
 2752|      0|                            "Unable to allocate memory for node data.");
 2753|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2754|      0|        }
 2755|  98.9k|        code->tree[lastnode].branches[bit] = code->numentries++;
 2756|  98.9k|      }
 2757|       |
 2758|       |      /* set to branch */
 2759|   346k|      lastnode = code->tree[lastnode].branches[bit];
 2760|       | /* } */
 2761|   346k|  }
 2762|       |
 2763|  48.6k|  if (!(code->tree[lastnode].branches[0] == -1
  ------------------
  |  Branch (2763:9): [True: 48.6k, False: 0]
  ------------------
 2764|  48.6k|    && code->tree[lastnode].branches[1] == -2))
  ------------------
  |  Branch (2764:8): [True: 48.6k, False: 0]
  ------------------
 2765|      0|  {
 2766|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2767|      0|                      "Prefix found");
 2768|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2769|      0|  }
 2770|       |
 2771|       |  /* Set leaf value */
 2772|  48.6k|  code->tree[lastnode].branches[0] = value;
 2773|  48.6k|  code->tree[lastnode].branches[1] = value;
 2774|       |
 2775|  48.6k|  return (ARCHIVE_OK);
  ------------------
  |  |  192|  48.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2776|  48.6k|}
archive_read_support_format_rar.c:read_next_symbol:
 2564|  11.4M|{
 2565|  11.4M|  unsigned char bit;
 2566|  11.4M|  unsigned int bits;
 2567|  11.4M|  int length, value, node;
 2568|  11.4M|  struct rar *rar;
 2569|  11.4M|  struct rar_br *br;
 2570|       |
 2571|  11.4M|  if (!code->table)
  ------------------
  |  Branch (2571:7): [True: 591, False: 11.4M]
  ------------------
 2572|    591|  {
 2573|    591|    if (make_table(a, code) != (ARCHIVE_OK))
  ------------------
  |  |  192|    591|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2573:9): [True: 0, False: 591]
  ------------------
 2574|      0|      return -1;
 2575|    591|  }
 2576|       |
 2577|  11.4M|  rar = (struct rar *)(a->format->data);
 2578|  11.4M|  br = &(rar->br);
 2579|       |
 2580|       |  /* Look ahead (peek) at bits */
 2581|  11.4M|  if (!rar_br_read_ahead(a, br, code->tablesize)) {
  ------------------
  |  |  475|  11.4M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  22.8M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 10.8M, False: 560k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     16|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 8, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 560k, False: 16]
  |  |  ------------------
  ------------------
 2582|      8|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2583|      8|                      "Truncated RAR file data");
 2584|      8|    rar->valid = 0;
 2585|      8|    return -1;
 2586|      8|  }
 2587|  11.4M|  bits = rar_br_bits(br, code->tablesize);
  ------------------
  |  |  465|  11.4M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  11.4M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2588|       |
 2589|  11.4M|  length = code->table[bits].length;
 2590|  11.4M|  value = code->table[bits].value;
 2591|       |
 2592|  11.4M|  if (length < 0)
  ------------------
  |  Branch (2592:7): [True: 0, False: 11.4M]
  ------------------
 2593|      0|  {
 2594|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2595|      0|                      "Invalid prefix code in bitstream");
 2596|      0|    return -1;
 2597|      0|  }
 2598|       |
 2599|  11.4M|  if (length <= code->tablesize)
  ------------------
  |  Branch (2599:7): [True: 10.9M, False: 440k]
  ------------------
 2600|  10.9M|  {
 2601|       |    /* Skip length bits */
 2602|  10.9M|    rar_br_consume(br, length);
  ------------------
  |  |  477|  10.9M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2603|  10.9M|    return value;
 2604|  10.9M|  }
 2605|       |
 2606|       |  /* Skip tablesize bits */
 2607|   440k|  rar_br_consume(br, code->tablesize);
  ------------------
  |  |  477|   440k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2608|       |
 2609|   440k|  node = value;
 2610|  2.64M|  while (!(code->tree[node].branches[0] ==
  ------------------
  |  Branch (2610:10): [True: 2.19M, False: 440k]
  ------------------
 2611|  2.64M|    code->tree[node].branches[1]))
 2612|  2.19M|  {
 2613|  2.19M|    if (!rar_br_read_ahead(a, br, 1)) {
  ------------------
  |  |  475|  2.19M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  4.39M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 2.19M, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1.28k, False: 0]
  |  |  ------------------
  ------------------
 2614|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2615|      0|                        "Truncated RAR file data");
 2616|      0|      rar->valid = 0;
 2617|      0|      return -1;
 2618|      0|    }
 2619|  2.19M|    bit = rar_br_bits(br, 1);
  ------------------
  |  |  465|  2.19M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  2.19M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2620|  2.19M|    rar_br_consume(br, 1);
  ------------------
  |  |  477|  2.19M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2621|       |
 2622|  2.19M|    if (code->tree[node].branches[bit] < 0)
  ------------------
  |  Branch (2622:9): [True: 0, False: 2.19M]
  ------------------
 2623|      0|    {
 2624|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2625|      0|                        "Invalid prefix code in bitstream");
 2626|      0|      return -1;
 2627|      0|    }
 2628|  2.19M|    node = code->tree[node].branches[bit];
 2629|  2.19M|  }
 2630|       |
 2631|   440k|  return code->tree[node].branches[0];
 2632|   440k|}
archive_read_support_format_rar.c:make_table:
 2800|    591|{
 2801|    591|  if (code->maxlength < code->minlength || code->maxlength > 10)
  ------------------
  |  Branch (2801:7): [True: 0, False: 591]
  |  Branch (2801:44): [True: 272, False: 319]
  ------------------
 2802|    272|    code->tablesize = 10;
 2803|    319|  else
 2804|    319|    code->tablesize = code->maxlength;
 2805|       |
 2806|    591|  code->table =
 2807|    591|    (struct huffman_table_entry *)calloc(1, sizeof(*code->table)
 2808|    591|    * ((size_t)1 << code->tablesize));
 2809|       |
 2810|    591|  return make_table_recurse(a, code, 0, code->table, 0, code->tablesize);
 2811|    591|}
archive_read_support_format_rar.c:make_table_recurse:
 2817|  48.2k|{
 2818|  48.2k|  int currtablesize, i, ret = (ARCHIVE_OK);
  ------------------
  |  |  192|  48.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2819|       |
 2820|  48.2k|  if (!code->tree)
  ------------------
  |  Branch (2820:7): [True: 0, False: 48.2k]
  ------------------
 2821|      0|  {
 2822|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2823|      0|                      "Huffman tree was not created.");
 2824|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2825|      0|  }
 2826|  48.2k|  if (node < 0 || node >= code->numentries)
  ------------------
  |  Branch (2826:7): [True: 0, False: 48.2k]
  |  Branch (2826:19): [True: 0, False: 48.2k]
  ------------------
 2827|      0|  {
 2828|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2829|      0|                      "Invalid location to Huffman tree specified.");
 2830|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2831|      0|  }
 2832|       |
 2833|  48.2k|  currtablesize = 1 << (maxdepth - depth);
 2834|       |
 2835|  48.2k|  if (code->tree[node].branches[0] ==
  ------------------
  |  Branch (2835:7): [True: 23.6k, False: 24.6k]
  ------------------
 2836|  48.2k|    code->tree[node].branches[1])
 2837|  23.6k|  {
 2838|   353k|    for(i = 0; i < currtablesize; i++)
  ------------------
  |  Branch (2838:16): [True: 330k, False: 23.6k]
  ------------------
 2839|   330k|    {
 2840|   330k|      table[i].length = depth;
 2841|   330k|      table[i].value = code->tree[node].branches[0];
 2842|   330k|    }
 2843|  23.6k|  }
 2844|       |  /*
 2845|       |   * Dead code, node >= 0
 2846|       |   *
 2847|       |  else if (node < 0)
 2848|       |  {
 2849|       |    for(i = 0; i < currtablesize; i++)
 2850|       |      table[i].length = -1;
 2851|       |  }
 2852|       |   */
 2853|  24.6k|  else
 2854|  24.6k|  {
 2855|  24.6k|    if(depth == maxdepth)
  ------------------
  |  Branch (2855:8): [True: 807, False: 23.8k]
  ------------------
 2856|    807|    {
 2857|    807|      table[0].length = maxdepth + 1;
 2858|    807|      table[0].value = node;
 2859|    807|    }
 2860|  23.8k|    else
 2861|  23.8k|    {
 2862|  23.8k|      ret |= make_table_recurse(a, code, code->tree[node].branches[0], table,
 2863|  23.8k|                                depth + 1, maxdepth);
 2864|  23.8k|      ret |= make_table_recurse(a, code, code->tree[node].branches[1],
 2865|  23.8k|                         table + currtablesize / 2, depth + 1, maxdepth);
 2866|  23.8k|    }
 2867|  24.6k|  }
 2868|  48.2k|  return ret;
 2869|  48.2k|}
archive_read_support_format_rar.c:rar_fls:
  616|      4|{
  617|      4|  word |= (word >>  1);
  618|      4|  word |= (word >>  2);
  619|      4|  word |= (word >>  4);
  620|      4|  word |= (word >>  8);
  621|      4|  word |= (word >> 16);
  622|      4|  return word - (word >> 1);
  623|      4|}
archive_read_support_format_rar.c:lzss_emit_literal:
  670|  6.94M|{
  671|  6.94M|  *lzss_current_pointer(&rar->lzss) = literal;
  672|  6.94M|  rar->lzss.position++;
  673|  6.94M|}
archive_read_support_format_rar.c:lzss_current_pointer:
  664|  6.94M|{
  665|  6.94M|  return lzss_pointer_for_position(lzss, lzss->position);
  666|  6.94M|}
archive_read_support_format_rar.c:lzss_pointer_for_position:
  652|  6.94M|{
  653|  6.94M|  return &lzss->window[lzss_offset_for_position(lzss, pos)];
  654|  6.94M|}
archive_read_support_format_rar.c:lzss_emit_match:
  677|  2.23M|{
  678|  2.23M|  int dstoffs = lzss_current_offset(&rar->lzss);
  679|  2.23M|  int srcoffs = (dstoffs - offset) & lzss_mask(&rar->lzss);
  680|  2.23M|  int l, li, remaining;
  681|  2.23M|  unsigned char *d, *s;
  682|       |
  683|  2.23M|  remaining = length;
  684|  4.46M|  while (remaining > 0) {
  ------------------
  |  Branch (684:10): [True: 2.23M, False: 2.23M]
  ------------------
  685|  2.23M|    l = remaining;
  686|  2.23M|    if (dstoffs > srcoffs) {
  ------------------
  |  Branch (686:9): [True: 2.16M, False: 72.6k]
  ------------------
  687|  2.16M|      if (l > lzss_size(&rar->lzss) - dstoffs)
  ------------------
  |  Branch (687:11): [True: 24, False: 2.16M]
  ------------------
  688|     24|        l = lzss_size(&rar->lzss) - dstoffs;
  689|  2.16M|    } else {
  690|  72.6k|      if (l > lzss_size(&rar->lzss) - srcoffs)
  ------------------
  |  Branch (690:11): [True: 32, False: 72.6k]
  ------------------
  691|     32|        l = lzss_size(&rar->lzss) - srcoffs;
  692|  72.6k|    }
  693|  2.23M|    d = &(rar->lzss.window[dstoffs]);
  694|  2.23M|    s = &(rar->lzss.window[srcoffs]);
  695|  2.23M|    if ((dstoffs + l < srcoffs) || (srcoffs + l < dstoffs))
  ------------------
  |  Branch (695:9): [True: 72.6k, False: 2.16M]
  |  Branch (695:36): [True: 614k, False: 1.54M]
  ------------------
  696|   687k|      memcpy(d, s, l);
  697|  1.54M|    else {
  698|   103M|      for (li = 0; li < l; li++)
  ------------------
  |  Branch (698:20): [True: 102M, False: 1.54M]
  ------------------
  699|   102M|        d[li] = s[li];
  700|  1.54M|    }
  701|  2.23M|    remaining -= l;
  702|  2.23M|    dstoffs = (dstoffs + l) & lzss_mask(&(rar->lzss));
  703|  2.23M|    srcoffs = (srcoffs + l) & lzss_mask(&(rar->lzss));
  704|  2.23M|  }
  705|  2.23M|  rar->lzss.position += length;
  706|  2.23M|}
archive_read_support_format_rar.c:lzss_current_offset:
  658|  2.23M|{
  659|  2.23M|  return lzss_offset_for_position(lzss, lzss->position);
  660|  2.23M|}
archive_read_support_format_rar.c:lzss_mask:
  634|  6.69M|{
  635|  6.69M|  return lzss->mask;
  636|  6.69M|}
archive_read_support_format_rar.c:expand:
 2873|    625|{
 2874|    625|  static const unsigned char lengthbases[] =
 2875|    625|    {   0,   1,   2,   3,   4,   5,   6,
 2876|    625|        7,   8,  10,  12,  14,  16,  20,
 2877|    625|       24,  28,  32,  40,  48,  56,  64,
 2878|    625|       80,  96, 112, 128, 160, 192, 224 };
 2879|    625|  static const unsigned char lengthbits[] =
 2880|    625|    { 0, 0, 0, 0, 0, 0, 0,
 2881|    625|      0, 1, 1, 1, 1, 2, 2,
 2882|    625|      2, 2, 3, 3, 3, 3, 4,
 2883|    625|      4, 4, 4, 5, 5, 5, 5 };
 2884|    625|  static const int lengthb_min = minimum(
  ------------------
  |  |  162|    625|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (162:24): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2885|    625|    (int)(sizeof(lengthbases)/sizeof(lengthbases[0])),
 2886|    625|    (int)(sizeof(lengthbits)/sizeof(lengthbits[0]))
 2887|    625|  );
 2888|    625|  static const unsigned int offsetbases[] =
 2889|    625|    {       0,       1,       2,       3,       4,       6,
 2890|    625|            8,      12,      16,      24,      32,      48,
 2891|    625|           64,      96,     128,     192,     256,     384,
 2892|    625|          512,     768,    1024,    1536,    2048,    3072,
 2893|    625|         4096,    6144,    8192,   12288,   16384,   24576,
 2894|    625|        32768,   49152,   65536,   98304,  131072,  196608,
 2895|    625|       262144,  327680,  393216,  458752,  524288,  589824,
 2896|    625|       655360,  720896,  786432,  851968,  917504,  983040,
 2897|    625|      1048576, 1310720, 1572864, 1835008, 2097152, 2359296,
 2898|    625|      2621440, 2883584, 3145728, 3407872, 3670016, 3932160 };
 2899|    625|  static const unsigned char offsetbits[] =
 2900|    625|    {  0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,
 2901|    625|       5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,
 2902|    625|      11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16,
 2903|    625|      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 2904|    625|      18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 };
 2905|    625|  static const int offsetb_min = minimum(
  ------------------
  |  |  162|    625|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (162:24): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2906|    625|    (int)(sizeof(offsetbases)/sizeof(offsetbases[0])),
 2907|    625|    (int)(sizeof(offsetbits)/sizeof(offsetbits[0]))
 2908|    625|  );
 2909|    625|  static const unsigned char shortbases[] =
 2910|    625|    { 0, 4, 8, 16, 32, 64, 128, 192 };
 2911|    625|  static const unsigned char shortbits[] =
 2912|    625|    { 2, 2, 3, 4, 5, 6, 6, 6 };
 2913|       |
 2914|    625|  int symbol, offs, len, offsindex, lensymbol, i, offssymbol, lowoffsetsymbol;
 2915|    625|  unsigned char newfile;
 2916|    625|  struct rar *rar = (struct rar *)(a->format->data);
 2917|    625|  struct rar_br *br = &(rar->br);
 2918|       |
 2919|    625|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (2919:7): [True: 0, False: 625]
  ------------------
 2920|      0|    *end = rar->filters.filterstart;
 2921|       |
 2922|  9.17M|  while (1)
  ------------------
  |  Branch (2922:10): [Folded - Ignored]
  ------------------
 2923|  9.17M|  {
 2924|  9.17M|    if(lzss_position(&rar->lzss) >= *end) {
  ------------------
  |  Branch (2924:8): [True: 288, False: 9.17M]
  ------------------
 2925|    288|      return (ARCHIVE_OK);
  ------------------
  |  |  192|    288|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2926|    288|    }
 2927|       |
 2928|  9.17M|    if(rar->is_ppmd_block) {
  ------------------
  |  Branch (2928:8): [True: 0, False: 9.17M]
  ------------------
 2929|      0|      *end = lzss_position(&rar->lzss);
 2930|      0|      return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2931|      0|    }
 2932|       |
 2933|  9.17M|    if ((symbol = read_next_symbol(a, &rar->maincode)) < 0)
  ------------------
  |  Branch (2933:9): [True: 6, False: 9.17M]
  ------------------
 2934|      6|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2935|       |
 2936|  9.17M|    if (symbol < 256)
  ------------------
  |  Branch (2936:9): [True: 6.93M, False: 2.23M]
  ------------------
 2937|  6.93M|    {
 2938|  6.93M|      lzss_emit_literal(rar, symbol);
 2939|  6.93M|      continue;
 2940|  6.93M|    }
 2941|  2.23M|    else if (symbol == 256)
  ------------------
  |  Branch (2941:14): [True: 585, False: 2.23M]
  ------------------
 2942|    585|    {
 2943|    585|      if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|    585|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  1.17k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 585, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2944|      0|        goto truncated_data;
 2945|    585|      newfile = !rar_br_bits(br, 1);
  ------------------
  |  |  465|    585|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    585|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2946|    585|      rar_br_consume(br, 1);
  ------------------
  |  |  477|    585|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2947|       |
 2948|    585|      if(newfile)
  ------------------
  |  Branch (2948:10): [True: 324, False: 261]
  ------------------
 2949|    324|      {
 2950|    324|        rar->start_new_block = 1;
 2951|    324|        if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|    324|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|    648|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 324, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2952|      0|          goto truncated_data;
 2953|    324|        rar->start_new_table = rar_br_bits(br, 1);
  ------------------
  |  |  465|    324|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    324|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2954|    324|        rar_br_consume(br, 1);
  ------------------
  |  |  477|    324|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2955|    324|        *end = lzss_position(&rar->lzss);
 2956|    324|        return (ARCHIVE_OK);
  ------------------
  |  |  192|    324|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2957|    324|      }
 2958|    261|      else
 2959|    261|      {
 2960|    261|        if (parse_codes(a) != ARCHIVE_OK)
  ------------------
  |  |  192|    261|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2960:13): [True: 0, False: 261]
  ------------------
 2961|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2962|    261|        continue;
 2963|    261|      }
 2964|    585|    }
 2965|  2.23M|    else if(symbol==257)
  ------------------
  |  Branch (2965:13): [True: 261, False: 2.23M]
  ------------------
 2966|    261|    {
 2967|    261|      if (!read_filter(a, end))
  ------------------
  |  Branch (2967:11): [True: 0, False: 261]
  ------------------
 2968|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2969|    261|      continue;
 2970|    261|    }
 2971|  2.23M|    else if(symbol==258)
  ------------------
  |  Branch (2971:13): [True: 9.23k, False: 2.22M]
  ------------------
 2972|  9.23k|    {
 2973|  9.23k|      if(rar->lastlength == 0)
  ------------------
  |  Branch (2973:10): [True: 0, False: 9.23k]
  ------------------
 2974|      0|        continue;
 2975|       |
 2976|  9.23k|      offs = rar->lastoffset;
 2977|  9.23k|      len = rar->lastlength;
 2978|  9.23k|    }
 2979|  2.22M|    else if (symbol <= 262)
  ------------------
  |  Branch (2979:14): [True: 29.3k, False: 2.19M]
  ------------------
 2980|  29.3k|    {
 2981|  29.3k|      offsindex = symbol - 259;
 2982|  29.3k|      offs = rar->oldoffset[offsindex];
 2983|       |
 2984|  29.3k|      if ((lensymbol = read_next_symbol(a, &rar->lengthcode)) < 0)
  ------------------
  |  Branch (2984:11): [True: 1, False: 29.3k]
  ------------------
 2985|      1|        goto bad_data;
 2986|  29.3k|      if (lensymbol >= lengthb_min)
  ------------------
  |  Branch (2986:11): [True: 0, False: 29.3k]
  ------------------
 2987|      0|        goto bad_data;
 2988|  29.3k|      len = lengthbases[lensymbol] + 2;
 2989|  29.3k|      if (lengthbits[lensymbol] > 0) {
  ------------------
  |  Branch (2989:11): [True: 8.81k, False: 20.5k]
  ------------------
 2990|  8.81k|        if (!rar_br_read_ahead(a, br, lengthbits[lensymbol]))
  ------------------
  |  |  475|  8.81k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  17.6k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 8.81k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2991|      0|          goto truncated_data;
 2992|  8.81k|        len += rar_br_bits(br, lengthbits[lensymbol]);
  ------------------
  |  |  465|  8.81k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  8.81k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2993|  8.81k|        rar_br_consume(br, lengthbits[lensymbol]);
  ------------------
  |  |  477|  8.81k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2994|  8.81k|      }
 2995|       |
 2996|  41.7k|      for (i = offsindex; i > 0; i--)
  ------------------
  |  Branch (2996:27): [True: 12.3k, False: 29.3k]
  ------------------
 2997|  12.3k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 2998|  29.3k|      rar->oldoffset[0] = offs;
 2999|  29.3k|    }
 3000|  2.19M|    else if(symbol<=270)
  ------------------
  |  Branch (3000:13): [True: 329k, False: 1.86M]
  ------------------
 3001|   329k|    {
 3002|   329k|      offs = shortbases[symbol-263] + 1;
 3003|   329k|      if(shortbits[symbol-263] > 0) {
  ------------------
  |  Branch (3003:10): [True: 329k, False: 0]
  ------------------
 3004|   329k|        if (!rar_br_read_ahead(a, br, shortbits[symbol-263]))
  ------------------
  |  |  475|   329k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   659k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 309k, False: 20.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      1|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 20.0k, False: 1]
  |  |  ------------------
  ------------------
 3005|      1|          goto truncated_data;
 3006|   329k|        offs += rar_br_bits(br, shortbits[symbol-263]);
  ------------------
  |  |  465|   329k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   329k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3007|   329k|        rar_br_consume(br, shortbits[symbol-263]);
  ------------------
  |  |  477|   329k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3008|   329k|      }
 3009|       |
 3010|   329k|      len = 2;
 3011|       |
 3012|  1.31M|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3012:18): [True: 989k, False: 329k]
  ------------------
 3013|   989k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3014|   329k|      rar->oldoffset[0] = offs;
 3015|   329k|    }
 3016|  1.86M|    else
 3017|  1.86M|    {
 3018|  1.86M|      if (symbol-271 >= lengthb_min)
  ------------------
  |  Branch (3018:11): [True: 0, False: 1.86M]
  ------------------
 3019|      0|        goto bad_data;
 3020|  1.86M|      len = lengthbases[symbol-271]+3;
 3021|  1.86M|      if(lengthbits[symbol-271] > 0) {
  ------------------
  |  Branch (3021:10): [True: 1.69M, False: 166k]
  ------------------
 3022|  1.69M|        if (!rar_br_read_ahead(a, br, lengthbits[symbol-271]))
  ------------------
  |  |  475|  1.69M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  3.39M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.63M, False: 63.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      3|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 63.6k, False: 3]
  |  |  ------------------
  ------------------
 3023|      0|          goto truncated_data;
 3024|  1.69M|        len += rar_br_bits(br, lengthbits[symbol-271]);
  ------------------
  |  |  465|  1.69M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.69M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3025|  1.69M|        rar_br_consume(br, lengthbits[symbol-271]);
  ------------------
  |  |  477|  1.69M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3026|  1.69M|      }
 3027|       |
 3028|  1.86M|      if ((offssymbol = read_next_symbol(a, &rar->offsetcode)) < 0)
  ------------------
  |  Branch (3028:11): [True: 1, False: 1.86M]
  ------------------
 3029|      1|        goto bad_data;
 3030|  1.86M|      if (offssymbol >= offsetb_min)
  ------------------
  |  Branch (3030:11): [True: 0, False: 1.86M]
  ------------------
 3031|      0|        goto bad_data;
 3032|  1.86M|      offs = offsetbases[offssymbol]+1;
 3033|  1.86M|      if(offsetbits[offssymbol] > 0)
  ------------------
  |  Branch (3033:10): [True: 1.33M, False: 529k]
  ------------------
 3034|  1.33M|      {
 3035|  1.33M|        if(offssymbol > 9)
  ------------------
  |  Branch (3035:12): [True: 314k, False: 1.02M]
  ------------------
 3036|   314k|        {
 3037|   314k|          if(offsetbits[offssymbol] > 4) {
  ------------------
  |  Branch (3037:14): [True: 308k, False: 5.72k]
  ------------------
 3038|   308k|            if (!rar_br_read_ahead(a, br, offsetbits[offssymbol] - 4))
  ------------------
  |  |  475|   308k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   617k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 269k, False: 39.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      5|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 39.3k, False: 5]
  |  |  ------------------
  ------------------
 3039|      4|              goto truncated_data;
 3040|   308k|            offs += rar_br_bits(br, offsetbits[offssymbol] - 4) << 4;
  ------------------
  |  |  465|   308k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   308k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3041|   308k|            rar_br_consume(br, offsetbits[offssymbol] - 4);
  ------------------
  |  |  477|   308k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3042|   308k|          }
 3043|       |
 3044|   314k|          if(rar->numlowoffsetrepeats > 0)
  ------------------
  |  Branch (3044:14): [True: 30.3k, False: 284k]
  ------------------
 3045|  30.3k|          {
 3046|  30.3k|            rar->numlowoffsetrepeats--;
 3047|  30.3k|            offs += rar->lastlowoffset;
 3048|  30.3k|          }
 3049|   284k|          else
 3050|   284k|          {
 3051|   284k|            if ((lowoffsetsymbol =
  ------------------
  |  Branch (3051:17): [True: 0, False: 284k]
  ------------------
 3052|   284k|              read_next_symbol(a, &rar->lowoffsetcode)) < 0)
 3053|      0|              return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3054|   284k|            if(lowoffsetsymbol == 16)
  ------------------
  |  Branch (3054:16): [True: 2.02k, False: 282k]
  ------------------
 3055|  2.02k|            {
 3056|  2.02k|              rar->numlowoffsetrepeats = 15;
 3057|  2.02k|              offs += rar->lastlowoffset;
 3058|  2.02k|            }
 3059|   282k|            else
 3060|   282k|            {
 3061|   282k|              offs += lowoffsetsymbol;
 3062|   282k|              rar->lastlowoffset = lowoffsetsymbol;
 3063|   282k|            }
 3064|   284k|          }
 3065|   314k|        }
 3066|  1.02M|        else {
 3067|  1.02M|          if (!rar_br_read_ahead(a, br, offsetbits[offssymbol]))
  ------------------
  |  |  475|  1.02M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  2.04M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.01M, False: 2.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 2.18k, False: 0]
  |  |  ------------------
  ------------------
 3068|      0|            goto truncated_data;
 3069|  1.02M|          offs += rar_br_bits(br, offsetbits[offssymbol]);
  ------------------
  |  |  465|  1.02M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.02M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3070|  1.02M|          rar_br_consume(br, offsetbits[offssymbol]);
  ------------------
  |  |  477|  1.02M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3071|  1.02M|        }
 3072|  1.33M|      }
 3073|       |
 3074|  1.86M|      if (offs >= 0x40000)
  ------------------
  |  Branch (3074:11): [True: 151k, False: 1.71M]
  ------------------
 3075|   151k|        len++;
 3076|  1.86M|      if (offs >= 0x2000)
  ------------------
  |  Branch (3076:11): [True: 153k, False: 1.71M]
  ------------------
 3077|   153k|        len++;
 3078|       |
 3079|  7.45M|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3079:18): [True: 5.59M, False: 1.86M]
  ------------------
 3080|  5.59M|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3081|  1.86M|      rar->oldoffset[0] = offs;
 3082|  1.86M|    }
 3083|       |
 3084|  2.23M|    rar->lastoffset = offs;
 3085|  2.23M|    rar->lastlength = len;
 3086|       |
 3087|  2.23M|    lzss_emit_match(rar, rar->lastoffset, rar->lastlength);
 3088|  2.23M|  }
 3089|      5|truncated_data:
 3090|      5|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3091|      5|                    "Truncated RAR file data");
 3092|      5|  rar->valid = 0;
 3093|      5|  return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3094|      2|bad_data:
 3095|      2|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3096|      2|                    "Bad RAR file data");
 3097|      2|  return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3098|    625|}
archive_read_support_format_rar.c:lzss_position:
  628|  9.17M|{
  629|  9.17M|  return lzss->position;
  630|  9.17M|}
archive_read_support_format_rar.c:read_filter:
 3589|    261|{
 3590|    261|  struct rar *rar = (struct rar *)(a->format->data);
 3591|    261|  uint8_t flags, val, *code;
 3592|    261|  uint16_t length, i;
 3593|       |
 3594|    261|  if (!rar_decode_byte(a, &flags))
  ------------------
  |  Branch (3594:7): [True: 0, False: 261]
  ------------------
 3595|      0|    return 0;
 3596|    261|  length = (flags & 0x07) + 1;
 3597|    261|  if (length == 7)
  ------------------
  |  Branch (3597:7): [True: 242, False: 19]
  ------------------
 3598|    242|  {
 3599|    242|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3599:9): [True: 0, False: 242]
  ------------------
 3600|      0|      return 0;
 3601|    242|    length = val + 7;
 3602|    242|  }
 3603|     19|  else if (length == 8)
  ------------------
  |  Branch (3603:12): [True: 4, False: 15]
  ------------------
 3604|      4|  {
 3605|      4|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3605:9): [True: 0, False: 4]
  ------------------
 3606|      0|      return 0;
 3607|      4|    length = val << 8;
 3608|      4|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3608:9): [True: 0, False: 4]
  ------------------
 3609|      0|      return 0;
 3610|      4|    length |= val;
 3611|      4|  }
 3612|       |
 3613|    261|  code = malloc(length);
 3614|    261|  if (!code)
  ------------------
  |  Branch (3614:7): [True: 0, False: 261]
  ------------------
 3615|      0|    return 0;
 3616|   141k|  for (i = 0; i < length; i++)
  ------------------
  |  Branch (3616:15): [True: 141k, False: 261]
  ------------------
 3617|   141k|  {
 3618|   141k|    if (!rar_decode_byte(a, &code[i]))
  ------------------
  |  Branch (3618:9): [True: 0, False: 141k]
  ------------------
 3619|      0|    {
 3620|      0|      free(code);
 3621|      0|      return 0;
 3622|      0|    }
 3623|   141k|  }
 3624|    261|  if (!parse_filter(a, code, length, flags))
  ------------------
  |  Branch (3624:7): [True: 0, False: 261]
  ------------------
 3625|      0|  {
 3626|      0|    free(code);
 3627|      0|    return 0;
 3628|      0|  }
 3629|    261|  free(code);
 3630|       |
 3631|    261|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (3631:7): [True: 127, False: 134]
  ------------------
 3632|    127|    *end = rar->filters.filterstart;
 3633|       |
 3634|    261|  return 1;
 3635|    261|}
archive_read_support_format_rar.c:rar_decode_byte:
 3842|   141k|{
 3843|   141k|  struct rar *rar = (struct rar *)(a->format->data);
 3844|   141k|  struct rar_br *br = &(rar->br);
 3845|   141k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|   141k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   283k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 121k, False: 20.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 20.1k, False: 0]
  |  |  ------------------
  ------------------
 3846|      0|    return 0;
 3847|   141k|  *byte = (uint8_t)rar_br_bits(br, 8);
  ------------------
  |  |  465|   141k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   141k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3848|   141k|  rar_br_consume(br, 8);
  ------------------
  |  |  477|   141k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3849|   141k|  return 1;
 3850|   141k|}
archive_read_support_format_rar.c:parse_filter:
 3216|    261|{
 3217|    261|  struct rar *rar = (struct rar *)(a->format->data);
 3218|    261|  struct rar_filters *filters = &rar->filters;
 3219|       |
 3220|    261|  struct memory_bit_reader br = { 0 };
 3221|    261|  struct rar_program_code *prog;
 3222|    261|  struct rar_filter *filter, **nextfilter;
 3223|       |
 3224|    261|  uint32_t numprogs, num, blocklength, globaldatalen;
 3225|    261|  uint8_t *globaldata;
 3226|    261|  size_t blockstartpos;
 3227|    261|  uint32_t registers[8] = { 0 };
 3228|    261|  uint32_t i;
 3229|       |
 3230|    261|  br.bytes = bytes;
 3231|    261|  br.length = length;
 3232|       |
 3233|    261|  numprogs = 0;
 3234|    631|  for (prog = filters->progs; prog; prog = prog->next)
  ------------------
  |  Branch (3234:31): [True: 370, False: 261]
  ------------------
 3235|    370|    numprogs++;
 3236|       |
 3237|    261|  if ((flags & 0x80))
  ------------------
  |  Branch (3237:7): [True: 238, False: 23]
  ------------------
 3238|    238|  {
 3239|    238|    num = membr_next_rarvm_number(&br);
 3240|    238|    if (num == 0)
  ------------------
  |  Branch (3240:9): [True: 115, False: 123]
  ------------------
 3241|    115|    {
 3242|    115|      delete_filter(filters->stack);
 3243|    115|      filters->stack = NULL;
 3244|    115|      delete_program_code(filters->progs);
 3245|    115|      filters->progs = NULL;
 3246|    115|    }
 3247|    123|    else
 3248|    123|      num--;
 3249|    238|    if (num > numprogs) {
  ------------------
  |  Branch (3249:9): [True: 0, False: 238]
  ------------------
 3250|      0|      return 0;
 3251|      0|    }
 3252|    238|    filters->lastfilternum = num;
 3253|    238|  }
 3254|     23|  else
 3255|     23|    num = filters->lastfilternum;
 3256|       |
 3257|    261|  prog = filters->progs;
 3258|    384|  for (i = 0; i < num; i++)
  ------------------
  |  Branch (3258:15): [True: 123, False: 261]
  ------------------
 3259|    123|    prog = prog->next;
 3260|    261|  if (prog)
  ------------------
  |  Branch (3260:7): [True: 35, False: 226]
  ------------------
 3261|     35|    prog->usagecount++;
 3262|       |
 3263|    261|  blockstartpos = membr_next_rarvm_number(&br) + (size_t)lzss_position(&rar->lzss);
 3264|    261|  if ((flags & 0x40))
  ------------------
  |  Branch (3264:7): [True: 134, False: 127]
  ------------------
 3265|    134|    blockstartpos += 258;
 3266|    261|  if ((flags & 0x20))
  ------------------
  |  Branch (3266:7): [True: 242, False: 19]
  ------------------
 3267|    242|    blocklength = membr_next_rarvm_number(&br);
 3268|     19|  else
 3269|     19|    blocklength = prog ? prog->oldfilterlength : 0;
  ------------------
  |  Branch (3269:19): [True: 19, False: 0]
  ------------------
 3270|       |
 3271|    261|  registers[3] = PROGRAM_SYSTEM_GLOBAL_ADDRESS;
  ------------------
  |  |  143|    261|#define PROGRAM_SYSTEM_GLOBAL_ADDRESS PROGRAM_WORK_SIZE
  |  |  ------------------
  |  |  |  |  141|    261|#define PROGRAM_WORK_SIZE 0x3C000
  |  |  ------------------
  ------------------
 3272|    261|  registers[4] = blocklength;
 3273|    261|  registers[5] = prog ? prog->usagecount : 0;
  ------------------
  |  Branch (3273:18): [True: 35, False: 226]
  ------------------
 3274|    261|  registers[7] = VM_MEMORY_SIZE;
  ------------------
  |  |  139|    261|#define VM_MEMORY_SIZE 0x40000
  ------------------
 3275|       |
 3276|    261|  if ((flags & 0x10))
  ------------------
  |  Branch (3276:7): [True: 134, False: 127]
  ------------------
 3277|    134|  {
 3278|    134|    uint8_t mask = (uint8_t)membr_bits(&br, 7);
 3279|  1.07k|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3279:17): [True: 938, False: 134]
  ------------------
 3280|    938|      if ((mask & (1 << i)))
  ------------------
  |  Branch (3280:11): [True: 139, False: 799]
  ------------------
 3281|    139|        registers[i] = membr_next_rarvm_number(&br);
 3282|    134|  }
 3283|       |
 3284|    261|  if (!prog)
  ------------------
  |  Branch (3284:7): [True: 226, False: 35]
  ------------------
 3285|    226|  {
 3286|    226|    uint32_t len = membr_next_rarvm_number(&br);
 3287|    226|    uint8_t *bytecode;
 3288|    226|    struct rar_program_code **next;
 3289|       |
 3290|    226|    if (len == 0 || len > 0x10000)
  ------------------
  |  Branch (3290:9): [True: 0, False: 226]
  |  Branch (3290:21): [True: 0, False: 226]
  ------------------
 3291|      0|      return 0;
 3292|    226|    bytecode = malloc(len);
 3293|    226|    if (!bytecode)
  ------------------
  |  Branch (3293:9): [True: 0, False: 226]
  ------------------
 3294|      0|      return 0;
 3295|  9.54k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (3295:17): [True: 9.31k, False: 226]
  ------------------
 3296|  9.31k|      bytecode[i] = (uint8_t)membr_bits(&br, 8);
 3297|    226|    prog = compile_program(bytecode, len);
 3298|    226|    if (!prog) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 226]
  ------------------
 3299|      0|      free(bytecode);
 3300|      0|      return 0;
 3301|      0|    }
 3302|    226|    free(bytecode);
 3303|    226|    next = &filters->progs;
 3304|    337|    while (*next)
  ------------------
  |  Branch (3304:12): [True: 111, False: 226]
  ------------------
 3305|    111|      next = &(*next)->next;
 3306|    226|    *next = prog;
 3307|    226|  }
 3308|    261|  prog->oldfilterlength = blocklength;
 3309|       |
 3310|    261|  globaldata = NULL;
 3311|    261|  globaldatalen = 0;
 3312|    261|  if ((flags & 0x08))
  ------------------
  |  Branch (3312:7): [True: 4, False: 257]
  ------------------
 3313|      4|  {
 3314|      4|    globaldatalen = membr_next_rarvm_number(&br);
 3315|      4|    if (globaldatalen > PROGRAM_USER_GLOBAL_SIZE)
  ------------------
  |  |  146|      4|#define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  142|      4|#define PROGRAM_GLOBAL_SIZE 0x2000
  |  |  ------------------
  |  |               #define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  144|      4|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  |  |  ------------------
  ------------------
  |  Branch (3315:9): [True: 0, False: 4]
  ------------------
 3316|      0|      return 0;
 3317|      4|    globaldata = malloc(globaldatalen + PROGRAM_SYSTEM_GLOBAL_SIZE);
  ------------------
  |  |  144|      4|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3318|      4|    if (!globaldata)
  ------------------
  |  Branch (3318:9): [True: 0, False: 4]
  ------------------
 3319|      0|      return 0;
 3320|      4|    for (i = 0; i < globaldatalen; i++)
  ------------------
  |  Branch (3320:17): [True: 0, False: 4]
  ------------------
 3321|      0|      globaldata[i + PROGRAM_SYSTEM_GLOBAL_SIZE] = (uint8_t)membr_bits(&br, 8);
  ------------------
  |  |  144|      0|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3322|      4|  }
 3323|       |
 3324|    261|  if (br.at_eof)
  ------------------
  |  Branch (3324:7): [True: 0, False: 261]
  ------------------
 3325|      0|  {
 3326|      0|      free(globaldata);
 3327|      0|      return 0;
 3328|      0|  }
 3329|       |
 3330|    261|  filter = create_filter(prog, globaldata, globaldatalen, registers, blockstartpos, blocklength);
 3331|    261|  free(globaldata);
 3332|    261|  if (!filter)
  ------------------
  |  Branch (3332:7): [True: 0, False: 261]
  ------------------
 3333|      0|    return 0;
 3334|       |
 3335|  2.08k|  for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3335:15): [True: 1.82k, False: 261]
  ------------------
 3336|  1.82k|    archive_le32enc(&filter->globaldata[i * 4], registers[i]);
 3337|    261|  archive_le32enc(&filter->globaldata[0x1C], blocklength);
 3338|    261|  archive_le32enc(&filter->globaldata[0x20], 0);
 3339|    261|  archive_le32enc(&filter->globaldata[0x2C], prog->usagecount);
 3340|       |
 3341|    261|  nextfilter = &filters->stack;
 3342|    403|  while (*nextfilter)
  ------------------
  |  Branch (3342:10): [True: 142, False: 261]
  ------------------
 3343|    142|    nextfilter = &(*nextfilter)->next;
 3344|    261|  *nextfilter = filter;
 3345|       |
 3346|    261|  if (!filters->stack->next)
  ------------------
  |  Branch (3346:7): [True: 131, False: 130]
  ------------------
 3347|    131|    filters->filterstart = blockstartpos;
 3348|       |
 3349|    261|  return 1;
 3350|    261|}
archive_read_support_format_rar.c:membr_next_rarvm_number:
 3545|  1.11k|{
 3546|  1.11k|  uint32_t val;
 3547|  1.11k|  switch (membr_bits(br, 2))
 3548|  1.11k|  {
 3549|    495|    case 0:
  ------------------
  |  Branch (3549:5): [True: 495, False: 615]
  ------------------
 3550|    495|      return membr_bits(br, 4);
 3551|    234|    case 1:
  ------------------
  |  Branch (3551:5): [True: 234, False: 876]
  ------------------
 3552|    234|      val = membr_bits(br, 8);
 3553|    234|      if (val >= 16)
  ------------------
  |  Branch (3553:11): [True: 234, False: 0]
  ------------------
 3554|    234|        return val;
 3555|      0|      return 0xFFFFFF00 | (val << 4) | membr_bits(br, 4);
 3556|    131|    case 2:
  ------------------
  |  Branch (3556:5): [True: 131, False: 979]
  ------------------
 3557|    131|      return membr_bits(br, 16);
 3558|    250|    default:
  ------------------
  |  Branch (3558:5): [True: 250, False: 860]
  ------------------
 3559|    250|      return membr_bits(br, 32);
 3560|  1.11k|  }
 3561|  1.11k|}
archive_read_support_format_rar.c:delete_program_code:
 3532|    353|{
 3533|    579|  while (prog)
  ------------------
  |  Branch (3533:10): [True: 226, False: 353]
  ------------------
 3534|    226|  {
 3535|    226|    struct rar_program_code *next = prog->next;
 3536|    226|    free(prog->staticdata);
 3537|    226|    free(prog->globalbackup);
 3538|    226|    free(prog);
 3539|    226|    prog = next;
 3540|    226|  }
 3541|    353|}
archive_read_support_format_rar.c:membr_bits:
 3565|  11.8k|{
 3566|  11.8k|  if (bits > br->available && (br->at_eof || !membr_fill(br, bits)))
  ------------------
  |  Branch (3566:7): [True: 10.9k, False: 991]
  |  Branch (3566:32): [True: 0, False: 10.9k]
  |  Branch (3566:46): [True: 0, False: 10.9k]
  ------------------
 3567|      0|    return 0;
 3568|  11.8k|  return (uint32_t)((br->bits >> (br->available -= bits)) & (((uint64_t)1 << bits) - 1));
 3569|  11.8k|}
archive_read_support_format_rar.c:membr_fill:
 3573|  10.9k|{
 3574|  22.6k|  while (br->available < bits && br->offset < br->length)
  ------------------
  |  Branch (3574:10): [True: 11.7k, False: 10.9k]
  |  Branch (3574:34): [True: 11.7k, False: 0]
  ------------------
 3575|  11.7k|  {
 3576|  11.7k|    br->bits = (br->bits << 8) | br->bytes[br->offset++];
 3577|  11.7k|    br->available += 8;
 3578|  11.7k|  }
 3579|  10.9k|  if (bits > br->available)
  ------------------
  |  Branch (3579:7): [True: 0, False: 10.9k]
  ------------------
 3580|      0|  {
 3581|      0|    br->at_eof = 1;
 3582|      0|    return 0;
 3583|      0|  }
 3584|  10.9k|  return 1;
 3585|  10.9k|}
archive_read_support_format_rar.c:compile_program:
 3472|    226|{
 3473|    226|  struct memory_bit_reader br = { 0 };
 3474|    226|  struct rar_program_code *prog;
 3475|       |  // uint32_t instrcount = 0;
 3476|    226|  uint8_t xor;
 3477|    226|  size_t i;
 3478|       |
 3479|    226|  xor = 0;
 3480|  9.31k|  for (i = 1; i < length; i++)
  ------------------
  |  Branch (3480:15): [True: 9.08k, False: 226]
  ------------------
 3481|  9.08k|    xor ^= bytes[i];
 3482|    226|  if (!length || xor != bytes[0])
  ------------------
  |  Branch (3482:7): [True: 0, False: 226]
  |  Branch (3482:18): [True: 0, False: 226]
  ------------------
 3483|      0|    return NULL;
 3484|       |
 3485|    226|  br.bytes = bytes;
 3486|    226|  br.length = length;
 3487|    226|  br.offset = 1;
 3488|       |
 3489|    226|  prog = calloc(1, sizeof(*prog));
 3490|    226|  if (!prog)
  ------------------
  |  Branch (3490:7): [True: 0, False: 226]
  ------------------
 3491|      0|    return NULL;
 3492|    226|  prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32);
 3493|       |
 3494|    226|  if (membr_bits(&br, 1))
  ------------------
  |  Branch (3494:7): [True: 0, False: 226]
  ------------------
 3495|      0|  {
 3496|      0|    prog->staticdatalen = membr_next_rarvm_number(&br) + 1;
 3497|      0|    prog->staticdata = malloc(prog->staticdatalen);
 3498|      0|    if (!prog->staticdata)
  ------------------
  |  Branch (3498:9): [True: 0, False: 0]
  ------------------
 3499|      0|    {
 3500|      0|      delete_program_code(prog);
 3501|      0|      return NULL;
 3502|      0|    }
 3503|      0|    for (i = 0; i < prog->staticdatalen; i++)
  ------------------
  |  Branch (3503:17): [True: 0, False: 0]
  ------------------
 3504|      0|      prog->staticdata[i] = (uint8_t)membr_bits(&br, 8);
 3505|      0|  }
 3506|       |
 3507|    226|  return prog;
 3508|    226|}
archive_read_support_format_rar.c:create_filter:
 3354|    261|{
 3355|    261|  struct rar_filter *filter;
 3356|       |
 3357|    261|  filter = calloc(1, sizeof(*filter));
 3358|    261|  if (!filter)
  ------------------
  |  Branch (3358:7): [True: 0, False: 261]
  ------------------
 3359|      0|    return NULL;
 3360|    261|  filter->prog = prog;
 3361|    261|  filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  144|    261|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
                filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  144|    522|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
  |  Branch (3361:27): [True: 0, False: 261]
  ------------------
 3362|    261|  filter->globaldata = calloc(1, filter->globaldatalen);
 3363|    261|  if (!filter->globaldata)
  ------------------
  |  Branch (3363:7): [True: 0, False: 261]
  ------------------
 3364|      0|  {
 3365|      0|    free(filter);
 3366|      0|    return NULL;
 3367|      0|  }
 3368|    261|  if (globaldata)
  ------------------
  |  Branch (3368:7): [True: 4, False: 257]
  ------------------
 3369|      4|    memcpy(filter->globaldata, globaldata, globaldatalen);
 3370|    261|  if (registers)
  ------------------
  |  Branch (3370:7): [True: 261, False: 0]
  ------------------
 3371|    261|    memcpy(filter->initialregisters, registers, sizeof(filter->initialregisters));
 3372|    261|  filter->blockstartpos = startpos;
 3373|    261|  filter->blocklength = length;
 3374|       |
 3375|    261|  return filter;
 3376|    261|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data_skip:
 1149|      2|{
 1150|      2|  struct rar *rar;
 1151|      2|  int64_t bytes_skipped;
 1152|      2|  int ret;
 1153|       |
 1154|      2|  rar = (struct rar *)(a->format->data);
 1155|       |
 1156|      2|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1156:7): [True: 0, False: 2]
  ------------------
 1157|       |      /* Consume as much as the decompressor actually used. */
 1158|      0|      __archive_read_consume(a, rar->bytes_unconsumed);
 1159|      0|      rar->bytes_unconsumed = 0;
 1160|      0|  }
 1161|       |
 1162|      2|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (1162:7): [True: 2, False: 0]
  ------------------
 1163|      2|    bytes_skipped = __archive_read_consume(a, rar->bytes_remaining);
 1164|      2|    if (bytes_skipped < 0)
  ------------------
  |  Branch (1164:9): [True: 2, False: 0]
  ------------------
 1165|      2|      return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1166|      2|  }
 1167|       |
 1168|       |  /* Compressed data to skip must be read from each header in a multivolume
 1169|       |   * archive.
 1170|       |   */
 1171|      0|  if (rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   65|      0|#define MHD_VOLUME       0x0001
  ------------------
                if (rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|      0|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (1171:7): [True: 0, False: 0]
  |  Branch (1171:39): [True: 0, False: 0]
  ------------------
 1172|      0|  {
 1173|      0|    ret = archive_read_format_rar_read_header(a, a->entry);
 1174|      0|    if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1174:9): [True: 0, False: 0]
  ------------------
 1175|      0|      ret = archive_read_format_rar_read_header(a, a->entry);
 1176|      0|    if (ret != (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1176:9): [True: 0, False: 0]
  ------------------
 1177|      0|      return ret;
 1178|      0|    return archive_read_format_rar_read_data_skip(a);
 1179|      0|  }
 1180|       |
 1181|      0|  return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1182|      0|}
archive_read_support_format_rar.c:archive_read_format_rar_seek_data:
 1187|     15|{
 1188|     15|  int64_t client_offset, ret;
 1189|     15|  unsigned int i;
 1190|     15|  struct rar *rar = (struct rar *)(a->format->data);
 1191|       |
 1192|     15|  if (rar->compression_method == COMPRESS_METHOD_STORE)
  ------------------
  |  |  113|     15|#define COMPRESS_METHOD_STORE   0x30
  ------------------
  |  Branch (1192:7): [True: 0, False: 15]
  ------------------
 1193|      0|  {
 1194|       |    /* Modify the offset for use with SEEK_SET */
 1195|      0|    switch (whence)
 1196|      0|    {
 1197|      0|      case SEEK_CUR:
  ------------------
  |  Branch (1197:7): [True: 0, False: 0]
  ------------------
 1198|      0|        client_offset = rar->offset_seek;
 1199|      0|        break;
 1200|      0|      case SEEK_END:
  ------------------
  |  Branch (1200:7): [True: 0, False: 0]
  ------------------
 1201|      0|        client_offset = rar->unp_size;
 1202|      0|        break;
 1203|      0|      case SEEK_SET:
  ------------------
  |  Branch (1203:7): [True: 0, False: 0]
  ------------------
 1204|      0|      default:
  ------------------
  |  Branch (1204:7): [True: 0, False: 0]
  ------------------
 1205|      0|        client_offset = 0;
 1206|      0|    }
 1207|      0|    client_offset += offset;
 1208|      0|    if (client_offset < 0)
  ------------------
  |  Branch (1208:9): [True: 0, False: 0]
  ------------------
 1209|      0|    {
 1210|       |      /* Can't seek past beginning of data block */
 1211|      0|      return -1;
 1212|      0|    }
 1213|      0|    else if (client_offset > rar->unp_size)
  ------------------
  |  Branch (1213:14): [True: 0, False: 0]
  ------------------
 1214|      0|    {
 1215|       |      /*
 1216|       |       * Set the returned offset but only seek to the end of
 1217|       |       * the data block.
 1218|       |       */
 1219|      0|      rar->offset_seek = client_offset;
 1220|      0|      client_offset = rar->unp_size;
 1221|      0|    }
 1222|       |
 1223|      0|    client_offset += rar->dbo[0].start_offset;
 1224|      0|    i = 0;
 1225|      0|    while (i < rar->cursor)
  ------------------
  |  Branch (1225:12): [True: 0, False: 0]
  ------------------
 1226|      0|    {
 1227|      0|      i++;
 1228|      0|      client_offset += rar->dbo[i].start_offset - rar->dbo[i-1].end_offset;
 1229|      0|    }
 1230|      0|    if (rar->main_flags & MHD_VOLUME)
  ------------------
  |  |   65|      0|#define MHD_VOLUME       0x0001
  ------------------
  |  Branch (1230:9): [True: 0, False: 0]
  ------------------
 1231|      0|    {
 1232|       |      /* Find the appropriate offset among the multivolume archive */
 1233|      0|      while (1)
  ------------------
  |  Branch (1233:14): [Folded - Ignored]
  ------------------
 1234|      0|      {
 1235|      0|        if (client_offset < rar->dbo[rar->cursor].start_offset &&
  ------------------
  |  Branch (1235:13): [True: 0, False: 0]
  ------------------
 1236|      0|          rar->file_flags & FHD_SPLIT_BEFORE)
  ------------------
  |  |   81|      0|#define FHD_SPLIT_BEFORE 0x0001
  ------------------
  |  Branch (1236:11): [True: 0, False: 0]
  ------------------
 1237|      0|        {
 1238|       |          /* Search backwards for the correct data block */
 1239|      0|          if (rar->cursor == 0)
  ------------------
  |  Branch (1239:15): [True: 0, False: 0]
  ------------------
 1240|      0|          {
 1241|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1242|      0|              "Attempt to seek past beginning of RAR data block");
 1243|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1244|      0|          }
 1245|      0|          rar->cursor--;
 1246|      0|          client_offset -= rar->dbo[rar->cursor+1].start_offset -
 1247|      0|            rar->dbo[rar->cursor].end_offset;
 1248|      0|          if (client_offset < rar->dbo[rar->cursor].start_offset)
  ------------------
  |  Branch (1248:15): [True: 0, False: 0]
  ------------------
 1249|      0|            continue;
 1250|      0|          ret = __archive_read_seek(a, rar->dbo[rar->cursor].start_offset -
 1251|      0|            rar->dbo[rar->cursor].header_size, SEEK_SET);
 1252|      0|          if (ret < (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1252:15): [True: 0, False: 0]
  ------------------
 1253|      0|            return ret;
 1254|      0|          ret = archive_read_format_rar_read_header(a, a->entry);
 1255|      0|          if (ret != (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1255:15): [True: 0, False: 0]
  ------------------
 1256|      0|          {
 1257|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1258|      0|              "Error during seek of RAR file");
 1259|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1260|      0|          }
 1261|      0|          rar->cursor--;
 1262|      0|          break;
 1263|      0|        }
 1264|      0|        else if (client_offset > rar->dbo[rar->cursor].end_offset &&
  ------------------
  |  Branch (1264:18): [True: 0, False: 0]
  ------------------
 1265|      0|          rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|      0|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (1265:11): [True: 0, False: 0]
  ------------------
 1266|      0|        {
 1267|       |          /* Search forward for the correct data block */
 1268|      0|          rar->cursor++;
 1269|      0|          if (rar->cursor < rar->nodes &&
  ------------------
  |  Branch (1269:15): [True: 0, False: 0]
  ------------------
 1270|      0|            client_offset > rar->dbo[rar->cursor].end_offset)
  ------------------
  |  Branch (1270:13): [True: 0, False: 0]
  ------------------
 1271|      0|          {
 1272|      0|            client_offset += rar->dbo[rar->cursor].start_offset -
 1273|      0|              rar->dbo[rar->cursor-1].end_offset;
 1274|      0|            continue;
 1275|      0|          }
 1276|      0|          rar->cursor--;
 1277|      0|          ret = __archive_read_seek(a, rar->dbo[rar->cursor].end_offset,
 1278|      0|                                    SEEK_SET);
 1279|      0|          if (ret < (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1279:15): [True: 0, False: 0]
  ------------------
 1280|      0|            return ret;
 1281|      0|          ret = archive_read_format_rar_read_header(a, a->entry);
 1282|      0|          if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1282:15): [True: 0, False: 0]
  ------------------
 1283|      0|          {
 1284|      0|            rar->has_endarc_header = 1;
 1285|      0|            ret = archive_read_format_rar_read_header(a, a->entry);
 1286|      0|          }
 1287|      0|          if (ret != (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1287:15): [True: 0, False: 0]
  ------------------
 1288|      0|          {
 1289|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1290|      0|              "Error during seek of RAR file");
 1291|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1292|      0|          }
 1293|      0|          client_offset += rar->dbo[rar->cursor].start_offset -
 1294|      0|            rar->dbo[rar->cursor-1].end_offset;
 1295|      0|          continue;
 1296|      0|        }
 1297|      0|        break;
 1298|      0|      }
 1299|      0|    }
 1300|       |
 1301|      0|    ret = __archive_read_seek(a, client_offset, SEEK_SET);
 1302|      0|    if (ret < (ARCHIVE_OK))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1302:9): [True: 0, False: 0]
  ------------------
 1303|      0|      return ret;
 1304|      0|    rar->bytes_remaining = rar->dbo[rar->cursor].end_offset - ret;
 1305|      0|    i = rar->cursor;
 1306|      0|    while (i > 0)
  ------------------
  |  Branch (1306:12): [True: 0, False: 0]
  ------------------
 1307|      0|    {
 1308|      0|      i--;
 1309|      0|      ret -= rar->dbo[i+1].start_offset - rar->dbo[i].end_offset;
 1310|      0|    }
 1311|      0|    ret -= rar->dbo[0].start_offset;
 1312|       |
 1313|       |    /* Always restart reading the file after a seek */
 1314|      0|    __archive_reset_read_data(&a->archive);
 1315|       |
 1316|      0|    rar->bytes_unconsumed = 0;
 1317|      0|    rar->offset = 0;
 1318|       |
 1319|       |    /*
 1320|       |     * If a seek past the end of file was requested, return the requested
 1321|       |     * offset.
 1322|       |     */
 1323|      0|    if (ret == rar->unp_size && rar->offset_seek > rar->unp_size)
  ------------------
  |  Branch (1323:9): [True: 0, False: 0]
  |  Branch (1323:33): [True: 0, False: 0]
  ------------------
 1324|      0|      return rar->offset_seek;
 1325|       |
 1326|       |    /* Return the new offset */
 1327|      0|    rar->offset_seek = ret;
 1328|      0|    return rar->offset_seek;
 1329|      0|  }
 1330|     15|  else
 1331|     15|  {
 1332|     15|    archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|     15|      "Seeking of compressed RAR files is unsupported");
 1334|     15|  }
 1335|     15|  return (ARCHIVE_FAILED);
  ------------------
  |  |  196|     15|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1336|     15|}
archive_read_support_format_rar.c:archive_read_format_rar_cleanup:
 1340|    238|{
 1341|    238|  struct rar *rar;
 1342|       |
 1343|    238|  rar = (struct rar *)(a->format->data);
 1344|    238|  free_codes(a);
 1345|    238|  clear_filters(&rar->filters);
 1346|    238|  free(rar->filename);
 1347|    238|  free(rar->filename_save);
 1348|    238|  free(rar->dbo);
 1349|    238|  free(rar->unp_buffer);
 1350|    238|  free(rar->lzss.window);
 1351|    238|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1352|    238|  free(rar);
 1353|    238|  (a->format->data) = NULL;
 1354|    238|  return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1355|    238|}
archive_read_support_format_rar.c:clear_filters:
 3524|    238|{
 3525|    238|  delete_filter(filters->stack);
 3526|    238|  delete_program_code(filters->progs);
 3527|    238|  free(filters->vm);
 3528|    238|}

archive_read_support_format_rar5:
 4239|    238|int archive_read_support_format_rar5(struct archive *_a) {
 4240|    238|	struct archive_read* ar;
 4241|    238|	int ret;
 4242|    238|	struct rar5* rar;
 4243|       |
 4244|    238|	if(ARCHIVE_OK != (ret = get_archive_read(_a, &ar)))
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4244:5): [True: 0, False: 238]
  ------------------
 4245|      0|		return ret;
 4246|       |
 4247|    238|	rar = malloc(sizeof(*rar));
 4248|    238|	if(rar == NULL) {
  ------------------
  |  Branch (4248:5): [True: 0, False: 238]
  ------------------
 4249|      0|		archive_set_error(&ar->archive, ENOMEM,
 4250|      0|		    "Can't allocate rar5 data");
 4251|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4252|      0|	}
 4253|       |
 4254|    238|	if(ARCHIVE_OK != rar5_init(rar)) {
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4254:5): [True: 0, False: 238]
  ------------------
 4255|      0|		archive_set_error(&ar->archive, ENOMEM,
 4256|      0|		    "Can't allocate rar5 filter buffer");
 4257|      0|		free(rar);
 4258|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4259|      0|	}
 4260|       |
 4261|    238|	ret = __archive_read_register_format(ar,
 4262|    238|	    rar,
 4263|    238|	    "rar5",
 4264|    238|	    rar5_bid,
 4265|    238|	    rar5_options,
 4266|    238|	    rar5_read_header,
 4267|    238|	    rar5_read_data,
 4268|    238|	    rar5_read_data_skip,
 4269|    238|	    rar5_seek_data,
 4270|    238|	    rar5_cleanup,
 4271|    238|	    rar5_capabilities,
 4272|    238|	    rar5_has_encrypted_entries);
 4273|       |
 4274|    238|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4274:5): [True: 0, False: 238]
  ------------------
 4275|      0|		(void) rar5_cleanup(ar);
 4276|      0|	}
 4277|       |
 4278|    238|	return ret;
 4279|    238|}
archive_read_support_format_rar5.c:get_archive_read:
  880|    238|{
  881|    238|	*ar = (struct archive_read*) a;
  882|    238|	archive_check_magic(a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  883|    238|	    "archive_read_support_format_rar5");
  884|       |
  885|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  886|    238|}
archive_read_support_format_rar5.c:rar5_init:
 4230|    238|static int rar5_init(struct rar5* rar) {
 4231|    238|	memset(rar, 0, sizeof(struct rar5));
 4232|       |
 4233|    238|	if(CDE_OK != cdeque_init(&rar->cstate.filters, 8192))
  ------------------
  |  Branch (4233:5): [True: 0, False: 238]
  ------------------
 4234|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4235|       |
 4236|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4237|    238|}
archive_read_support_format_rar5.c:cdeque_init:
  381|    238|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  382|    238|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (382:5): [True: 0, False: 238]
  |  Branch (382:18): [True: 0, False: 238]
  ------------------
  383|      0|		return CDE_PARAM;
  384|       |
  385|    238|	d->cap_mask = max_capacity_power_of_2 - 1;
  386|    238|	d->arr = NULL;
  387|       |
  388|    238|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (388:5): [True: 0, False: 238]
  ------------------
  389|      0|		return CDE_PARAM;
  390|       |
  391|    238|	cdeque_clear(d);
  392|    238|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  393|       |
  394|    238|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (394:9): [True: 238, False: 0]
  ------------------
  395|    238|}
archive_read_support_format_rar5.c:cdeque_clear:
  372|  6.71k|static void cdeque_clear(struct cdeque* d) {
  373|  6.71k|	d->size = 0;
  374|  6.71k|	d->beg_pos = 0;
  375|  6.71k|	d->end_pos = 0;
  376|  6.71k|}
archive_read_support_format_rar5.c:rar5_bid:
 1165|    236|static int rar5_bid(struct archive_read* a, int best_bid) {
 1166|    236|	int my_bid;
 1167|       |
 1168|    236|	if(best_bid > 30)
  ------------------
  |  Branch (1168:5): [True: 25, False: 211]
  ------------------
 1169|     25|		return -1;
 1170|       |
 1171|    211|	my_bid = bid_standard(a);
 1172|    211|	if(my_bid > -1) {
  ------------------
  |  Branch (1172:5): [True: 27, False: 184]
  ------------------
 1173|     27|		return my_bid;
 1174|     27|	}
 1175|    184|	my_bid = bid_sfx(a);
 1176|    184|	if (my_bid > -1) {
  ------------------
  |  Branch (1176:6): [True: 179, False: 5]
  ------------------
 1177|    179|		return my_bid;
 1178|    179|	}
 1179|       |
 1180|      5|	return -1;
 1181|    184|}
archive_read_support_format_rar5.c:bid_standard:
 1112|    211|static int bid_standard(struct archive_read* a) {
 1113|    211|	const uint8_t* p;
 1114|    211|	char signature[sizeof(rar5_signature_xor)];
 1115|       |
 1116|    211|	rar5_signature(signature);
 1117|       |
 1118|    211|	if(!read_ahead(a, sizeof(rar5_signature_xor), &p))
  ------------------
  |  Branch (1118:5): [True: 5, False: 206]
  ------------------
 1119|      5|		return -1;
 1120|       |
 1121|    206|	if(!memcmp(signature, p, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1121:5): [True: 27, False: 179]
  ------------------
 1122|     27|		return 30;
 1123|       |
 1124|    179|	return -1;
 1125|    206|}
archive_read_support_format_rar5.c:rar5_signature:
 4073|  5.80k|static void rar5_signature(char *buf) {
 4074|  5.80k|		size_t i;
 4075|       |
 4076|  52.2k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4076:14): [True: 46.4k, False: 5.80k]
  ------------------
 4077|  46.4k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4078|  46.4k|		}
 4079|  5.80k|}
archive_read_support_format_rar5.c:read_ahead:
  890|   236k|{
  891|   236k|	ssize_t avail = -1;
  892|   236k|	if(!ptr)
  ------------------
  |  Branch (892:5): [True: 0, False: 236k]
  ------------------
  893|      0|		return 0;
  894|       |
  895|   236k|	*ptr = __archive_read_ahead(a, how_many, &avail);
  896|   236k|	if(*ptr == NULL) {
  ------------------
  |  Branch (896:5): [True: 514, False: 235k]
  ------------------
  897|    514|		return 0;
  898|    514|	}
  899|       |
  900|   235k|	return 1;
  901|   236k|}
archive_read_support_format_rar5.c:bid_sfx:
 1128|    184|{
 1129|    184|	const char *p;
 1130|       |
 1131|    184|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1131:6): [True: 5, False: 179]
  ------------------
 1132|      5|		return -1;
 1133|       |
 1134|    179|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1134:7): [True: 20, False: 159]
  |  Branch (1134:22): [True: 20, False: 0]
  |  Branch (1134:38): [True: 0, False: 159]
  ------------------
 1135|       |		/* This is a PE file */
 1136|     20|		char signature[sizeof(rar5_signature_xor)];
 1137|     20|		ssize_t offset = 0x10000;
 1138|     20|		ssize_t window = 4096;
 1139|     20|		ssize_t bytes_avail;
 1140|       |
 1141|     20|		rar5_signature(signature);
 1142|       |
 1143|    107|		while (offset + window <= (1024 * 512)) {
  ------------------
  |  Branch (1143:10): [True: 104, False: 3]
  ------------------
 1144|    104|			const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
 1145|    104|			if (buff == NULL) {
  ------------------
  |  Branch (1145:8): [True: 84, False: 20]
  ------------------
 1146|       |				/* Remaining bytes are less than window. */
 1147|     84|				window >>= 1;
 1148|     84|				if (window < 0x40)
  ------------------
  |  Branch (1148:9): [True: 12, False: 72]
  ------------------
 1149|     12|					return 0;
 1150|     72|				continue;
 1151|     84|			}
 1152|     20|			p = buff + offset;
 1153|   265k|			while (p + 8 < buff + bytes_avail) {
  ------------------
  |  Branch (1153:11): [True: 265k, False: 15]
  ------------------
 1154|   265k|				if (memcmp(p, signature, sizeof(signature)) == 0)
  ------------------
  |  Branch (1154:9): [True: 5, False: 265k]
  ------------------
 1155|      5|					return 30;
 1156|   265k|				p += 0x10;
 1157|   265k|			}
 1158|     15|			offset = p - buff;
 1159|     15|		}
 1160|     20|	}
 1161|       |
 1162|    162|	return 0;
 1163|    179|}
archive_read_support_format_rar5.c:rar5_read_header:
 2425|  4.45k|{
 2426|  4.45k|	struct rar5* rar = get_context(a);
 2427|  4.45k|	int ret;
 2428|       |
 2429|  4.45k|	if(rar->header_initialized == 0) {
  ------------------
  |  Branch (2429:5): [True: 27, False: 4.42k]
  ------------------
 2430|     27|		init_header(a);
 2431|     27|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  194|     27|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2431:7): [True: 0, False: 27]
  ------------------
 2432|      0|			return ret;
 2433|     27|		rar->header_initialized = 1;
 2434|     27|	}
 2435|       |
 2436|  4.45k|	if(rar->skipped_magic == 0) {
  ------------------
  |  Branch (2436:5): [True: 27, False: 4.42k]
  ------------------
 2437|     27|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  192|     27|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2437:6): [True: 0, False: 27]
  ------------------
 2438|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2439|      0|		}
 2440|       |
 2441|     27|		rar->skipped_magic = 1;
 2442|     27|	}
 2443|       |
 2444|  4.78k|	do {
 2445|  4.78k|		ret = process_base_block(a, entry);
 2446|  4.78k|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  193|  9.56k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2446:10): [True: 174, False: 4.60k]
  ------------------
 2447|  4.78k|			(rar->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  192|    155|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2447:5): [True: 155, False: 4.45k]
  |  Branch (2447:29): [True: 155, False: 0]
  ------------------
 2448|       |
 2449|  4.45k|	return ret;
 2450|  4.45k|}
archive_read_support_format_rar5.c:get_context:
  504|   696k|static inline struct rar5* get_context(struct archive_read* a) {
  505|   696k|	return (struct rar5*) a->format->data;
  506|   696k|}
archive_read_support_format_rar5.c:init_header:
 1196|     27|static void init_header(struct archive_read* a) {
 1197|     27|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  346|     27|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1198|     27|	a->archive.archive_format_name = "RAR5";
 1199|     27|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2368|     27|{
 2369|     27|	const char *p;
 2370|       |
 2371|     27|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2371:6): [True: 0, False: 27]
  ------------------
 2372|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2373|       |
 2374|     27|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2374:7): [True: 1, False: 26]
  |  Branch (2374:22): [True: 1, False: 0]
  |  Branch (2374:38): [True: 0, False: 26]
  ------------------
 2375|      1|	{
 2376|      1|		char signature[sizeof(rar5_signature_xor)];
 2377|      1|		const void *h;
 2378|      1|		const char *q;
 2379|      1|		size_t skip, total = 0;
 2380|      1|		ssize_t bytes, window = 4096;
 2381|       |
 2382|      1|		rar5_signature(signature);
 2383|       |
 2384|      1|		while (total + window <= (1024 * 512)) {
  ------------------
  |  Branch (2384:10): [True: 1, False: 0]
  ------------------
 2385|      1|			h = __archive_read_ahead(a, window, &bytes);
 2386|      1|			if (h == NULL) {
  ------------------
  |  Branch (2386:8): [True: 0, False: 1]
  ------------------
 2387|       |				/* Remaining bytes are less than window. */
 2388|      0|				window >>= 1;
 2389|      0|				if (window < 0x40)
  ------------------
  |  Branch (2389:9): [True: 0, False: 0]
  ------------------
 2390|      0|					goto fatal;
 2391|      0|				continue;
 2392|      0|			}
 2393|      1|			if (bytes < 0x40)
  ------------------
  |  Branch (2393:8): [True: 0, False: 1]
  ------------------
 2394|      0|				goto fatal;
 2395|      1|			p = h;
 2396|      1|			q = p + bytes;
 2397|       |
 2398|       |			/*
 2399|       |			 * Scan ahead until we find something that looks
 2400|       |			 * like the RAR header.
 2401|       |			 */
 2402|  8.70k|			while (p + 8 < q) {
  ------------------
  |  Branch (2402:11): [True: 8.70k, False: 0]
  ------------------
 2403|  8.70k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2403:9): [True: 1, False: 8.70k]
  ------------------
 2404|      1|					skip = p - (const char *)h;
 2405|      1|					__archive_read_consume(a, skip);
 2406|      1|					return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2407|      1|				}
 2408|  8.70k|				p += 0x10;
 2409|  8.70k|			}
 2410|      0|			skip = p - (const char *)h;
 2411|      0|			__archive_read_consume(a, skip);
 2412|      0|			total += skip;
 2413|      0|		}
 2414|      1|	}
 2415|       |
 2416|     26|	return ARCHIVE_OK;
  ------------------
  |  |  192|     26|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2417|      0|fatal:
 2418|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2419|      0|			"Couldn't find out RAR header");
 2420|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2421|     27|}
archive_read_support_format_rar5.c:consume:
  903|   216k|static int consume(struct archive_read* a, int64_t how_many) {
  904|   216k|	int ret;
  905|       |
  906|   216k|	ret = how_many == __archive_read_consume(a, how_many)
  ------------------
  |  Branch (906:8): [True: 216k, False: 1]
  ------------------
  907|   216k|		? ARCHIVE_OK
  ------------------
  |  |  192|   216k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  908|   216k|		: ARCHIVE_FATAL;
  ------------------
  |  |  198|   216k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  909|       |
  910|   216k|	return ret;
  911|   216k|}
archive_read_support_format_rar5.c:process_base_block:
 2179|  20.4k|{
 2180|  20.4k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2181|       |
 2182|  20.4k|	struct rar5* rar = get_context(a);
 2183|  20.4k|	uint32_t hdr_crc, computed_crc;
 2184|  20.4k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2185|  20.4k|	size_t header_id = 0;
 2186|  20.4k|	size_t header_flags = 0;
 2187|  20.4k|	const uint8_t* p;
 2188|  20.4k|	int ret;
 2189|       |
 2190|  20.4k|	enum HEADER_TYPE {
 2191|  20.4k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2192|  20.4k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2193|  20.4k|		HEAD_UNKNOWN = 0xff,
 2194|  20.4k|	};
 2195|       |
 2196|       |	/* Skip any unprocessed data for this file. */
 2197|  20.4k|	ret = skip_unprocessed_bytes(a);
 2198|  20.4k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|  20.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2198:5): [True: 72, False: 20.4k]
  ------------------
 2199|     72|		return ret;
 2200|       |
 2201|       |	/* Read the expected CRC32 checksum. */
 2202|  20.4k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2202:5): [True: 2, False: 20.4k]
  ------------------
 2203|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2204|      2|	}
 2205|       |
 2206|       |	/* Read header size. */
 2207|  20.4k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2207:5): [True: 0, False: 20.4k]
  ------------------
 2208|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2209|      0|	}
 2210|       |
 2211|  20.4k|	hdr_size = raw_hdr_size + hdr_size_len;
 2212|       |
 2213|       |	/* Sanity check, maximum header size for RAR5 is 2MB. */
 2214|  20.4k|	if(hdr_size > (2 * 1024 * 1024)) {
  ------------------
  |  Branch (2214:5): [True: 0, False: 20.4k]
  ------------------
 2215|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2216|      0|		    "Base block header is too large");
 2217|       |
 2218|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2219|      0|	}
 2220|       |
 2221|       |	/* Additional sanity checks to weed out invalid files. */
 2222|  20.4k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2222:5): [True: 7, False: 20.4k]
  |  Branch (2222:26): [True: 0, False: 20.4k]
  ------------------
 2223|  20.4k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2223:3): [True: 2, False: 20.4k]
  ------------------
 2224|      9|	{
 2225|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2226|      9|		    "Too small block encountered (%zu bytes)",
 2227|      9|		    raw_hdr_size);
 2228|       |
 2229|      9|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2230|      9|	}
 2231|       |
 2232|       |	/* Read the whole header data into memory, maximum memory use here is
 2233|       |	 * 2MB. */
 2234|  20.4k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2234:5): [True: 445, False: 19.9k]
  ------------------
 2235|    445|		return ARCHIVE_EOF;
  ------------------
  |  |  191|    445|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2236|    445|	}
 2237|       |
 2238|       |	/* Verify the CRC32 of the header data. */
 2239|  19.9k|	computed_crc = (uint32_t) crc32(0, p, (int) hdr_size);
 2240|  19.9k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2240:5): [True: 14.8k, False: 5.15k]
  ------------------
 2241|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2242|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2243|       |		    "Header CRC error");
 2244|       |
 2245|       |		return ARCHIVE_FATAL;
 2246|       |#endif
 2247|  14.8k|	}
 2248|       |
 2249|       |	/* If the checksum is OK, we proceed with parsing. */
 2250|  19.9k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  192|  19.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2250:5): [True: 0, False: 19.9k]
  ------------------
 2251|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2252|      0|	}
 2253|       |
 2254|  19.9k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2254:5): [True: 0, False: 19.9k]
  ------------------
 2255|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2256|       |
 2257|  19.9k|	if(!read_var_sized(a, &header_flags, NULL))
  ------------------
  |  Branch (2257:5): [True: 0, False: 19.9k]
  ------------------
 2258|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2259|       |
 2260|  19.9k|	rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2261|  19.9k|	rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2262|  19.9k|	rar->generic.size = (int)hdr_size;
 2263|  19.9k|	rar->generic.last_header_id = (int)header_id;
 2264|  19.9k|	rar->main.endarc = 0;
 2265|       |
 2266|       |	/* Those are possible header ids in RARv5. */
 2267|  19.9k|	switch(header_id) {
 2268|  4.45k|		case HEAD_MAIN:
  ------------------
  |  Branch (2268:3): [True: 4.45k, False: 15.5k]
  ------------------
 2269|  4.45k|			ret = process_head_main(a, rar, entry, header_flags);
 2270|       |
 2271|       |			/* Main header doesn't have any files in it, so it's
 2272|       |			 * pointless to return to the caller. Retry to next
 2273|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2274|  4.45k|			if(ret == ARCHIVE_OK)
  ------------------
  |  |  192|  4.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2274:7): [True: 186, False: 4.27k]
  ------------------
 2275|    186|				return ARCHIVE_RETRY;
  ------------------
  |  |  193|    186|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2276|       |
 2277|  4.27k|			return ret;
 2278|    687|		case HEAD_SERVICE:
  ------------------
  |  Branch (2278:3): [True: 687, False: 19.2k]
  ------------------
 2279|    687|			ret = process_head_service(a, rar, entry, header_flags);
 2280|    687|			return ret;
 2281|  6.94k|		case HEAD_FILE:
  ------------------
  |  Branch (2281:3): [True: 6.94k, False: 13.0k]
  ------------------
 2282|  6.94k|			ret = process_head_file(a, rar, entry, header_flags);
 2283|  6.94k|			return ret;
 2284|      0|		case HEAD_CRYPT:
  ------------------
  |  Branch (2284:3): [True: 0, False: 19.9k]
  ------------------
 2285|      0|			archive_set_error(&a->archive,
 2286|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2287|      0|			    "Encryption is not supported");
 2288|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2289|  5.57k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2289:3): [True: 5.57k, False: 14.3k]
  ------------------
 2290|  5.57k|			rar->main.endarc = 1;
 2291|       |
 2292|       |			/* After encountering an end of file marker, we need
 2293|       |			 * to take into consideration if this archive is
 2294|       |			 * continued in another file (i.e. is it part01.rar:
 2295|       |			 * is there a part02.rar?) */
 2296|  5.57k|			if(rar->main.volume) {
  ------------------
  |  Branch (2296:7): [True: 5.57k, False: 2]
  ------------------
 2297|       |				/* In case there is part02.rar, position the
 2298|       |				 * read pointer in a proper place, so we can
 2299|       |				 * resume parsing. */
 2300|  5.57k|				ret = scan_for_signature(a);
 2301|  5.57k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  198|  5.57k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2301:8): [True: 0, False: 5.57k]
  ------------------
 2302|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2303|  5.57k|				} else {
 2304|  5.57k|					if(rar->vol.expected_vol_no ==
  ------------------
  |  Branch (2304:9): [True: 0, False: 5.57k]
  ------------------
 2305|  5.57k|					    UINT_MAX) {
 2306|      0|						archive_set_error(&a->archive,
 2307|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2308|      0|						    "Header error");
 2309|      0|							return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2310|      0|					}
 2311|       |
 2312|  5.57k|					rar->vol.expected_vol_no =
 2313|  5.57k|					    rar->main.vol_no + 1;
 2314|  5.57k|					return ARCHIVE_OK;
  ------------------
  |  |  192|  5.57k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2315|  5.57k|				}
 2316|  5.57k|			} else {
 2317|      2|				return ARCHIVE_EOF;
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2318|      2|			}
 2319|      5|		case HEAD_MARK:
  ------------------
  |  Branch (2319:3): [True: 5, False: 19.9k]
  ------------------
 2320|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2321|  2.30k|		default:
  ------------------
  |  Branch (2321:3): [True: 2.30k, False: 17.6k]
  ------------------
 2322|  2.30k|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2322:7): [True: 1, False: 2.30k]
  ------------------
 2323|      1|				archive_set_error(&a->archive,
 2324|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2325|      1|				    "Header type error");
 2326|      1|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2327|  2.30k|			} else {
 2328|       |				/* If the block is marked as 'skip if unknown',
 2329|       |				 * do as the flag says: skip the block
 2330|       |				 * instead on failing on it. */
 2331|  2.30k|				return ARCHIVE_RETRY;
  ------------------
  |  |  193|  2.30k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2332|  2.30k|			}
 2333|  19.9k|	}
 2334|       |
 2335|      0|#if !defined WIN32
 2336|       |	// Not reached.
 2337|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2338|      0|	    "Internal unpacker error");
 2339|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2340|  19.9k|#endif
 2341|  19.9k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2096|  20.4k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2097|  20.4k|	struct rar5* rar = get_context(a);
 2098|  20.4k|	int ret;
 2099|       |
 2100|  20.4k|	if(rar->file.bytes_remaining) {
  ------------------
  |  Branch (2100:5): [True: 2.35k, False: 18.1k]
  ------------------
 2101|       |		/* Use different skipping method in block merging mode than in
 2102|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2103|       |		 * can't be used, because it could allow recursive use of
 2104|       |		 * merge_block() * function, and this function doesn't support
 2105|       |		 * recursive use. */
 2106|  2.35k|		if(rar->merge_mode) {
  ------------------
  |  Branch (2106:6): [True: 52, False: 2.30k]
  ------------------
 2107|       |			/* Discard whole merged block. This is valid in solid
 2108|       |			 * mode as well, because the code will discard blocks
 2109|       |			 * only if those blocks are safe to discard (i.e.
 2110|       |			 * they're not FILE blocks).  */
 2111|     52|			ret = consume(a, rar->file.bytes_remaining);
 2112|     52|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     52|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2112:7): [True: 0, False: 52]
  ------------------
 2113|      0|				return ret;
 2114|      0|			}
 2115|     52|			rar->file.bytes_remaining = 0;
 2116|  2.30k|		} else {
 2117|       |			/* If we're not in merge mode, use safe skipping code.
 2118|       |			 * This will ensure we'll handle solid archives
 2119|       |			 * properly. */
 2120|  2.30k|			ret = rar5_read_data_skip(a);
 2121|  2.30k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  2.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2121:7): [True: 72, False: 2.23k]
  ------------------
 2122|     72|				return ret;
 2123|     72|			}
 2124|  2.30k|		}
 2125|  2.35k|	}
 2126|       |
 2127|  20.4k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  20.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2128|  20.4k|}
archive_read_support_format_rar5.c:read_u32:
 1094|  26.0k|static int read_u32(struct archive_read* a, uint32_t* pvalue) {
 1095|  26.0k|	const uint8_t* p;
 1096|  26.0k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1096:5): [True: 2, False: 26.0k]
  ------------------
 1097|      2|		return 0;
 1098|       |
 1099|  26.0k|	*pvalue = archive_le32dec(p);
 1100|  26.0k|	return ARCHIVE_OK == consume(a, 4) ? 1 : 0;
  ------------------
  |  |  192|  26.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1100:9): [True: 26.0k, False: 0]
  ------------------
 1101|  26.0k|}
archive_read_support_format_rar5.c:read_var_sized:
 1003|   123k|{
 1004|   123k|	uint64_t v;
 1005|   123k|	uint64_t v_size = 0;
 1006|       |
 1007|   123k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1007:18): [True: 28.5k, False: 95.1k]
  ------------------
 1008|   123k|				   : read_var(a, &v, NULL);
 1009|       |
 1010|   123k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1010:5): [True: 123k, False: 0]
  |  Branch (1010:17): [True: 123k, False: 0]
  ------------------
 1011|   123k|		*pvalue = (size_t) v;
 1012|   123k|	}
 1013|       |
 1014|   123k|	if(pvalue_len) {
  ------------------
  |  Branch (1014:5): [True: 28.5k, False: 95.1k]
  ------------------
 1015|       |		/* Possible data truncation should be safe. */
 1016|  28.5k|		*pvalue_len = (size_t) v_size;
 1017|  28.5k|	}
 1018|       |
 1019|   123k|	return ret;
 1020|   123k|}
archive_read_support_format_rar5.c:read_var:
  932|   149k|{
  933|   149k|	uint64_t result = 0;
  934|   149k|	size_t shift, i;
  935|   149k|	const uint8_t* p;
  936|   149k|	uint8_t b;
  937|       |
  938|       |	/* We will read maximum of 8 bytes. We don't have to handle the
  939|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  940|       |	 * the file, because such situation will never happen. */
  941|   149k|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (941:5): [True: 0, False: 149k]
  ------------------
  942|      0|		return 0;
  943|       |
  944|   180k|	for(shift = 0, i = 0; i < 8; i++, shift += 7) {
  ------------------
  |  Branch (944:24): [True: 180k, False: 251]
  ------------------
  945|   180k|		b = p[i];
  946|       |
  947|       |		/* Strip the MSB from the input byte and add the resulting
  948|       |		 * number to the `result`. */
  949|   180k|		result += (b & (uint64_t)0x7F) << shift;
  950|       |
  951|       |		/* MSB set to 1 means we need to continue decoding process.
  952|       |		 * MSB set to 0 means we're done.
  953|       |		 *
  954|       |		 * This conditional checks for the second case. */
  955|   180k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (955:6): [True: 149k, False: 30.7k]
  ------------------
  956|   149k|			if(pvalue) {
  ------------------
  |  Branch (956:7): [True: 149k, False: 0]
  ------------------
  957|   149k|				*pvalue = result;
  958|   149k|			}
  959|       |
  960|       |			/* If the caller has passed the `pvalue_len` pointer,
  961|       |			 * store the number of consumed bytes in it and do NOT
  962|       |			 * consume those bytes, since the caller has all the
  963|       |			 * information it needs to perform */
  964|   149k|			if(pvalue_len) {
  ------------------
  |  Branch (964:7): [True: 43.1k, False: 106k]
  ------------------
  965|  43.1k|				*pvalue_len = 1 + i;
  966|   106k|			} else {
  967|       |				/* If the caller did not provide the
  968|       |				 * `pvalue_len` pointer, it will not have the
  969|       |				 * possibility to advance the file pointer,
  970|       |				 * because it will not know how many bytes it
  971|       |				 * needs to consume. This is why we handle
  972|       |				 * such situation here automatically. */
  973|   106k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  192|   106k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (973:8): [True: 0, False: 106k]
  ------------------
  974|      0|					return 0;
  975|      0|				}
  976|   106k|			}
  977|       |
  978|       |			/* End of decoding process, return success. */
  979|   149k|			return 1;
  980|   149k|		}
  981|   180k|	}
  982|       |
  983|       |	/* The decoded value takes the maximum number of 8 bytes.
  984|       |	 * It's a maximum number of bytes, so end decoding process here
  985|       |	 * even if the first bit of last byte is 1. */
  986|    251|	if(pvalue) {
  ------------------
  |  Branch (986:5): [True: 251, False: 0]
  ------------------
  987|    251|		*pvalue = result;
  988|    251|	}
  989|       |
  990|    251|	if(pvalue_len) {
  ------------------
  |  Branch (990:5): [True: 211, False: 40]
  ------------------
  991|    211|		*pvalue_len = 9;
  992|    211|	} else {
  993|     40|		if(ARCHIVE_OK != consume(a, 9)) {
  ------------------
  |  |  192|     40|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (993:6): [True: 0, False: 40]
  ------------------
  994|      0|			return 0;
  995|      0|		}
  996|     40|	}
  997|       |
  998|    251|	return 1;
  999|    251|}
archive_read_support_format_rar5.c:process_head_main:
 1990|  4.45k|{
 1991|  4.45k|	int ret;
 1992|  4.45k|	uint64_t extra_data_size = 0;
 1993|  4.45k|	size_t extra_field_size = 0;
 1994|  4.45k|	size_t extra_field_id = 0;
 1995|  4.45k|	size_t archive_flags = 0;
 1996|       |
 1997|  4.45k|	enum MAIN_FLAGS {
 1998|  4.45k|		VOLUME = 0x0001,         /* multi-volume archive */
 1999|  4.45k|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2000|       |					  * have it */
 2001|  4.45k|		SOLID = 0x0004,          /* solid archive */
 2002|  4.45k|		PROTECT = 0x0008,        /* contains Recovery info */
 2003|  4.45k|		LOCK = 0x0010,           /* readonly flag, not used */
 2004|  4.45k|	};
 2005|       |
 2006|  4.45k|	enum MAIN_EXTRA {
 2007|       |		// Just one attribute here.
 2008|  4.45k|		LOCATOR = 0x01,
 2009|  4.45k|	};
 2010|       |
 2011|  4.45k|	(void) entry;
 2012|       |
 2013|  4.45k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2013:5): [True: 5, False: 4.45k]
  ------------------
 2014|      5|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2014:6): [True: 0, False: 5]
  ------------------
 2015|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2016|  4.45k|	} else {
 2017|  4.45k|		extra_data_size = 0;
 2018|  4.45k|	}
 2019|       |
 2020|  4.45k|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2020:5): [True: 0, False: 4.45k]
  ------------------
 2021|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2022|      0|	}
 2023|       |
 2024|  4.45k|	rar->main.volume = (archive_flags & VOLUME) > 0;
 2025|  4.45k|	rar->main.solid = (archive_flags & SOLID) > 0;
 2026|       |
 2027|  4.45k|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2027:5): [True: 4.44k, False: 7]
  ------------------
 2028|  4.44k|		size_t v = 0;
 2029|  4.44k|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2029:6): [True: 0, False: 4.44k]
  ------------------
 2030|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2031|      0|		}
 2032|       |
 2033|  4.44k|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2033:7): [True: 0, False: 4.44k]
  ------------------
 2034|      0|			archive_set_error(&a->archive,
 2035|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2036|      0|			    "Invalid volume number");
 2037|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2038|      0|		}
 2039|       |
 2040|  4.44k|		rar->main.vol_no = (unsigned int) v;
 2041|  4.44k|	} else {
 2042|      7|		rar->main.vol_no = 0;
 2043|      7|	}
 2044|       |
 2045|  4.45k|	if(rar->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2045:5): [True: 4.42k, False: 32]
  ------------------
 2046|  4.45k|		rar->main.vol_no != rar->vol.expected_vol_no)
  ------------------
  |  Branch (2046:3): [True: 4.27k, False: 154]
  ------------------
 2047|  4.27k|	{
 2048|       |		/* Returning EOF instead of FATAL because of strange
 2049|       |		 * libarchive behavior. When opening multiple files via
 2050|       |		 * archive_read_open_filenames(), after reading up the whole
 2051|       |		 * last file, the __archive_read_ahead function wraps up to
 2052|       |		 * the first archive instead of returning EOF. */
 2053|  4.27k|		return ARCHIVE_EOF;
  ------------------
  |  |  191|  4.27k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2054|  4.27k|	}
 2055|       |
 2056|    186|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2056:5): [True: 181, False: 5]
  ------------------
 2057|       |		/* Early return. */
 2058|    181|		return ARCHIVE_OK;
  ------------------
  |  |  192|    181|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2059|    181|	}
 2060|       |
 2061|      5|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2061:5): [True: 0, False: 5]
  ------------------
 2062|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2063|      0|	}
 2064|       |
 2065|      5|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2065:5): [True: 0, False: 5]
  ------------------
 2066|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2067|      0|	}
 2068|       |
 2069|      5|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2069:5): [True: 0, False: 5]
  ------------------
 2070|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2071|      0|		    "Invalid extra field size");
 2072|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2073|      0|	}
 2074|       |
 2075|      5|	switch(extra_field_id) {
 2076|      5|		case LOCATOR:
  ------------------
  |  Branch (2076:3): [True: 5, False: 0]
  ------------------
 2077|      5|			ret = process_main_locator_extra_block(a, rar);
 2078|      5|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2078:7): [True: 0, False: 5]
  ------------------
 2079|       |				/* Error while parsing main locator extra
 2080|       |				 * block. */
 2081|      0|				return ret;
 2082|      0|			}
 2083|       |
 2084|      5|			break;
 2085|      5|		default:
  ------------------
  |  Branch (2085:3): [True: 0, False: 5]
  ------------------
 2086|      0|			archive_set_error(&a->archive,
 2087|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2088|      0|			    "Unsupported extra type (0x%x)",
 2089|      0|			    (int) extra_field_id);
 2090|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2091|      5|	}
 2092|       |
 2093|      5|	return ARCHIVE_OK;
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2094|      5|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1220|      5|{
 1221|      5|	uint64_t locator_flags;
 1222|       |
 1223|      5|	enum LOCATOR_FLAGS {
 1224|      5|		QLIST = 0x01, RECOVERY = 0x02,
 1225|      5|	};
 1226|       |
 1227|      5|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1227:5): [True: 0, False: 5]
  ------------------
 1228|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1229|      0|	}
 1230|       |
 1231|      5|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1231:5): [True: 4, False: 1]
  ------------------
 1232|      4|		if(!read_var(a, &rar->qlist_offset, NULL)) {
  ------------------
  |  Branch (1232:6): [True: 0, False: 4]
  ------------------
 1233|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1234|      0|		}
 1235|       |
 1236|       |		/* qlist is not used */
 1237|      4|	}
 1238|       |
 1239|      5|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1239:5): [True: 2, False: 3]
  ------------------
 1240|      2|		if(!read_var(a, &rar->rr_offset, NULL)) {
  ------------------
  |  Branch (1240:6): [True: 0, False: 2]
  ------------------
 1241|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1242|      0|		}
 1243|       |
 1244|       |		/* rr is not used */
 1245|      2|	}
 1246|       |
 1247|      5|	return ARCHIVE_OK;
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1248|      5|}
archive_read_support_format_rar5.c:process_head_service:
 1969|    687|{
 1970|       |	/* Process this SERVICE block the same way as FILE blocks. */
 1971|    687|	int ret = process_head_file(a, rar, entry, block_flags);
 1972|    687|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|    687|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1972:5): [True: 1, False: 686]
  ------------------
 1973|      1|		return ret;
 1974|       |
 1975|    686|	rar->file.service = 1;
 1976|       |
 1977|       |	/* But skip the data part automatically. It's no use for the user
 1978|       |	 * anyway.  It contains only service data, not even needed to
 1979|       |	 * properly unpack the file. */
 1980|    686|	ret = rar5_read_data_skip(a);
 1981|    686|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|    686|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1981:5): [True: 0, False: 686]
  ------------------
 1982|      0|		return ret;
 1983|       |
 1984|       |	/* After skipping, try parsing another block automatically. */
 1985|    686|	return ARCHIVE_RETRY;
  ------------------
  |  |  193|    686|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 1986|    686|}
archive_read_support_format_rar5.c:process_head_file:
 1646|  7.62k|{
 1647|  7.62k|	int64_t extra_data_size = 0;
 1648|  7.62k|	size_t data_size = 0;
 1649|  7.62k|	size_t file_flags = 0;
 1650|  7.62k|	size_t file_attr = 0;
 1651|  7.62k|	size_t compression_info = 0;
 1652|  7.62k|	size_t host_os = 0;
 1653|  7.62k|	size_t name_size = 0;
 1654|  7.62k|	uint64_t unpacked_size, window_size;
 1655|  7.62k|	uint32_t mtime = 0, crc = 0;
 1656|  7.62k|	int c_method = 0, c_version = 0;
 1657|  7.62k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1658|  7.62k|	const uint8_t* p;
 1659|       |
 1660|  7.62k|	enum FILE_FLAGS {
 1661|  7.62k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1662|  7.62k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1663|  7.62k|	};
 1664|       |
 1665|  7.62k|	enum FILE_ATTRS {
 1666|  7.62k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1667|  7.62k|		ATTR_DIRECTORY = 0x10,
 1668|  7.62k|	};
 1669|       |
 1670|  7.62k|	enum COMP_INFO_FLAGS {
 1671|  7.62k|		SOLID = 0x0040,
 1672|  7.62k|	};
 1673|       |
 1674|  7.62k|	enum HOST_OS {
 1675|  7.62k|		HOST_WINDOWS = 0,
 1676|  7.62k|		HOST_UNIX = 1,
 1677|  7.62k|	};
 1678|       |
 1679|  7.62k|	archive_entry_clear(entry);
 1680|       |
 1681|       |	/* Do not reset file context if we're switching archives. */
 1682|  7.62k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (1682:5): [True: 6.23k, False: 1.39k]
  ------------------
 1683|  6.23k|		reset_file_context(rar);
 1684|  6.23k|	}
 1685|       |
 1686|  7.62k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1686:5): [True: 3.84k, False: 3.78k]
  ------------------
 1687|  3.84k|		uint64_t edata_size = 0;
 1688|  3.84k|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1688:6): [True: 0, False: 3.84k]
  ------------------
 1689|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1690|       |
 1691|       |		/* Intentional type cast from unsigned to signed. */
 1692|  3.84k|		extra_data_size = (int64_t) edata_size;
 1693|  3.84k|	}
 1694|       |
 1695|  7.62k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1695:5): [True: 7.62k, False: 1]
  ------------------
 1696|  7.62k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1696:6): [True: 0, False: 7.62k]
  ------------------
 1697|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1698|       |
 1699|  7.62k|		rar->file.bytes_remaining = data_size;
 1700|  7.62k|	} else {
 1701|      1|		rar->file.bytes_remaining = 0;
 1702|       |
 1703|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1704|      1|				"no data found in file/service block");
 1705|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1706|      1|	}
 1707|       |
 1708|  7.62k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1708:5): [True: 0, False: 7.62k]
  ------------------
 1709|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1710|       |
 1711|  7.62k|	if(!read_var(a, &unpacked_size, NULL))
  ------------------
  |  Branch (1711:5): [True: 0, False: 7.62k]
  ------------------
 1712|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1713|       |
 1714|  7.62k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1714:5): [True: 0, False: 7.62k]
  ------------------
 1715|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1716|      0|		    "Files with unknown unpacked size are not supported");
 1717|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1718|      0|	}
 1719|       |
 1720|  7.62k|	rar->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1721|       |
 1722|  7.62k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1722:5): [True: 0, False: 7.62k]
  ------------------
 1723|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1724|       |
 1725|  7.62k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1725:5): [True: 4.32k, False: 3.29k]
  ------------------
 1726|  4.32k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1726:6): [True: 0, False: 4.32k]
  ------------------
 1727|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1728|  4.32k|	}
 1729|       |
 1730|  7.62k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1730:5): [True: 1.26k, False: 6.36k]
  ------------------
 1731|  1.26k|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1731:6): [True: 0, False: 1.26k]
  ------------------
 1732|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1733|  1.26k|	}
 1734|       |
 1735|  7.62k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1735:5): [True: 0, False: 7.62k]
  ------------------
 1736|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1737|       |
 1738|  7.62k|	c_method = (int) (compression_info >> 7) & 0x7;
 1739|  7.62k|	c_version = (int) (compression_info & 0x3f);
 1740|       |
 1741|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1742|  7.62k|	window_size = (rar->file.dir > 0) ?
  ------------------
  |  Branch (1742:16): [True: 0, False: 7.62k]
  ------------------
 1743|      0|		0 :
 1744|  7.62k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1745|  7.62k|	rar->cstate.method = c_method;
 1746|  7.62k|	rar->cstate.version = c_version + 50;
 1747|  7.62k|	rar->file.solid = (compression_info & SOLID) > 0;
 1748|       |
 1749|       |	/* Archives which declare solid files without initializing the window
 1750|       |	 * buffer first are invalid. */
 1751|       |
 1752|  7.62k|	if(rar->file.solid > 0 && rar->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1752:5): [True: 1.01k, False: 6.61k]
  |  Branch (1752:28): [True: 0, False: 1.01k]
  ------------------
 1753|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1754|      0|				  "Declared solid file, but no window buffer "
 1755|      0|				  "initialized yet.");
 1756|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1757|      0|	}
 1758|       |
 1759|       |	/* Check if window_size is a sane value. Also, if the file is not
 1760|       |	 * declared as a directory, disallow window_size == 0. */
 1761|  7.62k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1761:5): [True: 0, False: 7.62k]
  ------------------
 1762|  7.62k|	    (rar->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1762:7): [True: 7.62k, False: 0]
  |  Branch (1762:29): [True: 0, False: 7.62k]
  ------------------
 1763|      0|	{
 1764|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1765|      0|		    "Declared dictionary size is not supported.");
 1766|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1767|      0|	}
 1768|       |
 1769|  7.62k|	if(rar->file.solid > 0) {
  ------------------
  |  Branch (1769:5): [True: 1.01k, False: 6.61k]
  ------------------
 1770|       |		/* Re-check if current window size is the same as previous
 1771|       |		 * window size (for solid files only). */
 1772|  1.01k|		if(rar->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1772:6): [True: 471, False: 544]
  ------------------
 1773|  1.01k|		    rar->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1773:7): [True: 0, False: 471]
  ------------------
 1774|      0|		{
 1775|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1776|      0|			    "Window size for this solid file doesn't match "
 1777|      0|			    "the window size used in previous solid file. ");
 1778|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1779|      0|		}
 1780|  1.01k|	}
 1781|       |
 1782|  7.62k|	if(rar->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1782:5): [True: 801, False: 6.82k]
  ------------------
 1783|  7.62k|	    rar->cstate.window_buf)
  ------------------
  |  Branch (1783:6): [True: 718, False: 83]
  ------------------
 1784|    718|	{
 1785|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1786|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1787|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1788|       |		 * need to dispose of all entries from the stack before attempting the
 1789|       |		 * realloc. */
 1790|    718|		clear_data_ready_stack(rar);
 1791|       |
 1792|       |		/* If window_buf has been allocated before, reallocate it, so
 1793|       |		 * that its size will match new window_size. */
 1794|       |
 1795|    718|		uint8_t* new_window_buf =
 1796|    718|			realloc(rar->cstate.window_buf, (size_t) window_size);
 1797|       |
 1798|    718|		if(!new_window_buf) {
  ------------------
  |  Branch (1798:6): [True: 0, False: 718]
  ------------------
 1799|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1800|      0|				"Not enough memory when trying to realloc the window "
 1801|      0|				"buffer.");
 1802|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1803|      0|		}
 1804|       |
 1805|    718|		rar->cstate.window_buf = new_window_buf;
 1806|    718|	}
 1807|       |
 1808|       |	/* Values up to 64M should fit into ssize_t on every
 1809|       |	 * architecture. */
 1810|  7.62k|	rar->cstate.window_size = (ssize_t) window_size;
 1811|       |
 1812|  7.62k|	if(rar->file.solid > 0 && rar->file.solid_window_size == 0) {
  ------------------
  |  Branch (1812:5): [True: 1.01k, False: 6.61k]
  |  Branch (1812:28): [True: 544, False: 471]
  ------------------
 1813|       |		/* Solid files have to have the same window_size across
 1814|       |		   whole archive. Remember the window_size parameter
 1815|       |		   for first solid file found. */
 1816|    544|		rar->file.solid_window_size = rar->cstate.window_size;
 1817|    544|	}
 1818|       |
 1819|  7.62k|	init_window_mask(rar);
 1820|       |
 1821|  7.62k|	rar->file.service = 0;
 1822|       |
 1823|  7.62k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1823:5): [True: 0, False: 7.62k]
  ------------------
 1824|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1825|       |
 1826|  7.62k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1826:5): [True: 7.57k, False: 49]
  ------------------
 1827|       |		/* Host OS is Windows */
 1828|       |
 1829|  7.57k|		__LA_MODE_T mode;
  ------------------
  |  |   96|  7.57k|# define	__LA_MODE_T	mode_t
  ------------------
 1830|       |
 1831|  7.57k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1831:6): [True: 3.73k, False: 3.84k]
  ------------------
 1832|  3.73k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1832:8): [True: 981, False: 2.75k]
  ------------------
 1833|    981|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  190|    981|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1834|  2.75k|			} else {
 1835|  2.75k|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  190|  2.75k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1836|  2.75k|			}
 1837|  3.84k|		} else {
 1838|  3.84k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1838:8): [True: 0, False: 3.84k]
  ------------------
 1839|      0|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1840|  3.84k|			} else {
 1841|  3.84k|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  185|  3.84k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1842|  3.84k|			}
 1843|  3.84k|		}
 1844|       |
 1845|  7.57k|		archive_entry_set_mode(entry, mode);
 1846|       |
 1847|  7.57k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1847:7): [True: 5.26k, False: 2.31k]
  ------------------
 1848|  5.26k|			char *fflags_text, *ptr;
 1849|       |			/* allocate for "rdonly,hidden,system," */
 1850|  5.26k|			fflags_text = malloc(22 * sizeof(char));
 1851|  5.26k|			if (fflags_text != NULL) {
  ------------------
  |  Branch (1851:8): [True: 5.26k, False: 0]
  ------------------
 1852|  5.26k|				ptr = fflags_text;
 1853|  5.26k|				if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1853:9): [True: 981, False: 4.28k]
  ------------------
 1854|    981|					strcpy(ptr, "rdonly,");
 1855|    981|					ptr = ptr + 7;
 1856|    981|				}
 1857|  5.26k|				if (file_attr & ATTR_HIDDEN) {
  ------------------
  |  Branch (1857:9): [True: 3.78k, False: 1.48k]
  ------------------
 1858|  3.78k|					strcpy(ptr, "hidden,");
 1859|  3.78k|					ptr = ptr + 7;
 1860|  3.78k|				}
 1861|  5.26k|				if (file_attr & ATTR_SYSTEM) {
  ------------------
  |  Branch (1861:9): [True: 2.51k, False: 2.75k]
  ------------------
 1862|  2.51k|					strcpy(ptr, "system,");
 1863|  2.51k|					ptr = ptr + 7;
 1864|  2.51k|				}
 1865|  5.26k|				if (ptr > fflags_text) {
  ------------------
  |  Branch (1865:9): [True: 5.26k, False: 0]
  ------------------
 1866|       |					/* Delete trailing comma */
 1867|  5.26k|					*(ptr - 1) = '\0';
 1868|  5.26k|					archive_entry_copy_fflags_text(entry,
 1869|  5.26k|					    fflags_text);
 1870|  5.26k|				}
 1871|  5.26k|				free(fflags_text);
 1872|  5.26k|			}
 1873|  5.26k|		}
 1874|  7.57k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1874:12): [True: 49, False: 0]
  ------------------
 1875|       |		/* Host OS is Unix */
 1876|     49|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1877|     49|	} else {
 1878|       |		/* Unknown host OS */
 1879|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1880|      0|				"Unsupported Host OS: 0x%x", (int) host_os);
 1881|       |
 1882|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1883|      0|	}
 1884|       |
 1885|  7.62k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1885:5): [True: 0, False: 7.62k]
  ------------------
 1886|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1887|       |
 1888|  7.62k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   88|  7.62k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1888:5): [True: 0, False: 7.62k]
  ------------------
 1889|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1890|      0|				"Filename is too long");
 1891|       |
 1892|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1893|      0|	}
 1894|       |
 1895|  7.62k|	if(name_size == 0) {
  ------------------
  |  Branch (1895:5): [True: 0, False: 7.62k]
  ------------------
 1896|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1897|      0|				"No filename specified");
 1898|       |
 1899|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1900|      0|	}
 1901|       |
 1902|  7.62k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1902:5): [True: 0, False: 7.62k]
  ------------------
 1903|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1904|       |
 1905|  7.62k|	memcpy(name_utf8_buf, p, name_size);
 1906|  7.62k|	name_utf8_buf[name_size] = 0;
 1907|  7.62k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  192|  7.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1907:5): [True: 0, False: 7.62k]
  ------------------
 1908|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1909|      0|	}
 1910|       |
 1911|  7.62k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 1912|       |
 1913|  7.62k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (1913:5): [True: 2.36k, False: 5.26k]
  ------------------
 1914|  2.36k|		int ret = process_head_file_extra(a, entry, rar,
 1915|  2.36k|		    extra_data_size);
 1916|       |
 1917|       |		/*
 1918|       |		 * TODO: rewrite or remove useless sanity check
 1919|       |		 *       as extra_data_size is not passed as a pointer
 1920|       |		 *
 1921|       |		if(extra_data_size < 0) {
 1922|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 1923|       |			    "File extra data size is not zero");
 1924|       |			return ARCHIVE_FATAL;
 1925|       |		}
 1926|       |		 */
 1927|       |
 1928|  2.36k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|  2.36k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1928:6): [True: 0, False: 2.36k]
  ------------------
 1929|      0|			return ret;
 1930|  2.36k|	}
 1931|       |
 1932|  7.62k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (1932:5): [True: 7.62k, False: 0]
  ------------------
 1933|  7.62k|		rar->file.unpacked_size = (ssize_t) unpacked_size;
 1934|  7.62k|		if(rar->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (1934:6): [True: 7.41k, False: 212]
  ------------------
 1935|  7.41k|			archive_entry_set_size(entry, unpacked_size);
 1936|  7.62k|	}
 1937|       |
 1938|  7.62k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1938:5): [True: 4.32k, False: 3.29k]
  ------------------
 1939|  4.32k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 1940|  4.32k|	}
 1941|       |
 1942|  7.62k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1942:5): [True: 1.26k, False: 6.36k]
  ------------------
 1943|  1.26k|		rar->file.stored_crc32 = crc;
 1944|  1.26k|	}
 1945|       |
 1946|  7.62k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (1946:5): [True: 6.23k, False: 1.38k]
  ------------------
 1947|       |		/* Do not reinitialize unpacking state if we're switching
 1948|       |		 * archives. */
 1949|  6.23k|		rar->cstate.block_parsing_finished = 1;
 1950|  6.23k|		rar->cstate.all_filters_applied = 1;
 1951|  6.23k|		rar->cstate.initialized = 0;
 1952|  6.23k|	}
 1953|       |
 1954|  7.62k|	if(rar->generic.split_before > 0) {
  ------------------
  |  Branch (1954:5): [True: 138, False: 7.49k]
  ------------------
 1955|       |		/* If now we're standing on a header that has a 'split before'
 1956|       |		 * mark, it means we're standing on a 'continuation' file
 1957|       |		 * header. Signal the caller that if it wants to move to
 1958|       |		 * another file, it must call rar5_read_header() function
 1959|       |		 * again. */
 1960|       |
 1961|    138|		return ARCHIVE_RETRY;
  ------------------
  |  |  193|    138|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 1962|  7.49k|	} else {
 1963|  7.49k|		return ARCHIVE_OK;
  ------------------
  |  |  192|  7.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1964|  7.49k|	}
 1965|  7.62k|}
archive_read_support_format_rar5.c:reset_file_context:
  858|  6.23k|static void reset_file_context(struct rar5* rar) {
  859|  6.23k|	memset(&rar->file, 0, sizeof(rar->file));
  860|  6.23k|	blake2sp_init(&rar->file.b2state, 32);
  861|       |
  862|  6.23k|	if(rar->main.solid) {
  ------------------
  |  Branch (862:5): [True: 3.32k, False: 2.91k]
  ------------------
  863|  3.32k|		rar->cstate.solid_offset += rar->cstate.write_ptr;
  864|  3.32k|	} else {
  865|  2.91k|		rar->cstate.solid_offset = 0;
  866|  2.91k|	}
  867|       |
  868|  6.23k|	rar->cstate.write_ptr = 0;
  869|  6.23k|	rar->cstate.last_write_ptr = 0;
  870|  6.23k|	rar->cstate.last_unstore_ptr = 0;
  871|       |
  872|  6.23k|	rar->file.redir_type = REDIR_TYPE_NONE;
  873|  6.23k|	rar->file.redir_flags = 0;
  874|       |
  875|  6.23k|	free_filters(rar);
  876|  6.23k|}
archive_read_support_format_rar5.c:free_filters:
  833|  6.47k|static void free_filters(struct rar5* rar) {
  834|  6.47k|	struct cdeque* d = &rar->cstate.filters;
  835|       |
  836|       |	/* Free any remaining filters. All filters should be naturally
  837|       |	 * consumed by the unpacking function, so remaining filters after
  838|       |	 * unpacking normally mean that unpacking wasn't successful.
  839|       |	 * But still of course we shouldn't leak memory in such case. */
  840|       |
  841|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  842|       |	 * expression. */
  843|  6.47k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (843:8): [True: 0, False: 6.47k]
  ------------------
  844|      0|		struct filter_info* f = NULL;
  845|       |
  846|       |		/* Pop_front will also decrease the collection's size. */
  847|      0|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (847:7): [True: 0, False: 0]
  ------------------
  848|      0|			free(f);
  849|      0|	}
  850|       |
  851|  6.47k|	cdeque_clear(d);
  852|       |
  853|       |	/* Also clear out the variables needed for sanity checking. */
  854|  6.47k|	rar->cstate.last_block_start = 0;
  855|  6.47k|	rar->cstate.last_block_length = 0;
  856|  6.47k|}
archive_read_support_format_rar5.c:cdeque_size:
  398|  6.67k|static size_t cdeque_size(struct cdeque* d) {
  399|  6.67k|	return d->size;
  400|  6.67k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  457|    200|static void** cdeque_filter_p(struct filter_info** f) {
  458|    200|	return (void**) (size_t) f;
  459|    200|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3643|  1.11k|static void clear_data_ready_stack(struct rar5* rar) {
 3644|  1.11k|	memset(&rar->cstate.dready, 0, sizeof(rar->cstate.dready));
 3645|  1.11k|}
archive_read_support_format_rar5.c:init_window_mask:
 1201|  7.79k|static void init_window_mask(struct rar5* rar) {
 1202|  7.79k|	if (rar->cstate.window_size)
  ------------------
  |  Branch (1202:6): [True: 7.79k, False: 0]
  ------------------
 1203|  7.79k|		rar->cstate.window_mask = rar->cstate.window_size - 1;
 1204|      0|	else
 1205|      0|		rar->cstate.window_mask = 0;
 1206|  7.79k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1582|  2.36k|{
 1583|  2.36k|	uint64_t extra_field_size;
 1584|  2.36k|	uint64_t extra_field_id = 0;
 1585|  2.36k|	int ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|  2.36k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1586|  2.36k|	uint64_t var_size;
 1587|       |
 1588|  7.03k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1588:8): [True: 6.77k, False: 261]
  ------------------
 1589|  6.77k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1589:6): [True: 0, False: 6.77k]
  ------------------
 1590|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1591|       |
 1592|  6.77k|		extra_data_size -= var_size;
 1593|  6.77k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  192|  6.77k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1593:6): [True: 0, False: 6.77k]
  ------------------
 1594|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1595|      0|		}
 1596|       |
 1597|  6.77k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1597:6): [True: 0, False: 6.77k]
  ------------------
 1598|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1599|       |
 1600|  6.77k|		extra_data_size -= var_size;
 1601|  6.77k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  192|  6.77k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1601:6): [True: 0, False: 6.77k]
  ------------------
 1602|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1603|      0|		}
 1604|       |
 1605|  6.77k|		switch(extra_field_id) {
 1606|      0|			case EX_HASH:
  ------------------
  |  Branch (1606:4): [True: 0, False: 6.77k]
  ------------------
 1607|      0|				ret = parse_file_extra_hash(a, rar,
 1608|      0|				    &extra_data_size);
 1609|      0|				break;
 1610|      0|			case EX_HTIME:
  ------------------
  |  Branch (1610:4): [True: 0, False: 6.77k]
  ------------------
 1611|      0|				ret = parse_file_extra_htime(a, e, rar,
 1612|      0|				    &extra_data_size);
 1613|      0|				break;
 1614|    555|			case EX_REDIR:
  ------------------
  |  Branch (1614:4): [True: 555, False: 6.22k]
  ------------------
 1615|    555|				ret = parse_file_extra_redir(a, e, rar,
 1616|    555|				    &extra_data_size);
 1617|    555|				break;
 1618|     49|			case EX_UOWNER:
  ------------------
  |  Branch (1618:4): [True: 49, False: 6.72k]
  ------------------
 1619|     49|				ret = parse_file_extra_owner(a, e,
 1620|     49|				    &extra_data_size);
 1621|     49|				break;
 1622|  4.07k|			case EX_VERSION:
  ------------------
  |  Branch (1622:4): [True: 4.07k, False: 2.70k]
  ------------------
 1623|  4.07k|				ret = parse_file_extra_version(a, e,
 1624|  4.07k|				    &extra_data_size);
 1625|  4.07k|				break;
 1626|      0|			case EX_CRYPT:
  ------------------
  |  Branch (1626:4): [True: 0, False: 6.77k]
  ------------------
 1627|       |				/* fallthrough */
 1628|      0|			case EX_SUBDATA:
  ------------------
  |  Branch (1628:4): [True: 0, False: 6.77k]
  ------------------
 1629|       |				/* fallthrough */
 1630|  2.10k|			default:
  ------------------
  |  Branch (1630:4): [True: 2.10k, False: 4.67k]
  ------------------
 1631|       |				/* Skip unsupported entry. */
 1632|  2.10k|				return consume(a, extra_data_size);
 1633|  6.77k|		}
 1634|  6.77k|	}
 1635|       |
 1636|    261|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|    261|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1636:5): [True: 0, False: 261]
  ------------------
 1637|       |		/* Attribute not implemented. */
 1638|      0|		return ret;
 1639|      0|	}
 1640|       |
 1641|    261|	return ARCHIVE_OK;
  ------------------
  |  |  192|    261|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1642|    261|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1431|    555|{
 1432|    555|	uint64_t value_size = 0;
 1433|    555|	size_t target_size = 0;
 1434|    555|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1435|    555|	const uint8_t* p;
 1436|       |
 1437|    555|	if(!read_var(a, &rar->file.redir_type, &value_size))
  ------------------
  |  Branch (1437:5): [True: 0, False: 555]
  ------------------
 1438|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1439|    555|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  192|    555|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1439:5): [True: 0, False: 555]
  ------------------
 1440|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1441|    555|	*extra_data_size -= value_size;
 1442|       |
 1443|    555|	if(!read_var(a, &rar->file.redir_flags, &value_size))
  ------------------
  |  Branch (1443:5): [True: 0, False: 555]
  ------------------
 1444|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1445|    555|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  192|    555|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1445:5): [True: 0, False: 555]
  ------------------
 1446|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1447|    555|	*extra_data_size -= value_size;
 1448|       |
 1449|    555|	if(!read_var_sized(a, &target_size, NULL))
  ------------------
  |  Branch (1449:5): [True: 0, False: 555]
  ------------------
 1450|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1451|    555|	*extra_data_size -= target_size + 1;
 1452|       |
 1453|    555|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   88|    555|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1453:5): [True: 0, False: 555]
  ------------------
 1454|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1455|      0|		    "Link target is too long");
 1456|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1457|      0|	}
 1458|       |
 1459|    555|	if(target_size == 0) {
  ------------------
  |  Branch (1459:5): [True: 131, False: 424]
  ------------------
 1460|    131|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|    131|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1461|    131|		    "No link target specified");
 1462|    131|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|    131|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1463|    131|	}
 1464|       |
 1465|    424|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1465:5): [True: 0, False: 424]
  ------------------
 1466|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1467|       |
 1468|    424|	memcpy(target_utf8_buf, p, target_size);
 1469|    424|	target_utf8_buf[target_size] = 0;
 1470|       |
 1471|    424|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  192|    424|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1471:5): [True: 0, False: 424]
  ------------------
 1472|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1473|       |
 1474|    424|	switch(rar->file.redir_type) {
 1475|      0|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1475:3): [True: 0, False: 424]
  ------------------
 1476|      0|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1476:3): [True: 0, False: 424]
  ------------------
 1477|      0|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  186|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1478|      0|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1479|      0|			if (rar->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  132|      0|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1479:8): [True: 0, False: 0]
  ------------------
 1480|      0|				archive_entry_set_symlink_type(e,
 1481|      0|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  198|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1482|      0|			} else {
 1483|      0|				archive_entry_set_symlink_type(e,
 1484|      0|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  197|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1485|      0|			}
 1486|      0|			break;
 1487|       |
 1488|      0|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1488:3): [True: 0, False: 424]
  ------------------
 1489|      0|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1490|      0|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1491|      0|			break;
 1492|       |
 1493|    424|		default:
  ------------------
  |  Branch (1493:3): [True: 424, False: 0]
  ------------------
 1494|       |			/* Unknown redir type, skip it. */
 1495|    424|			break;
 1496|    424|	}
 1497|    424|	return ARCHIVE_OK;
  ------------------
  |  |  192|    424|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1498|    424|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1502|     49|{
 1503|     49|	uint64_t flags = 0;
 1504|     49|	uint64_t value_size = 0;
 1505|     49|	uint64_t id = 0;
 1506|     49|	size_t name_len = 0;
 1507|     49|	size_t name_size = 0;
 1508|     49|	char namebuf[OWNER_MAXNAMELEN];
 1509|     49|	const uint8_t* p;
 1510|       |
 1511|     49|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1511:5): [True: 0, False: 49]
  ------------------
 1512|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1513|     49|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  192|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1513:5): [True: 0, False: 49]
  ------------------
 1514|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1515|     49|	*extra_data_size -= value_size;
 1516|       |
 1517|     49|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  143|     49|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1517:6): [True: 0, False: 49]
  ------------------
 1518|      0|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1518:6): [True: 0, False: 0]
  ------------------
 1519|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1520|      0|		*extra_data_size -= name_size + 1;
 1521|       |
 1522|      0|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1522:6): [True: 0, False: 0]
  ------------------
 1523|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1524|       |
 1525|      0|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  147|      0|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1525:7): [True: 0, False: 0]
  ------------------
 1526|      0|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  147|      0|#define	OWNER_MAXNAMELEN	256
  ------------------
 1527|      0|		} else {
 1528|      0|			name_len = name_size;
 1529|      0|		}
 1530|       |
 1531|      0|		memcpy(namebuf, p, name_len);
 1532|      0|		namebuf[name_len] = 0;
 1533|      0|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1533:6): [True: 0, False: 0]
  ------------------
 1534|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1535|       |
 1536|      0|		archive_entry_set_uname(e, namebuf);
 1537|      0|	}
 1538|     49|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  144|     49|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1538:6): [True: 0, False: 49]
  ------------------
 1539|      0|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1539:6): [True: 0, False: 0]
  ------------------
 1540|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1541|      0|		*extra_data_size -= name_size + 1;
 1542|       |
 1543|      0|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1543:6): [True: 0, False: 0]
  ------------------
 1544|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1545|       |
 1546|      0|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  147|      0|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1546:7): [True: 0, False: 0]
  ------------------
 1547|      0|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  147|      0|#define	OWNER_MAXNAMELEN	256
  ------------------
 1548|      0|		} else {
 1549|      0|			name_len = name_size;
 1550|      0|		}
 1551|       |
 1552|      0|		memcpy(namebuf, p, name_len);
 1553|      0|		namebuf[name_len] = 0;
 1554|      0|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1554:6): [True: 0, False: 0]
  ------------------
 1555|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1556|       |
 1557|      0|		archive_entry_set_gname(e, namebuf);
 1558|      0|	}
 1559|     49|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  145|     49|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1559:6): [True: 49, False: 0]
  ------------------
 1560|     49|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1560:6): [True: 0, False: 49]
  ------------------
 1561|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1562|     49|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  192|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1562:6): [True: 0, False: 49]
  ------------------
 1563|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1564|     49|		*extra_data_size -= value_size;
 1565|       |
 1566|     49|		archive_entry_set_uid(e, (la_int64_t)id);
 1567|     49|	}
 1568|     49|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  146|     49|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1568:6): [True: 0, False: 49]
  ------------------
 1569|      0|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1569:6): [True: 0, False: 0]
  ------------------
 1570|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1571|      0|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1571:6): [True: 0, False: 0]
  ------------------
 1572|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1573|      0|		*extra_data_size -= value_size;
 1574|       |
 1575|      0|		archive_entry_set_gid(e, (la_int64_t)id);
 1576|      0|	}
 1577|     49|	return ARCHIVE_OK;
  ------------------
  |  |  192|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1578|     49|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1324|  4.07k|{
 1325|  4.07k|	size_t flags = 0;
 1326|  4.07k|	size_t version = 0;
 1327|  4.07k|	size_t value_len = 0;
 1328|  4.07k|	struct archive_string version_string;
 1329|  4.07k|	struct archive_string name_utf8_string;
 1330|  4.07k|	const char* cur_filename;
 1331|       |
 1332|       |	/* Flags are ignored. */
 1333|  4.07k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1333:5): [True: 0, False: 4.07k]
  ------------------
 1334|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1335|       |
 1336|  4.07k|	*extra_data_size -= value_len;
 1337|  4.07k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  192|  4.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1337:5): [True: 0, False: 4.07k]
  ------------------
 1338|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1339|       |
 1340|  4.07k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  Branch (1340:5): [True: 0, False: 4.07k]
  ------------------
 1341|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1342|       |
 1343|  4.07k|	*extra_data_size -= value_len;
 1344|  4.07k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  192|  4.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1344:5): [True: 0, False: 4.07k]
  ------------------
 1345|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1346|       |
 1347|       |	/* extra_data_size should be zero here. */
 1348|       |
 1349|  4.07k|	cur_filename = archive_entry_pathname_utf8(e);
 1350|  4.07k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1350:5): [True: 0, False: 4.07k]
  ------------------
 1351|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1352|      0|		    "Version entry without file name");
 1353|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1354|      0|	}
 1355|       |
 1356|  4.07k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  4.07k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1357|  4.07k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  4.07k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1358|       |
 1359|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1360|       |	 * value of this file. */
 1361|  4.07k|	archive_string_sprintf(&version_string, ";%zu", version);
 1362|       |
 1363|       |	/* Build the new filename. */
 1364|  4.07k|	archive_strcat(&name_utf8_string, cur_filename);
 1365|  4.07k|	archive_strcat(&name_utf8_string, version_string.s);
 1366|       |
 1367|       |	/* Apply the new filename into this file's context. */
 1368|  4.07k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1369|       |
 1370|       |	/* Free buffers. */
 1371|  4.07k|	archive_string_free(&version_string);
 1372|  4.07k|	archive_string_free(&name_utf8_string);
 1373|  4.07k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  4.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1374|  4.07k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3244|  5.57k|static int scan_for_signature(struct archive_read* a) {
 3245|  5.57k|	const uint8_t* p;
 3246|  5.57k|	const int chunk_size = 512;
 3247|  5.57k|	ssize_t i;
 3248|  5.57k|	char signature[sizeof(rar5_signature_xor)];
 3249|       |
 3250|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3251|       |	 * There's no indication what kind of data we're reading here.
 3252|       |	 * It could be some text comment, any kind of binary data,
 3253|       |	 * digital sign, dragons, etc.
 3254|       |	 *
 3255|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3256|       |	 * data. */
 3257|       |
 3258|       |	/* Is it possible in libarchive to just skip everything until the
 3259|       |	 * end of the file? If so, it would be a better approach than the
 3260|       |	 * current implementation of this function. */
 3261|       |
 3262|  5.57k|	rar5_signature(signature);
 3263|       |
 3264|  16.8k|	while(1) {
  ------------------
  |  Branch (3264:8): [Folded - Ignored]
  ------------------
 3265|  16.8k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3265:6): [True: 24, False: 16.8k]
  ------------------
 3266|     24|			return ARCHIVE_EOF;
  ------------------
  |  |  191|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3267|       |
 3268|  6.68M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3268:14): [True: 6.67M, False: 11.2k]
  ------------------
 3269|  6.67M|		    i++) {
 3270|  6.67M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3270:7): [True: 5.55k, False: 6.67M]
  ------------------
 3271|  6.67M|			    sizeof(rar5_signature_xor)) == 0) {
 3272|       |				/* Consume the number of bytes we've used to
 3273|       |				 * search for the signature, as well as the
 3274|       |				 * number of bytes used by the signature
 3275|       |				 * itself. After this we should be standing
 3276|       |				 * on a valid base block header. */
 3277|  5.55k|				(void) consume(a,
 3278|  5.55k|				    i + sizeof(rar5_signature_xor));
 3279|  5.55k|				return ARCHIVE_OK;
  ------------------
  |  |  192|  5.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3280|  5.55k|			}
 3281|  6.67M|		}
 3282|       |
 3283|  11.2k|		consume(a, chunk_size);
 3284|  11.2k|	}
 3285|       |
 3286|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3287|  5.57k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4082|  11.3k|    size_t *size, int64_t *offset) {
 4083|  11.3k|	int ret;
 4084|  11.3k|	struct rar5* rar = get_context(a);
 4085|       |
 4086|  11.3k|	if (size)
  ------------------
  |  Branch (4086:6): [True: 9.77k, False: 1.58k]
  ------------------
 4087|  9.77k|		*size = 0;
 4088|       |
 4089|  11.3k|	if(rar->file.dir > 0) {
  ------------------
  |  Branch (4089:5): [True: 0, False: 11.3k]
  ------------------
 4090|       |		/* Don't process any data if this file entry was declared
 4091|       |		 * as a directory. This is needed, because entries marked as
 4092|       |		 * directory doesn't have any dictionary buffer allocated, so
 4093|       |		 * it's impossible to perform any decompression. */
 4094|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4095|      0|		    "Can't decompress an entry marked as a directory");
 4096|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4097|      0|	}
 4098|       |
 4099|  11.3k|	if(!rar->skip_mode && (rar->cstate.last_write_ptr > rar->file.unpacked_size)) {
  ------------------
  |  Branch (4099:5): [True: 9.77k, False: 1.58k]
  |  Branch (4099:24): [True: 0, False: 9.77k]
  ------------------
 4100|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4101|      0|		    "Unpacker has written too many bytes");
 4102|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4103|      0|	}
 4104|       |
 4105|  11.3k|	ret = use_data(rar, buff, size, offset);
 4106|  11.3k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  192|  11.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4106:5): [True: 56, False: 11.3k]
  ------------------
 4107|     56|		return ret;
 4108|     56|	}
 4109|       |
 4110|  11.3k|	if(rar->file.eof == 1) {
  ------------------
  |  Branch (4110:5): [True: 0, False: 11.3k]
  ------------------
 4111|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4112|      0|	}
 4113|       |
 4114|  11.3k|	ret = do_unpack(a, rar, buff, size, offset);
 4115|  11.3k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  11.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4115:5): [True: 7.12k, False: 4.18k]
  ------------------
 4116|  7.12k|		return ret;
 4117|  7.12k|	}
 4118|       |
 4119|  4.18k|	if(rar->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4119:5): [True: 3.97k, False: 210]
  ------------------
 4120|  4.18k|			rar->cstate.last_write_ptr == rar->file.unpacked_size)
  ------------------
  |  Branch (4120:4): [True: 0, False: 3.97k]
  ------------------
 4121|      0|	{
 4122|       |		/* If all bytes of current file were processed, run
 4123|       |		 * finalization.
 4124|       |		 *
 4125|       |		 * Finalization will check checksum against proper values. If
 4126|       |		 * some of the checksums will not match, we'll return an error
 4127|       |		 * value in the last `archive_read_data` call to signal an error
 4128|       |		 * to the user. */
 4129|       |
 4130|      0|		rar->file.eof = 1;
 4131|      0|		return verify_global_checksums(a);
 4132|      0|	}
 4133|       |
 4134|  4.18k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  4.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4135|  4.18k|}
archive_read_support_format_rar5.c:use_data:
 3624|  11.3k|{
 3625|  11.3k|	int i;
 3626|       |
 3627|  33.9k|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   62|  33.9k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3627:13): [True: 22.6k, False: 11.3k]
  ------------------
 3628|  22.6k|		struct data_ready *d = &rar->cstate.dready[i];
 3629|       |
 3630|  22.6k|		if(d->used) {
  ------------------
  |  Branch (3630:6): [True: 56, False: 22.6k]
  ------------------
 3631|     56|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3631:7): [True: 56, False: 0]
  ------------------
 3632|     56|			if(size)   *size = d->size;
  ------------------
  |  Branch (3632:7): [True: 56, False: 0]
  ------------------
 3633|     56|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3633:7): [True: 56, False: 0]
  ------------------
 3634|       |
 3635|     56|			d->used = 0;
 3636|     56|			return ARCHIVE_OK;
  ------------------
  |  |  192|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3637|     56|		}
 3638|  22.6k|	}
 3639|       |
 3640|  11.3k|	return ARCHIVE_RETRY;
  ------------------
  |  |  193|  11.3k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3641|  11.3k|}
archive_read_support_format_rar5.c:do_unpack:
 3921|  11.3k|{
 3922|  11.3k|	enum COMPRESSION_METHOD {
 3923|  11.3k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 3924|  11.3k|		BEST = 5
 3925|  11.3k|	};
 3926|       |
 3927|  11.3k|	if(rar->file.service > 0) {
  ------------------
  |  Branch (3927:5): [True: 473, False: 10.8k]
  ------------------
 3928|    473|		return do_unstore_file(a, rar, buf, size, offset);
 3929|  10.8k|	} else {
 3930|  10.8k|		switch(rar->cstate.method) {
 3931|  8.67k|			case STORE:
  ------------------
  |  Branch (3931:4): [True: 8.67k, False: 2.15k]
  ------------------
 3932|  8.67k|				return do_unstore_file(a, rar, buf, size,
 3933|  8.67k|				    offset);
 3934|    391|			case FASTEST:
  ------------------
  |  Branch (3934:4): [True: 391, False: 10.4k]
  ------------------
 3935|       |				/* fallthrough */
 3936|  2.15k|			case FAST:
  ------------------
  |  Branch (3936:4): [True: 1.76k, False: 9.06k]
  ------------------
 3937|       |				/* fallthrough */
 3938|  2.15k|			case NORMAL:
  ------------------
  |  Branch (3938:4): [True: 0, False: 10.8k]
  ------------------
 3939|       |				/* fallthrough */
 3940|  2.15k|			case GOOD:
  ------------------
  |  Branch (3940:4): [True: 0, False: 10.8k]
  ------------------
 3941|       |				/* fallthrough */
 3942|  2.15k|			case BEST:
  ------------------
  |  Branch (3942:4): [True: 0, False: 10.8k]
  ------------------
 3943|       |				/* No data is returned here. But because a sparse-file aware
 3944|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 3945|       |				 * as a sparse file block, we need to update the offset
 3946|       |				 * accordingly. At this point the decoder doesn't have any
 3947|       |				 * pending uncompressed data blocks, so the current position in
 3948|       |				 * the output file should be last_write_ptr. */
 3949|  2.15k|				if (offset) *offset = rar->cstate.last_write_ptr;
  ------------------
  |  Branch (3949:9): [True: 1.90k, False: 253]
  ------------------
 3950|  2.15k|				return uncompress_file(a);
 3951|      0|			default:
  ------------------
  |  Branch (3951:4): [True: 0, False: 10.8k]
  ------------------
 3952|      0|				archive_set_error(&a->archive,
 3953|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3954|      0|				    "Compression method not supported: 0x%x",
 3955|      0|				    rar->cstate.method);
 3956|       |
 3957|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3958|  10.8k|		}
 3959|  10.8k|	}
 3960|       |
 3961|      0|#if !defined WIN32
 3962|       |	/* Not reached. */
 3963|      0|	return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3964|  11.3k|#endif
 3965|  11.3k|}
archive_read_support_format_rar5.c:do_unstore_file:
 3873|  9.14k|{
 3874|  9.14k|	size_t to_read;
 3875|  9.14k|	const uint8_t* p;
 3876|       |
 3877|  9.14k|	if(rar->file.bytes_remaining == 0 && rar->main.volume > 0 &&
  ------------------
  |  Branch (3877:5): [True: 5.21k, False: 3.93k]
  |  Branch (3877:39): [True: 5.21k, False: 0]
  ------------------
 3878|  9.14k|	    rar->generic.split_after > 0)
  ------------------
  |  Branch (3878:6): [True: 2.92k, False: 2.29k]
  ------------------
 3879|  2.92k|	{
 3880|  2.92k|		int ret;
 3881|       |
 3882|  2.92k|		rar->cstate.switch_multivolume = 1;
 3883|  2.92k|		ret = advance_multivolume(a);
 3884|  2.92k|		rar->cstate.switch_multivolume = 0;
 3885|       |
 3886|  2.92k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  2.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3886:6): [True: 2.87k, False: 50]
  ------------------
 3887|       |			/* Failed to advance to next multivolume archive
 3888|       |			 * file. */
 3889|  2.87k|			return ret;
 3890|  2.87k|		}
 3891|  2.92k|	}
 3892|       |
 3893|  6.27k|	to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   60|  6.27k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 12, False: 6.26k]
  |  |  ------------------
  ------------------
 3894|  6.27k|	if(to_read == 0) {
  ------------------
  |  Branch (3894:5): [True: 2.29k, False: 3.98k]
  ------------------
 3895|  2.29k|		return ARCHIVE_EOF;
  ------------------
  |  |  191|  2.29k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3896|  2.29k|	}
 3897|       |
 3898|  3.98k|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (3898:5): [True: 2, False: 3.98k]
  ------------------
 3899|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3900|      2|		    "I/O error when unstoring file");
 3901|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3902|      2|	}
 3903|       |
 3904|  3.98k|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  192|  3.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3904:5): [True: 0, False: 3.98k]
  ------------------
 3905|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3906|      0|	}
 3907|       |
 3908|  3.98k|	if(buf)    *buf = p;
  ------------------
  |  Branch (3908:5): [True: 2.64k, False: 1.33k]
  ------------------
 3909|  3.98k|	if(size)   *size = to_read;
  ------------------
  |  Branch (3909:5): [True: 2.64k, False: 1.33k]
  ------------------
 3910|  3.98k|	if(offset) *offset = rar->cstate.last_unstore_ptr;
  ------------------
  |  Branch (3910:5): [True: 2.64k, False: 1.33k]
  ------------------
 3911|       |
 3912|  3.98k|	rar->file.bytes_remaining -= to_read;
 3913|  3.98k|	rar->cstate.last_unstore_ptr += to_read;
 3914|       |
 3915|  3.98k|	update_crc(rar, p, to_read);
 3916|  3.98k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  3.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3917|  3.98k|}
archive_read_support_format_rar5.c:advance_multivolume:
 3291|  4.92k|static int advance_multivolume(struct archive_read* a) {
 3292|  4.92k|	int lret;
 3293|  4.92k|	struct rar5* rar = get_context(a);
 3294|       |
 3295|       |	/* A small state machine that will skip unnecessary data, needed to
 3296|       |	 * switch from one multivolume to another. Such skipping is needed if
 3297|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3298|       |	 * unpacker.
 3299|       |	 *
 3300|       |	 * The state machine starts with `rar->main.endarc` == 0. It also
 3301|       |	 * assumes that current stream pointer points to some base block
 3302|       |	 * header.
 3303|       |	 *
 3304|       |	 * The `endarc` field is being set when the base block parsing
 3305|       |	 * function encounters the 'end of archive' marker.
 3306|       |	 */
 3307|       |
 3308|  11.3k|	while(1) {
  ------------------
  |  Branch (3308:8): [Folded - Ignored]
  ------------------
 3309|  11.3k|		if(rar->main.endarc == 1) {
  ------------------
  |  Branch (3309:6): [True: 3.97k, False: 7.39k]
  ------------------
 3310|  3.97k|			int looping = 1;
 3311|       |
 3312|  3.97k|			rar->main.endarc = 0;
 3313|       |
 3314|  8.49k|			while(looping) {
  ------------------
  |  Branch (3314:10): [True: 8.32k, False: 168]
  ------------------
 3315|  8.32k|				lret = skip_base_block(a);
 3316|  8.32k|				switch(lret) {
 3317|  4.35k|					case ARCHIVE_RETRY:
  ------------------
  |  |  193|  4.35k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3317:6): [True: 4.35k, False: 3.97k]
  ------------------
 3318|       |						/* Continue looping. */
 3319|  4.35k|						break;
 3320|    168|					case ARCHIVE_OK:
  ------------------
  |  |  192|    168|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3320:6): [True: 168, False: 8.15k]
  ------------------
 3321|       |						/* Break loop. */
 3322|    168|						looping = 0;
 3323|    168|						break;
 3324|  3.80k|					default:
  ------------------
  |  Branch (3324:6): [True: 3.80k, False: 4.51k]
  ------------------
 3325|       |						/* Forward any errors to the
 3326|       |						 * caller. */
 3327|  3.80k|						return lret;
 3328|  8.32k|				}
 3329|  8.32k|			}
 3330|       |
 3331|    168|			break;
 3332|  7.39k|		} else {
 3333|       |			/* Skip current base block. In order to properly skip
 3334|       |			 * it, we really need to simply parse it and discard
 3335|       |			 * the results. */
 3336|       |
 3337|  7.39k|			lret = skip_base_block(a);
 3338|  7.39k|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  198|  14.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  196|  7.39k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3338:7): [True: 3, False: 7.39k]
  |  Branch (3338:32): [True: 0, False: 7.39k]
  ------------------
 3339|      3|				return lret;
 3340|       |
 3341|       |			/* The `skip_base_block` function tells us if we
 3342|       |			 * should continue with skipping, or we should stop
 3343|       |			 * skipping. We're trying to skip everything up to
 3344|       |			 * a base FILE block. */
 3345|       |
 3346|  7.39k|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  193|  7.39k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3346:7): [True: 953, False: 6.43k]
  ------------------
 3347|       |				/* If there was an error during skipping, or we
 3348|       |				 * have just skipped a FILE base block... */
 3349|       |
 3350|    953|				if(rar->main.endarc == 0) {
  ------------------
  |  Branch (3350:8): [True: 951, False: 2]
  ------------------
 3351|    951|					return lret;
 3352|    951|				} else {
 3353|      2|					continue;
 3354|      2|				}
 3355|    953|			}
 3356|  7.39k|		}
 3357|  11.3k|	}
 3358|       |
 3359|    168|	return ARCHIVE_OK;
  ------------------
  |  |  192|    168|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3360|  4.92k|}
archive_read_support_format_rar5.c:skip_base_block:
 2343|  15.7k|static int skip_base_block(struct archive_read* a) {
 2344|  15.7k|	int ret;
 2345|  15.7k|	struct rar5* rar = get_context(a);
 2346|       |
 2347|       |	/* Create a new local archive_entry structure that will be operated on
 2348|       |	 * by header reader; operations on this archive_entry will be discarded.
 2349|       |	 */
 2350|  15.7k|	struct archive_entry* entry = archive_entry_new();
 2351|  15.7k|	ret = process_base_block(a, entry);
 2352|       |
 2353|       |	/* Discard operations on this archive_entry structure. */
 2354|  15.7k|	archive_entry_free(entry);
 2355|  15.7k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  198|  15.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2355:5): [True: 8, False: 15.7k]
  ------------------
 2356|      8|		return ret;
 2357|       |
 2358|  15.7k|	if(rar->generic.last_header_id == 2 && rar->generic.split_before > 0)
  ------------------
  |  Branch (2358:5): [True: 2.97k, False: 12.7k]
  |  Branch (2358:41): [True: 168, False: 2.80k]
  ------------------
 2359|    168|		return ARCHIVE_OK;
  ------------------
  |  |  192|    168|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2360|       |
 2361|  15.5k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  192|  15.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2361:5): [True: 7.78k, False: 7.75k]
  ------------------
 2362|  7.78k|		return ARCHIVE_RETRY;
  ------------------
  |  |  193|  7.78k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2363|  7.75k|	else
 2364|  7.75k|		return ret;
 2365|  15.5k|}
archive_read_support_format_rar5.c:update_crc:
 2479|  4.03k|static void update_crc(struct rar5* rar, const uint8_t* p, size_t to_read) {
 2480|  4.03k|    int verify_crc;
 2481|       |
 2482|  4.03k|	if(rar->skip_mode) {
  ------------------
  |  Branch (2482:5): [True: 1.33k, False: 2.70k]
  ------------------
 2483|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2484|       |		verify_crc = 1;
 2485|       |#else
 2486|  1.33k|		verify_crc = 0;
 2487|  1.33k|#endif
 2488|  1.33k|	} else
 2489|  2.70k|		verify_crc = 1;
 2490|       |
 2491|  4.03k|	if(verify_crc) {
  ------------------
  |  Branch (2491:5): [True: 2.70k, False: 1.33k]
  ------------------
 2492|       |		/* Don't update CRC32 if the file doesn't have the
 2493|       |		 * `stored_crc32` info filled in. */
 2494|  2.70k|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2494:6): [True: 47, False: 2.65k]
  ------------------
 2495|     47|			rar->file.calculated_crc32 =
 2496|     47|				crc32(rar->file.calculated_crc32, p, (unsigned int)to_read);
 2497|     47|		}
 2498|       |
 2499|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2500|       |		 * algorithm. */
 2501|  2.70k|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (2501:6): [True: 0, False: 2.70k]
  ------------------
 2502|       |			/* Return value of the `update` function is always 0,
 2503|       |			 * so we can explicitly ignore it here. */
 2504|      0|			(void) blake2sp_update(&rar->file.b2state, p, to_read);
 2505|      0|		}
 2506|  2.70k|	}
 2507|  4.03k|}
archive_read_support_format_rar5.c:uncompress_file:
 3857|  2.15k|static int uncompress_file(struct archive_read* a) {
 3858|  2.15k|	int ret;
 3859|       |
 3860|  2.15k|	while(1) {
  ------------------
  |  Branch (3860:8): [Folded - Ignored]
  ------------------
 3861|       |		/* Sometimes the uncompression function will return a
 3862|       |		 * 'retry' signal. If this will happen, we have to retry
 3863|       |		 * the function. */
 3864|  2.15k|		ret = do_uncompress_file(a);
 3865|  2.15k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  193|  2.15k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3865:6): [True: 2.15k, False: 0]
  ------------------
 3866|  2.15k|			return ret;
 3867|  2.15k|	}
 3868|  2.15k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3743|  2.15k|static int do_uncompress_file(struct archive_read* a) {
 3744|  2.15k|	struct rar5* rar = get_context(a);
 3745|  2.15k|	int ret;
 3746|  2.15k|	int64_t max_end_pos;
 3747|       |
 3748|  2.15k|	if(!rar->cstate.initialized) {
  ------------------
  |  Branch (3748:5): [True: 1.84k, False: 314]
  ------------------
 3749|       |		/* Don't perform full context reinitialization if we're
 3750|       |		 * processing a solid archive. */
 3751|  1.84k|		if(!rar->main.solid || !rar->cstate.window_buf) {
  ------------------
  |  Branch (3751:6): [True: 149, False: 1.69k]
  |  Branch (3751:26): [True: 14, False: 1.68k]
  ------------------
 3752|    163|			init_unpack(rar);
 3753|    163|		}
 3754|       |
 3755|  1.84k|		rar->cstate.initialized = 1;
 3756|  1.84k|	}
 3757|       |
 3758|       |	/* Don't allow extraction if window_size is invalid. */
 3759|  2.15k|	if(rar->cstate.window_size == 0) {
  ------------------
  |  Branch (3759:5): [True: 0, False: 2.15k]
  ------------------
 3760|      0|		archive_set_error(&a->archive,
 3761|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3762|      0|			"Invalid window size declaration in this file");
 3763|       |
 3764|       |		/* This should never happen in valid files. */
 3765|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3766|      0|	}
 3767|       |
 3768|  2.15k|	if(rar->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (3768:5): [True: 2.15k, False: 0]
  ------------------
 3769|       |		/* We use while(1) here, but standard case allows for just 1
 3770|       |		 * iteration. The loop will iterate if process_block() didn't
 3771|       |		 * generate any data at all. This can happen if the block
 3772|       |		 * contains only filter definitions (this is common in big
 3773|       |		 * files). */
 3774|  7.04k|		while(1) {
  ------------------
  |  Branch (3774:9): [Folded - Ignored]
  ------------------
 3775|  7.04k|			ret = process_block(a);
 3776|  7.04k|			if(ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  191|  14.0k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              			if(ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  198|  5.12k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3776:7): [True: 1.92k, False: 5.12k]
  |  Branch (3776:29): [True: 5, False: 5.11k]
  ------------------
 3777|  1.92k|				return ret;
 3778|       |
 3779|  5.11k|			if(rar->cstate.last_write_ptr ==
  ------------------
  |  Branch (3779:7): [True: 4.91k, False: 200]
  ------------------
 3780|  5.11k|			    rar->cstate.write_ptr) {
 3781|       |				/* The block didn't generate any new data,
 3782|       |				 * so just process a new block if this one
 3783|       |				 * wasn't the last block in the file. */
 3784|  4.91k|				if (bf_is_last_block(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3784:9): [True: 33, False: 4.88k]
  ------------------
 3785|     33|					return ARCHIVE_EOF;
  ------------------
  |  |  191|     33|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3786|     33|				}
 3787|       |
 3788|  4.88k|				continue;
 3789|  4.91k|			}
 3790|       |
 3791|       |			/* The block has generated some new data, so break
 3792|       |			 * the loop. */
 3793|    200|			break;
 3794|  5.11k|		}
 3795|  2.15k|	}
 3796|       |
 3797|       |	/* Try to run filters. If filters won't be applied, it means that
 3798|       |	 * insufficient data was generated. */
 3799|    200|	ret = apply_filters(a);
 3800|    200|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  193|    200|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3800:5): [True: 0, False: 200]
  ------------------
 3801|      0|		return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3802|    200|	} else if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  198|    200|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3802:12): [True: 0, False: 200]
  ------------------
 3803|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3804|      0|	}
 3805|       |
 3806|       |	/* If apply_filters() will return ARCHIVE_OK, we can continue here. */
 3807|       |
 3808|    200|	if(cdeque_size(&rar->cstate.filters) > 0) {
  ------------------
  |  Branch (3808:5): [True: 0, False: 200]
  ------------------
 3809|       |		/* Check if we can write something before hitting first
 3810|       |		 * filter. */
 3811|      0|		struct filter_info* flt;
 3812|       |
 3813|       |		/* Get the block_start offset from the first filter. */
 3814|      0|		if(CDE_OK != cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (3814:6): [True: 0, False: 0]
  ------------------
 3815|      0|		    cdeque_filter_p(&flt)))
 3816|      0|		{
 3817|      0|			archive_set_error(&a->archive,
 3818|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3819|      0|			    "Can't read first filter");
 3820|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3821|      0|		}
 3822|       |
 3823|      0|		max_end_pos = rar5_min(flt->block_start,
  ------------------
  |  |   60|      0|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3824|      0|		    rar->cstate.write_ptr);
 3825|    200|	} else {
 3826|       |		/* There are no filters defined, or all filters were applied.
 3827|       |		 * This means we can just store the data without any
 3828|       |		 * postprocessing. */
 3829|    200|		max_end_pos = rar->cstate.write_ptr;
 3830|    200|	}
 3831|       |
 3832|    200|	if(max_end_pos == rar->cstate.last_write_ptr) {
  ------------------
  |  Branch (3832:5): [True: 0, False: 200]
  ------------------
 3833|       |		/* We can't write anything yet. The block uncompression
 3834|       |		 * function did not generate enough data, and no filter can be
 3835|       |		 * applied. At the same time we don't have any data that can be
 3836|       |		 *  stored without filter postprocessing. This means we need to
 3837|       |		 *  wait for more data to be generated, so we can apply the
 3838|       |		 * filters.
 3839|       |		 *
 3840|       |		 * Signal the caller that we need more data to be able to do
 3841|       |		 * anything.
 3842|       |		 */
 3843|      0|		return ARCHIVE_RETRY;
  ------------------
  |  |  193|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3844|    200|	} else {
 3845|       |		/* We can write the data before hitting the first filter.
 3846|       |		 * So let's do it. The push_window_data() function will
 3847|       |		 * effectively return the selected data block to the user
 3848|       |		 * application. */
 3849|    200|		push_window_data(a, rar, rar->cstate.last_write_ptr,
 3850|    200|		    max_end_pos);
 3851|    200|		rar->cstate.last_write_ptr = max_end_pos;
 3852|    200|	}
 3853|       |
 3854|    200|	return ARCHIVE_OK;
  ------------------
  |  |  192|    200|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3855|    200|}
archive_read_support_format_rar5.c:init_unpack:
 2452|    163|static void init_unpack(struct rar5* rar) {
 2453|    163|	rar->file.calculated_crc32 = 0;
 2454|    163|	init_window_mask(rar);
 2455|       |
 2456|    163|	free(rar->cstate.window_buf);
 2457|    163|	free(rar->cstate.filtered_buf);
 2458|       |
 2459|    163|	if(rar->cstate.window_size > 0) {
  ------------------
  |  Branch (2459:5): [True: 163, False: 0]
  ------------------
 2460|    163|		rar->cstate.window_buf = calloc(1, rar->cstate.window_size);
 2461|    163|		rar->cstate.filtered_buf = calloc(1, rar->cstate.window_size);
 2462|    163|	} else {
 2463|      0|		rar->cstate.window_buf = NULL;
 2464|      0|		rar->cstate.filtered_buf = NULL;
 2465|      0|	}
 2466|       |
 2467|    163|	clear_data_ready_stack(rar);
 2468|       |
 2469|    163|	rar->cstate.write_ptr = 0;
 2470|    163|	rar->cstate.last_write_ptr = 0;
 2471|       |
 2472|    163|	memset(&rar->cstate.bd, 0, sizeof(rar->cstate.bd));
 2473|    163|	memset(&rar->cstate.ld, 0, sizeof(rar->cstate.ld));
 2474|    163|	memset(&rar->cstate.dd, 0, sizeof(rar->cstate.dd));
 2475|    163|	memset(&rar->cstate.ldd, 0, sizeof(rar->cstate.ldd));
 2476|    163|	memset(&rar->cstate.rd, 0, sizeof(rar->cstate.rd));
 2477|    163|}
archive_read_support_format_rar5.c:process_block:
 3473|  7.04k|static int process_block(struct archive_read* a) {
 3474|  7.04k|	const uint8_t* p;
 3475|  7.04k|	struct rar5* rar = get_context(a);
 3476|  7.04k|	int ret;
 3477|       |
 3478|       |	/* If we don't have any data to be processed, this most probably means
 3479|       |	 * we need to switch to the next volume. */
 3480|  7.04k|	if(rar->main.volume && rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3480:5): [True: 2.65k, False: 4.38k]
  |  Branch (3480:25): [True: 1.79k, False: 857]
  ------------------
 3481|  1.79k|		ret = advance_multivolume(a);
 3482|  1.79k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|  1.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3482:6): [True: 1.68k, False: 118]
  ------------------
 3483|  1.68k|			return ret;
 3484|  1.79k|	}
 3485|       |
 3486|  5.36k|	if(rar->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3486:5): [True: 5.36k, False: 1]
  ------------------
 3487|  5.36k|		ssize_t block_size;
 3488|  5.36k|		ssize_t to_skip;
 3489|  5.36k|		ssize_t cur_block_size;
 3490|       |
 3491|       |		/* The header size won't be bigger than 6 bytes. */
 3492|  5.36k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3492:6): [True: 32, False: 5.32k]
  ------------------
 3493|       |			/* Failed to prefetch data block header. */
 3494|     32|			return ARCHIVE_EOF;
  ------------------
  |  |  191|     32|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3495|     32|		}
 3496|       |
 3497|       |		/*
 3498|       |		 * Read block_size by parsing block header. Validate the header
 3499|       |		 * by calculating CRC byte stored inside the header. Size of
 3500|       |		 * the header is not constant (block size can be stored either
 3501|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3502|       |		 * `compressed_block_header` structure and returned by
 3503|       |		 * `parse_block_header` as the second argument. */
 3504|       |
 3505|  5.32k|		ret = parse_block_header(a, p, &block_size,
 3506|  5.32k|		    &rar->last_block_hdr);
 3507|  5.32k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  5.32k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3507:6): [True: 1, False: 5.32k]
  ------------------
 3508|      1|			return ret;
 3509|      1|		}
 3510|       |
 3511|       |		/* Skip block header. Next data is huffman tables,
 3512|       |		 * if present. */
 3513|  5.32k|		to_skip = sizeof(struct compressed_block_header) +
 3514|  5.32k|			bf_byte_count(&rar->last_block_hdr) + 1;
 3515|       |
 3516|  5.32k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  192|  5.32k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3516:6): [True: 0, False: 5.32k]
  ------------------
 3517|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3518|       |
 3519|  5.32k|		rar->file.bytes_remaining -= to_skip;
 3520|       |
 3521|       |		/* The block size gives information about the whole block size,
 3522|       |		 * but the block could be stored in split form when using
 3523|       |		 * multi-volume archives. In this case, the block size will be
 3524|       |		 * bigger than the actual data stored in this file. Remaining
 3525|       |		 * part of the data will be in another file. */
 3526|       |
 3527|  5.32k|		cur_block_size =
 3528|  5.32k|			rar5_min(rar->file.bytes_remaining, block_size);
  ------------------
  |  |   60|  5.32k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 5.00k, False: 323]
  |  |  ------------------
  ------------------
 3529|       |
 3530|  5.32k|		if(block_size > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3530:6): [True: 208, False: 5.12k]
  ------------------
 3531|       |			/* If current blocks' size is bigger than our data
 3532|       |			 * size, this means we have a multivolume archive.
 3533|       |			 * In this case, skip all base headers until the end
 3534|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3535|       |			 * find its signature, skip all headers up to the first
 3536|       |			 * FILE base header, and continue from there.
 3537|       |			 *
 3538|       |			 * Note that `merge_block` will update the `rar`
 3539|       |			 * context structure quite extensively. */
 3540|       |
 3541|    208|			ret = merge_block(a, block_size, &p);
 3542|    208|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|    208|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3542:7): [True: 208, False: 0]
  ------------------
 3543|    208|				return ret;
 3544|    208|			}
 3545|       |
 3546|      0|			cur_block_size = block_size;
 3547|       |
 3548|       |			/* Current stream pointer should be now directly
 3549|       |			 * *after* the block that spanned through multiple
 3550|       |			 * archive files. `p` pointer should have the data of
 3551|       |			 * the *whole* block (merged from partial blocks
 3552|       |			 * stored in multiple archives files). */
 3553|  5.12k|		} else {
 3554|  5.12k|			rar->cstate.switch_multivolume = 0;
 3555|       |
 3556|       |			/* Read the whole block size into memory. This can take
 3557|       |			 * up to  8 megabytes of memory in theoretical cases.
 3558|       |			 * Might be worth to optimize this and use a standard
 3559|       |			 * chunk of 4kb's. */
 3560|  5.12k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3560:7): [True: 2, False: 5.11k]
  ------------------
 3561|       |				/* Failed to prefetch block data. */
 3562|      2|				return ARCHIVE_EOF;
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3563|      2|			}
 3564|  5.12k|		}
 3565|       |
 3566|  5.11k|		rar->cstate.block_buf = p;
 3567|  5.11k|		rar->cstate.cur_block_size = cur_block_size;
 3568|  5.11k|		rar->cstate.block_parsing_finished = 0;
 3569|       |
 3570|  5.11k|		rar->bits.in_addr = 0;
 3571|  5.11k|		rar->bits.bit_addr = 0;
 3572|       |
 3573|  5.11k|		if(bf_is_table_present(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3573:6): [True: 31, False: 5.08k]
  ------------------
 3574|       |			/* Load Huffman tables. */
 3575|     31|			ret = parse_tables(a, rar, p);
 3576|     31|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3576:7): [True: 0, False: 31]
  ------------------
 3577|       |				/* Error during decompression of Huffman
 3578|       |				 * tables. */
 3579|      0|				return ret;
 3580|      0|			}
 3581|     31|		}
 3582|  5.11k|	} else {
 3583|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3584|      1|		p = rar->cstate.block_buf;
 3585|      1|	}
 3586|       |
 3587|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3588|       |	 * will be generated by uncompressing the block.
 3589|       |	 *
 3590|       |	 * In case too many bytes will be generated, calling this function
 3591|       |	 * again will resume the uncompression operation. */
 3592|  5.11k|	ret = do_uncompress_block(a, p);
 3593|  5.11k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  5.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3593:5): [True: 1, False: 5.11k]
  ------------------
 3594|      1|		return ret;
 3595|      1|	}
 3596|       |
 3597|  5.11k|	if(rar->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3597:5): [True: 5.11k, False: 1]
  ------------------
 3598|  5.11k|	    rar->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3598:6): [True: 5.11k, False: 0]
  ------------------
 3599|  5.11k|	    rar->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3599:6): [True: 199, False: 4.91k]
  ------------------
 3600|    199|	{
 3601|       |		/* If we're processing a normal block, consume the whole
 3602|       |		 * block. We can do this because we've already read the whole
 3603|       |		 * block to memory. */
 3604|    199|		if(ARCHIVE_OK != consume(a, rar->cstate.cur_block_size))
  ------------------
  |  |  192|    199|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3604:6): [True: 0, False: 199]
  ------------------
 3605|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3606|       |
 3607|    199|		rar->file.bytes_remaining -= rar->cstate.cur_block_size;
 3608|  4.91k|	} else if(rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (3608:12): [True: 0, False: 4.91k]
  ------------------
 3609|       |		/* Don't consume the block if we're doing multivolume
 3610|       |		 * processing. The volume switching function will consume
 3611|       |		 * the proper count of bytes instead. */
 3612|      0|		rar->cstate.switch_multivolume = 0;
 3613|      0|	}
 3614|       |
 3615|  5.11k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  5.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3616|  5.11k|}
archive_read_support_format_rar5.c:parse_block_header:
 2795|  5.32k|{
 2796|  5.32k|	uint8_t calculated_cksum;
 2797|  5.32k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 2798|       |
 2799|  5.32k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (2799:5): [True: 1, False: 5.32k]
  ------------------
 2800|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2801|      1|		    "Unsupported block header size (was %d, max is 2)",
 2802|      1|		    bf_byte_count(hdr));
 2803|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2804|      1|	}
 2805|       |
 2806|       |	/* This should probably use bit reader interface in order to be more
 2807|       |	 * future-proof. */
 2808|  5.32k|	*block_size = 0;
 2809|  5.32k|	switch(bf_byte_count(hdr)) {
 2810|       |		/* 1-byte block size */
 2811|  5.29k|		case 0:
  ------------------
  |  Branch (2811:3): [True: 5.29k, False: 35]
  ------------------
 2812|  5.29k|			*block_size = *(const uint8_t*) &p[2];
 2813|  5.29k|			break;
 2814|       |
 2815|       |		/* 2-byte block size */
 2816|     35|		case 1:
  ------------------
  |  Branch (2816:3): [True: 35, False: 5.29k]
  ------------------
 2817|     35|			*block_size = archive_le16dec(&p[2]);
 2818|     35|			break;
 2819|       |
 2820|       |		/* 3-byte block size */
 2821|      0|		case 2:
  ------------------
  |  Branch (2821:3): [True: 0, False: 5.32k]
  ------------------
 2822|      0|			*block_size = archive_le32dec(&p[2]);
 2823|      0|			*block_size &= 0x00FFFFFF;
 2824|      0|			break;
 2825|       |
 2826|       |		/* Other block sizes are not supported. This case is not
 2827|       |		 * reached, because we have an 'if' guard before the switch
 2828|       |		 * that makes sure of it. */
 2829|      0|		default:
  ------------------
  |  Branch (2829:3): [True: 0, False: 5.32k]
  ------------------
 2830|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2831|  5.32k|	}
 2832|       |
 2833|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 2834|       |	 * always * constant. */
 2835|  5.32k|	calculated_cksum = 0x5A
 2836|  5.32k|	    ^ (uint8_t) hdr->block_flags_u8
 2837|  5.32k|	    ^ (uint8_t) *block_size
 2838|  5.32k|	    ^ (uint8_t) (*block_size >> 8)
 2839|  5.32k|	    ^ (uint8_t) (*block_size >> 16);
 2840|       |
 2841|  5.32k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (2841:5): [True: 5.32k, False: 0]
  ------------------
 2842|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2843|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2844|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 2845|       |		    hdr->block_cksum, calculated_cksum);
 2846|       |
 2847|       |		return ARCHIVE_FATAL;
 2848|       |#endif
 2849|  5.32k|	}
 2850|       |
 2851|  5.32k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  5.32k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2852|  5.32k|}
archive_read_support_format_rar5.c:bf_byte_count:
  490|  15.9k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  491|  15.9k|	return (hdr->block_flags_u8 >> 3) & 7;
  492|  15.9k|}
archive_read_support_format_rar5.c:merge_block:
 3368|    208|{
 3369|    208|	struct rar5* rar = get_context(a);
 3370|    208|	ssize_t cur_block_size, partial_offset = 0;
 3371|    208|	const uint8_t* lp;
 3372|    208|	int ret;
 3373|       |
 3374|    208|	if(rar->merge_mode) {
  ------------------
  |  Branch (3374:5): [True: 0, False: 208]
  ------------------
 3375|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3376|      0|		    "Recursive merge is not allowed");
 3377|       |
 3378|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3379|      0|	}
 3380|       |
 3381|       |	/* Set a flag that we're in the switching mode. */
 3382|    208|	rar->cstate.switch_multivolume = 1;
 3383|       |
 3384|       |	/* Reallocate the memory which will hold the whole block. */
 3385|    208|	if(rar->vol.push_buf)
  ------------------
  |  Branch (3385:5): [True: 198, False: 10]
  ------------------
 3386|    198|		free((void*) rar->vol.push_buf);
 3387|       |
 3388|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3389|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3390|       |	 * by exact value would make bit reader perform reads from invalid
 3391|       |	 * memory block when reading the last byte from the buffer. */
 3392|    208|	rar->vol.push_buf = malloc(block_size + 8);
 3393|    208|	if(!rar->vol.push_buf) {
  ------------------
  |  Branch (3393:5): [True: 0, False: 208]
  ------------------
 3394|      0|		archive_set_error(&a->archive, ENOMEM,
 3395|      0|		    "Can't allocate memory for a merge block buffer.");
 3396|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3397|      0|	}
 3398|       |
 3399|       |	/* Valgrind complains if the extension block for bit reader is not
 3400|       |	 * initialized, so initialize it. */
 3401|    208|	memset(&rar->vol.push_buf[block_size], 0, 8);
 3402|       |
 3403|       |	/* A single block can span across multiple multivolume archive files,
 3404|       |	 * so we use a loop here. This loop will consume enough multivolume
 3405|       |	 * archive files until the whole block is read. */
 3406|       |
 3407|    208|	while(1) {
  ------------------
  |  Branch (3407:8): [Folded - Ignored]
  ------------------
 3408|       |		/* Get the size of current block chunk in this multivolume
 3409|       |		 * archive file and read it. */
 3410|    208|		cur_block_size = rar5_min(rar->file.bytes_remaining,
  ------------------
  |  |   60|    208|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 0, False: 208]
  |  |  ------------------
  ------------------
 3411|    208|		    block_size - partial_offset);
 3412|       |
 3413|    208|		if(cur_block_size == 0) {
  ------------------
  |  Branch (3413:6): [True: 0, False: 208]
  ------------------
 3414|      0|			archive_set_error(&a->archive,
 3415|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3416|      0|			    "Encountered block size == 0 during block merge");
 3417|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3418|      0|		}
 3419|       |
 3420|    208|		if(!read_ahead(a, cur_block_size, &lp))
  ------------------
  |  Branch (3420:6): [True: 2, False: 206]
  ------------------
 3421|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3422|       |
 3423|       |		/* Sanity check; there should never be a situation where this
 3424|       |		 * function reads more data than the block's size. */
 3425|    206|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3425:6): [True: 0, False: 206]
  ------------------
 3426|      0|			archive_set_error(&a->archive,
 3427|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3428|      0|			    "Consumed too much data when merging blocks.");
 3429|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3430|      0|		}
 3431|       |
 3432|       |		/* Merge previous block chunk with current block chunk,
 3433|       |		 * or create first block chunk if this is our first
 3434|       |		 * iteration. */
 3435|    206|		memcpy(&rar->vol.push_buf[partial_offset], lp, cur_block_size);
 3436|       |
 3437|       |		/* Advance the stream read pointer by this block chunk size. */
 3438|    206|		if(ARCHIVE_OK != consume(a, cur_block_size))
  ------------------
  |  |  192|    206|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3438:6): [True: 0, False: 206]
  ------------------
 3439|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3440|       |
 3441|       |		/* Update the pointers. `partial_offset` contains information
 3442|       |		 * about the sum of merged block chunks. */
 3443|    206|		partial_offset += cur_block_size;
 3444|    206|		rar->file.bytes_remaining -= cur_block_size;
 3445|       |
 3446|       |		/* If `partial_offset` is the same as `block_size`, this means
 3447|       |		 * we've merged all block chunks and we have a valid full
 3448|       |		 * block. */
 3449|    206|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3449:6): [True: 0, False: 206]
  ------------------
 3450|      0|			break;
 3451|      0|		}
 3452|       |
 3453|       |		/* If we don't have any bytes to read, this means we should
 3454|       |		 * switch to another multivolume archive file. */
 3455|    206|		if(rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3455:6): [True: 206, False: 0]
  ------------------
 3456|    206|			rar->merge_mode++;
 3457|    206|			ret = advance_multivolume(a);
 3458|    206|			rar->merge_mode--;
 3459|    206|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|    206|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3459:7): [True: 206, False: 0]
  ------------------
 3460|    206|				return ret;
 3461|    206|			}
 3462|    206|		}
 3463|    206|	}
 3464|       |
 3465|      0|	*p = rar->vol.push_buf;
 3466|       |
 3467|       |	/* If we're here, we can resume unpacking by processing the block
 3468|       |	 * pointed to by the `*p` memory pointer. */
 3469|       |
 3470|      0|	return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3471|    208|}
archive_read_support_format_rar5.c:bf_is_table_present:
  495|  5.11k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  496|  5.11k|	return (hdr->block_flags_u8 >> 7) & 1;
  497|  5.11k|}
archive_read_support_format_rar5.c:parse_tables:
 2622|     31|{
 2623|     31|	int ret, value, i, w, idx = 0;
 2624|     31|	uint8_t bit_length[HUFF_BC],
 2625|     31|		table[HUFF_TABLE_SIZE],
 2626|     31|		nibble_mask = 0xF0,
 2627|     31|		nibble_shift = 4;
 2628|       |
 2629|     31|	enum { ESCAPE = 15 };
 2630|       |
 2631|       |	/* The data for table generation is compressed using a simple RLE-like
 2632|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2633|    143|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  241|    143|#define HUFF_BC 20
  ------------------
  |  Branch (2633:20): [True: 112, False: 31]
  ------------------
 2634|    112|		if(i >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (2634:6): [True: 0, False: 112]
  ------------------
 2635|       |			/* Truncated data, can't continue. */
 2636|      0|			archive_set_error(&a->archive,
 2637|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2638|      0|			    "Truncated data in huffman tables");
 2639|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2640|      0|		}
 2641|       |
 2642|    112|		value = (p[i] & nibble_mask) >> nibble_shift;
 2643|       |
 2644|    112|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2644:6): [True: 68, False: 44]
  ------------------
 2645|     68|			++i;
 2646|       |
 2647|    112|		nibble_mask ^= 0xFF;
 2648|    112|		nibble_shift ^= 4;
 2649|       |
 2650|       |		/* Values smaller than 15 is data, so we write it directly.
 2651|       |		 * Value 15 is a flag telling us that we need to unpack more
 2652|       |		 * bytes. */
 2653|    112|		if(value == ESCAPE) {
  ------------------
  |  Branch (2653:6): [True: 58, False: 54]
  ------------------
 2654|     58|			value = (p[i] & nibble_mask) >> nibble_shift;
 2655|     58|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2655:7): [True: 2, False: 56]
  ------------------
 2656|      2|				++i;
 2657|     58|			nibble_mask ^= 0xFF;
 2658|     58|			nibble_shift ^= 4;
 2659|       |
 2660|     58|			if(value == 0) {
  ------------------
  |  Branch (2660:7): [True: 0, False: 58]
  ------------------
 2661|       |				/* We sometimes need to write the actual value
 2662|       |				 * of 15, so this case handles that. */
 2663|      0|				bit_length[w++] = ESCAPE;
 2664|     58|			} else {
 2665|     58|				int k;
 2666|       |
 2667|       |				/* Fill zeroes. */
 2668|    624|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  241|    594|#define HUFF_BC 20
  ------------------
  |  Branch (2668:16): [True: 594, False: 30]
  |  Branch (2668:35): [True: 566, False: 28]
  ------------------
 2669|    566|				    k++) {
 2670|    566|					bit_length[w++] = 0;
 2671|    566|				}
 2672|     58|			}
 2673|     58|		} else {
 2674|     54|			bit_length[w++] = value;
 2675|     54|		}
 2676|    112|	}
 2677|       |
 2678|     31|	rar->bits.in_addr = i;
 2679|     31|	rar->bits.bit_addr = nibble_shift ^ 4;
 2680|       |
 2681|     31|	ret = create_decode_tables(bit_length, &rar->cstate.bd, HUFF_BC);
  ------------------
  |  |  241|     31|#define HUFF_BC 20
  ------------------
 2682|     31|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2682:5): [True: 0, False: 31]
  ------------------
 2683|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2684|      0|		    "Decoding huffman tables failed");
 2685|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2686|      0|	}
 2687|       |
 2688|  13.3k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  251|  13.3k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  243|  13.3k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  245|  13.3k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  249|  13.3k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  247|  13.3k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2688:13): [True: 13.3k, False: 31]
  ------------------
 2689|  13.3k|		uint16_t num;
 2690|       |
 2691|  13.3k|		ret = decode_number(a, &rar->cstate.bd, p, &num);
 2692|  13.3k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|  13.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2692:6): [True: 0, False: 13.3k]
  ------------------
 2693|      0|			archive_set_error(&a->archive,
 2694|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2695|      0|			    "Decoding huffman tables failed");
 2696|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2697|      0|		}
 2698|       |
 2699|  13.3k|		if(num < 16) {
  ------------------
  |  Branch (2699:6): [True: 13.3k, False: 0]
  ------------------
 2700|       |			/* 0..15: store directly */
 2701|  13.3k|			table[i] = (uint8_t) num;
 2702|  13.3k|			i++;
 2703|  13.3k|		} else if(num < 18) {
  ------------------
  |  Branch (2703:13): [True: 0, False: 0]
  ------------------
 2704|       |			/* 16..17: repeat previous code */
 2705|      0|			uint16_t n;
 2706|       |
 2707|      0|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2707:7): [True: 0, False: 0]
  ------------------
 2708|      0|				return ret;
 2709|       |
 2710|      0|			if(num == 16) {
  ------------------
  |  Branch (2710:7): [True: 0, False: 0]
  ------------------
 2711|      0|				n >>= 13;
 2712|      0|				n += 3;
 2713|      0|				skip_bits(rar, 3);
 2714|      0|			} else {
 2715|      0|				n >>= 9;
 2716|      0|				n += 11;
 2717|      0|				skip_bits(rar, 7);
 2718|      0|			}
 2719|       |
 2720|      0|			if(i > 0) {
  ------------------
  |  Branch (2720:7): [True: 0, False: 0]
  ------------------
 2721|      0|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  251|      0|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  243|      0|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  245|      0|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  249|      0|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  247|      0|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2721:11): [True: 0, False: 0]
  |  Branch (2721:22): [True: 0, False: 0]
  ------------------
 2722|      0|					table[i] = table[i - 1];
 2723|      0|					i++;
 2724|      0|				}
 2725|      0|			} else {
 2726|      0|				archive_set_error(&a->archive,
 2727|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2728|      0|				    "Unexpected error when decoding "
 2729|      0|				    "huffman tables");
 2730|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2731|      0|			}
 2732|      0|		} else {
 2733|       |			/* other codes: fill with zeroes `n` times */
 2734|      0|			uint16_t n;
 2735|       |
 2736|      0|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2736:7): [True: 0, False: 0]
  ------------------
 2737|      0|				return ret;
 2738|       |
 2739|      0|			if(num == 18) {
  ------------------
  |  Branch (2739:7): [True: 0, False: 0]
  ------------------
 2740|      0|				n >>= 13;
 2741|      0|				n += 3;
 2742|      0|				skip_bits(rar, 3);
 2743|      0|			} else {
 2744|      0|				n >>= 9;
 2745|      0|				n += 11;
 2746|      0|				skip_bits(rar, 7);
 2747|      0|			}
 2748|       |
 2749|      0|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  251|      0|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  243|      0|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  245|      0|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  249|      0|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  247|      0|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2749:10): [True: 0, False: 0]
  |  Branch (2749:21): [True: 0, False: 0]
  ------------------
 2750|      0|				table[i++] = 0;
 2751|      0|		}
 2752|  13.3k|	}
 2753|       |
 2754|     31|	ret = create_decode_tables(&table[idx], &rar->cstate.ld, HUFF_NC);
  ------------------
  |  |  243|     31|#define HUFF_NC 306
  ------------------
 2755|     31|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2755:5): [True: 0, False: 31]
  ------------------
 2756|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2757|      0|		     "Failed to create literal table");
 2758|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2759|      0|	}
 2760|       |
 2761|     31|	idx += HUFF_NC;
  ------------------
  |  |  243|     31|#define HUFF_NC 306
  ------------------
 2762|       |
 2763|     31|	ret = create_decode_tables(&table[idx], &rar->cstate.dd, HUFF_DC);
  ------------------
  |  |  245|     31|#define HUFF_DC 64
  ------------------
 2764|     31|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2764:5): [True: 0, False: 31]
  ------------------
 2765|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2766|      0|		    "Failed to create distance table");
 2767|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2768|      0|	}
 2769|       |
 2770|     31|	idx += HUFF_DC;
  ------------------
  |  |  245|     31|#define HUFF_DC 64
  ------------------
 2771|       |
 2772|     31|	ret = create_decode_tables(&table[idx], &rar->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  247|     31|#define HUFF_LDC 16
  ------------------
 2773|     31|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2773:5): [True: 0, False: 31]
  ------------------
 2774|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2775|      0|		    "Failed to create lower bits of distances table");
 2776|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2777|      0|	}
 2778|       |
 2779|     31|	idx += HUFF_LDC;
  ------------------
  |  |  247|     31|#define HUFF_LDC 16
  ------------------
 2780|       |
 2781|     31|	ret = create_decode_tables(&table[idx], &rar->cstate.rd, HUFF_RC);
  ------------------
  |  |  249|     31|#define HUFF_RC 44
  ------------------
 2782|     31|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2782:5): [True: 0, False: 31]
  ------------------
 2783|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2784|      0|		    "Failed to create repeating distances table");
 2785|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2786|      0|	}
 2787|       |
 2788|     31|	return ARCHIVE_OK;
  ------------------
  |  |  192|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2789|     31|}
archive_read_support_format_rar5.c:create_decode_tables:
 2511|    155|{
 2512|    155|	int code, upper_limit = 0, i, lc[16];
 2513|    155|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2514|    155|	ssize_t cur_len, quick_data_size;
 2515|       |
 2516|    155|	memset(&lc, 0, sizeof(lc));
 2517|    155|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2518|    155|	table->size = size;
 2519|    155|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  243|    155|#define HUFF_NC 306
  ------------------
  |  Branch (2519:22): [True: 31, False: 124]
  ------------------
 2520|       |
 2521|  14.1k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2521:13): [True: 13.9k, False: 155]
  ------------------
 2522|  13.9k|		lc[bit_length[i] & 15]++;
 2523|  13.9k|	}
 2524|       |
 2525|    155|	lc[0] = 0;
 2526|    155|	table->decode_pos[0] = 0;
 2527|    155|	table->decode_len[0] = 0;
 2528|       |
 2529|  2.48k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2529:13): [True: 2.32k, False: 155]
  ------------------
 2530|  2.32k|		upper_limit += lc[i];
 2531|       |
 2532|  2.32k|		table->decode_len[i] = upper_limit << (16 - i);
 2533|  2.32k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2534|       |
 2535|  2.32k|		upper_limit <<= 1;
 2536|  2.32k|	}
 2537|       |
 2538|    155|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2539|       |
 2540|  14.1k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2540:13): [True: 13.9k, False: 155]
  ------------------
 2541|  13.9k|		uint8_t clen = bit_length[i] & 15;
 2542|  13.9k|		if(clen > 0) {
  ------------------
  |  Branch (2542:6): [True: 483, False: 13.4k]
  ------------------
 2543|    483|			int last_pos = decode_pos_clone[clen];
 2544|    483|			table->decode_num[last_pos] = i;
 2545|    483|			decode_pos_clone[clen]++;
 2546|    483|		}
 2547|  13.9k|	}
 2548|       |
 2549|    155|	quick_data_size = (int64_t)1 << table->quick_bits;
 2550|    155|	cur_len = 1;
 2551|  47.7k|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2551:16): [True: 47.6k, False: 155]
  ------------------
 2552|  47.6k|		int bit_field = code << (16 - table->quick_bits);
 2553|  47.6k|		int dist, pos;
 2554|       |
 2555|  49.9k|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   62|  99.8k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2555:9): [True: 3.42k, False: 46.5k]
  ------------------
 2556|  49.9k|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2556:5): [True: 2.31k, False: 1.11k]
  ------------------
 2557|  2.31k|			cur_len++;
 2558|  2.31k|		}
 2559|       |
 2560|  47.6k|		table->quick_len[code] = (uint8_t) cur_len;
 2561|       |
 2562|  47.6k|		dist = bit_field - table->decode_len[cur_len - 1];
 2563|  47.6k|		dist >>= (16 - cur_len);
 2564|       |
 2565|  47.6k|		pos = table->decode_pos[cur_len & 15] + dist;
 2566|  47.6k|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   62|  95.2k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2566:6): [True: 1.11k, False: 46.5k]
  |  Branch (2566:51): [True: 1.11k, False: 0]
  ------------------
 2567|  1.11k|			table->quick_num[code] = table->decode_num[pos];
 2568|  46.5k|		} else {
 2569|  46.5k|			table->quick_num[code] = 0;
 2570|  46.5k|		}
 2571|  47.6k|	}
 2572|       |
 2573|    155|	return ARCHIVE_OK;
  ------------------
  |  |  192|    155|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2574|    155|}
archive_read_support_format_rar5.c:decode_number:
 2578|   596k|{
 2579|   596k|	int i, bits, dist, ret;
 2580|   596k|	uint16_t bitfield;
 2581|   596k|	uint32_t pos;
 2582|   596k|	struct rar5* rar = get_context(a);
 2583|       |
 2584|   596k|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &bitfield))) {
  ------------------
  |  |  192|   596k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2584:5): [True: 0, False: 596k]
  ------------------
 2585|      0|		return ret;
 2586|      0|	}
 2587|       |
 2588|   596k|	bitfield &= 0xfffe;
 2589|       |
 2590|   596k|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2590:5): [True: 5.05k, False: 591k]
  ------------------
 2591|  5.05k|		int code = bitfield >> (16 - table->quick_bits);
 2592|  5.05k|		skip_bits(rar, table->quick_len[code]);
 2593|  5.05k|		*num = table->quick_num[code];
 2594|  5.05k|		return ARCHIVE_OK;
  ------------------
  |  |  192|  5.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2595|  5.05k|	}
 2596|       |
 2597|   591k|	bits = 15;
 2598|       |
 2599|  3.02M|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2599:33): [True: 2.43M, False: 591k]
  ------------------
 2600|  2.43M|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2600:6): [True: 75, False: 2.43M]
  ------------------
 2601|     75|			bits = i;
 2602|     75|			break;
 2603|     75|		}
 2604|  2.43M|	}
 2605|       |
 2606|   591k|	skip_bits(rar, bits);
 2607|       |
 2608|   591k|	dist = bitfield - table->decode_len[bits - 1];
 2609|   591k|	dist >>= (16 - bits);
 2610|   591k|	pos = table->decode_pos[bits] + dist;
 2611|       |
 2612|   591k|	if(pos >= table->size)
  ------------------
  |  Branch (2612:5): [True: 554k, False: 36.8k]
  ------------------
 2613|   554k|		pos = 0;
 2614|       |
 2615|   591k|	*num = table->decode_num[pos];
 2616|   591k|	return ARCHIVE_OK;
  ------------------
  |  |  192|   591k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2617|   596k|}
archive_read_support_format_rar5.c:read_bits_16:
 1044|   596k|{
 1045|   596k|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1045:5): [True: 0, False: 596k]
  ------------------
 1046|      0|		archive_set_error(&a->archive,
 1047|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1048|      0|			"Premature end of stream during extraction of data (#2)");
 1049|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1050|      0|	}
 1051|       |
 1052|   596k|	int bits = (int) ((uint32_t) p[rar->bits.in_addr]) << 16;
 1053|   596k|	bits |= (int) p[rar->bits.in_addr + 1] << 8;
 1054|   596k|	bits |= (int) p[rar->bits.in_addr + 2];
 1055|   596k|	bits >>= (8 - rar->bits.bit_addr);
 1056|   596k|	*value = bits & 0xffff;
 1057|   596k|	return ARCHIVE_OK;
  ------------------
  |  |  192|   596k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1058|   596k|}
archive_read_support_format_rar5.c:skip_bits:
 1060|   596k|static void skip_bits(struct rar5* rar, int bits) {
 1061|   596k|	const int new_bits = rar->bits.bit_addr + bits;
 1062|   596k|	rar->bits.in_addr += new_bits >> 3;
 1063|   596k|	rar->bits.bit_addr = new_bits & 7;
 1064|   596k|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3025|  5.11k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3026|  5.11k|	struct rar5* rar = get_context(a);
 3027|  5.11k|	uint16_t num;
 3028|  5.11k|	int ret;
 3029|       |
 3030|  5.11k|	const uint64_t cmask = rar->cstate.window_mask;
 3031|  5.11k|	const struct compressed_block_header* hdr = &rar->last_block_hdr;
 3032|  5.11k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3033|       |
 3034|   587k|	while(1) {
  ------------------
  |  Branch (3034:8): [Folded - Ignored]
  ------------------
 3035|   587k|		if(rar->cstate.write_ptr - rar->cstate.last_write_ptr >
  ------------------
  |  Branch (3035:6): [True: 1, False: 587k]
  ------------------
 3036|   587k|		    (rar->cstate.window_size >> 1)) {
 3037|       |			/* Don't allow growing data by more than half of the
 3038|       |			 * window size at a time. In such case, break the loop;
 3039|       |			 *  next call to this function will continue processing
 3040|       |			 *  from this moment. */
 3041|      1|			break;
 3042|      1|		}
 3043|       |
 3044|   587k|		if(rar->bits.in_addr > rar->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3044:6): [True: 4.95k, False: 582k]
  ------------------
 3045|   587k|		    (rar->bits.in_addr == rar->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3045:8): [True: 193, False: 582k]
  ------------------
 3046|   582k|		    rar->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3046:7): [True: 163, False: 30]
  ------------------
 3047|  5.11k|		{
 3048|       |			/* If the program counter is here, it means the
 3049|       |			 * function has finished processing the block. */
 3050|  5.11k|			rar->cstate.block_parsing_finished = 1;
 3051|  5.11k|			break;
 3052|  5.11k|		}
 3053|       |
 3054|       |		/* Decode the next literal. */
 3055|   582k|		if(ARCHIVE_OK != decode_number(a, &rar->cstate.ld, p, &num)) {
  ------------------
  |  |  192|   582k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3055:6): [True: 0, False: 582k]
  ------------------
 3056|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3057|      0|		}
 3058|       |
 3059|       |		/* Num holds a decompression literal, or 'command code'.
 3060|       |		 *
 3061|       |		 * - Values lower than 256 are just bytes. Those codes
 3062|       |		 *   can be stored in the output buffer directly.
 3063|       |		 *
 3064|       |		 * - Code 256 defines a new filter, which is later used to
 3065|       |		 *   ransform the data block accordingly to the filter type.
 3066|       |		 *   The data block needs to be fully uncompressed first.
 3067|       |		 *
 3068|       |		 * - Code bigger than 257 and smaller than 262 define
 3069|       |		 *   a repetition pattern that should be copied from
 3070|       |		 *   an already uncompressed chunk of data.
 3071|       |		 */
 3072|       |
 3073|   582k|		if(num < 256) {
  ------------------
  |  Branch (3073:6): [True: 582k, False: 237]
  ------------------
 3074|       |			/* Directly store the byte. */
 3075|   582k|			int64_t write_idx = rar->cstate.solid_offset +
 3076|   582k|			    rar->cstate.write_ptr++;
 3077|       |
 3078|   582k|			rar->cstate.window_buf[write_idx & cmask] =
 3079|   582k|			    (uint8_t) num;
 3080|   582k|			continue;
 3081|   582k|		} else if(num >= 262) {
  ------------------
  |  Branch (3081:13): [True: 202, False: 35]
  ------------------
 3082|    202|			uint16_t dist_slot;
 3083|    202|			int len = decode_code_length(a, rar, p, num - 262),
 3084|    202|				dbits,
 3085|    202|				dist = 1;
 3086|       |
 3087|    202|			if(len == -1) {
  ------------------
  |  Branch (3087:7): [True: 0, False: 202]
  ------------------
 3088|      0|				archive_set_error(&a->archive,
 3089|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3090|      0|				    "Failed to decode the code length");
 3091|       |
 3092|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3093|      0|			}
 3094|       |
 3095|    202|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.dd, p,
  ------------------
  |  |  192|    202|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3095:7): [True: 0, False: 202]
  ------------------
 3096|    202|			    &dist_slot))
 3097|      0|			{
 3098|      0|				archive_set_error(&a->archive,
 3099|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3100|      0|				    "Failed to decode the distance slot");
 3101|       |
 3102|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3103|      0|			}
 3104|       |
 3105|    202|			if(dist_slot < 4) {
  ------------------
  |  Branch (3105:7): [True: 0, False: 202]
  ------------------
 3106|      0|				dbits = 0;
 3107|      0|				dist += dist_slot;
 3108|    202|			} else {
 3109|    202|				dbits = dist_slot / 2 - 1;
 3110|       |
 3111|       |				/* Cast to uint32_t will make sure the shift
 3112|       |				 * left operation won't produce undefined
 3113|       |				 * result. Then, the uint32_t type will
 3114|       |				 * be implicitly casted to int. */
 3115|    202|				dist += (uint32_t) (2 |
 3116|    202|				    (dist_slot & 1)) << dbits;
 3117|    202|			}
 3118|       |
 3119|    202|			if(dbits > 0) {
  ------------------
  |  Branch (3119:7): [True: 202, False: 0]
  ------------------
 3120|    202|				if(dbits >= 4) {
  ------------------
  |  Branch (3120:8): [True: 201, False: 1]
  ------------------
 3121|    201|					uint32_t add = 0;
 3122|    201|					uint16_t low_dist;
 3123|       |
 3124|    201|					if(dbits > 4) {
  ------------------
  |  Branch (3124:9): [True: 201, False: 0]
  ------------------
 3125|    201|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  192|    201|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3125:10): [True: 0, False: 201]
  ------------------
 3126|    201|						    a, rar, p, &add))) {
 3127|       |							/* Return EOF if we
 3128|       |							 * can't read more
 3129|       |							 * data. */
 3130|      0|							return ret;
 3131|      0|						}
 3132|       |
 3133|    201|						skip_bits(rar, dbits - 4);
 3134|    201|						add = (add >> (
 3135|    201|						    36 - dbits)) << 4;
 3136|    201|						dist += add;
 3137|    201|					}
 3138|       |
 3139|    201|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  192|    201|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3139:9): [True: 0, False: 201]
  ------------------
 3140|    201|					    &rar->cstate.ldd, p, &low_dist))
 3141|      0|					{
 3142|      0|						archive_set_error(&a->archive,
 3143|      0|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3144|      0|						    "Failed to decode the "
 3145|      0|						    "distance slot");
 3146|       |
 3147|      0|						return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3148|      0|					}
 3149|       |
 3150|    201|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3150:9): [True: 0, False: 201]
  ------------------
 3151|       |						/* This only happens in
 3152|       |						 * invalid archives. */
 3153|      0|						archive_set_error(&a->archive,
 3154|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3155|      0|						    "Distance pointer "
 3156|      0|						    "overflow");
 3157|      0|						return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3158|      0|					}
 3159|       |
 3160|    201|					dist += low_dist;
 3161|    201|				} else {
 3162|       |					/* dbits is one of [0,1,2,3] */
 3163|      1|					int add;
 3164|       |
 3165|      1|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar,
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3165:9): [True: 0, False: 1]
  ------------------
 3166|      1|					     p, dbits, &add))) {
 3167|       |						/* Return EOF if we can't read
 3168|       |						 * more data. */
 3169|      0|						return ret;
 3170|      0|					}
 3171|       |
 3172|      1|					dist += add;
 3173|      1|				}
 3174|    202|			}
 3175|       |
 3176|    202|			if(dist > 0x100) {
  ------------------
  |  Branch (3176:7): [True: 196, False: 6]
  ------------------
 3177|    196|				len++;
 3178|       |
 3179|    196|				if(dist > 0x2000) {
  ------------------
  |  Branch (3179:8): [True: 26, False: 170]
  ------------------
 3180|     26|					len++;
 3181|       |
 3182|     26|					if(dist > 0x40000) {
  ------------------
  |  Branch (3182:9): [True: 16, False: 10]
  ------------------
 3183|     16|						len++;
 3184|     16|					}
 3185|     26|				}
 3186|    196|			}
 3187|       |
 3188|    202|			dist_cache_push(rar, dist);
 3189|    202|			rar->cstate.last_len = len;
 3190|       |
 3191|    202|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  192|    202|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3191:7): [True: 0, False: 202]
  ------------------
 3192|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3193|       |
 3194|    202|			continue;
 3195|    202|		} else if(num == 256) {
  ------------------
  |  Branch (3195:13): [True: 1, False: 34]
  ------------------
 3196|       |			/* Create a filter. */
 3197|      1|			ret = parse_filter(a, p);
 3198|      1|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3198:7): [True: 1, False: 0]
  ------------------
 3199|      1|				return ret;
 3200|       |
 3201|      0|			continue;
 3202|     34|		} else if(num == 257) {
  ------------------
  |  Branch (3202:13): [True: 0, False: 34]
  ------------------
 3203|      0|			if(rar->cstate.last_len != 0) {
  ------------------
  |  Branch (3203:7): [True: 0, False: 0]
  ------------------
 3204|      0|				if(ARCHIVE_OK != copy_string(a,
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3204:8): [True: 0, False: 0]
  ------------------
 3205|      0|				    rar->cstate.last_len,
 3206|      0|				    rar->cstate.dist_cache[0]))
 3207|      0|				{
 3208|      0|					return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3209|      0|				}
 3210|      0|			}
 3211|       |
 3212|      0|			continue;
 3213|     34|		} else {
 3214|       |			/* num < 262 */
 3215|     34|			const int idx = num - 258;
 3216|     34|			const int dist = dist_cache_touch(rar, idx);
 3217|       |
 3218|     34|			uint16_t len_slot;
 3219|     34|			int len;
 3220|       |
 3221|     34|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.rd, p,
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3221:7): [True: 0, False: 34]
  ------------------
 3222|     34|			    &len_slot)) {
 3223|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3224|      0|			}
 3225|       |
 3226|     34|			len = decode_code_length(a, rar, p, len_slot);
 3227|     34|			if (len == -1) {
  ------------------
  |  Branch (3227:8): [True: 0, False: 34]
  ------------------
 3228|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3229|      0|			}
 3230|       |
 3231|     34|			rar->cstate.last_len = len;
 3232|       |
 3233|     34|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  192|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3233:7): [True: 0, False: 34]
  ------------------
 3234|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3235|       |
 3236|     34|			continue;
 3237|     34|		}
 3238|   582k|	}
 3239|       |
 3240|  5.11k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  5.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3241|  5.11k|}
archive_read_support_format_rar5.c:bf_bit_size:
  485|  5.11k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  486|  5.11k|	return hdr->block_flags_u8 & 7;
  487|  5.11k|}
archive_read_support_format_rar5.c:decode_code_length:
 2974|    236|{
 2975|    236|	int lbits, length = 2;
 2976|       |
 2977|    236|	if(code < 8) {
  ------------------
  |  Branch (2977:5): [True: 67, False: 169]
  ------------------
 2978|     67|		lbits = 0;
 2979|     67|		length += code;
 2980|    169|	} else {
 2981|    169|		lbits = code / 4 - 1;
 2982|    169|		length += (4 | (code & 3)) << lbits;
 2983|    169|	}
 2984|       |
 2985|    236|	if(lbits > 0) {
  ------------------
  |  Branch (2985:5): [True: 169, False: 67]
  ------------------
 2986|    169|		int add;
 2987|       |
 2988|    169|		if(ARCHIVE_OK != read_consume_bits(a, rar, p, lbits, &add))
  ------------------
  |  |  192|    169|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2988:6): [True: 0, False: 169]
  ------------------
 2989|      0|			return -1;
 2990|       |
 2991|    169|		length += add;
 2992|    169|	}
 2993|       |
 2994|    236|	return length;
 2995|    236|}
archive_read_support_format_rar5.c:read_bits_32:
 1024|    201|{
 1025|    201|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1025:5): [True: 0, False: 201]
  ------------------
 1026|      0|		archive_set_error(&a->archive,
 1027|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1028|      0|			"Premature end of stream during extraction of data (#1)");
 1029|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1030|      0|	}
 1031|       |
 1032|    201|	uint32_t bits = ((uint32_t) p[rar->bits.in_addr]) << 24;
 1033|    201|	bits |= p[rar->bits.in_addr + 1] << 16;
 1034|    201|	bits |= p[rar->bits.in_addr + 2] << 8;
 1035|    201|	bits |= p[rar->bits.in_addr + 3];
 1036|    201|	bits <<= rar->bits.bit_addr;
 1037|    201|	bits |= p[rar->bits.in_addr + 4] >> (8 - rar->bits.bit_addr);
 1038|    201|	*value = bits;
 1039|    201|	return ARCHIVE_OK;
  ------------------
  |  |  192|    201|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1040|    201|}
archive_read_support_format_rar5.c:read_consume_bits:
 1069|    172|{
 1070|    172|	uint16_t v;
 1071|    172|	int ret, num;
 1072|       |
 1073|    172|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1073:5): [True: 0, False: 172]
  |  Branch (1073:15): [True: 0, False: 172]
  ------------------
 1074|       |		/* This is a programmer error and should never happen
 1075|       |		 * in runtime. */
 1076|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1077|      0|	}
 1078|       |
 1079|    172|	ret = read_bits_16(a, rar, p, &v);
 1080|    172|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|    172|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1080:5): [True: 0, False: 172]
  ------------------
 1081|      0|		return ret;
 1082|       |
 1083|    172|	num = (int) v;
 1084|    172|	num >>= 16 - n;
 1085|       |
 1086|    172|	skip_bits(rar, n);
 1087|       |
 1088|    172|	if(value)
  ------------------
  |  Branch (1088:5): [True: 172, False: 0]
  ------------------
 1089|    172|		*value = num;
 1090|       |
 1091|    172|	return ARCHIVE_OK;
  ------------------
  |  |  192|    172|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1092|    172|}
archive_read_support_format_rar5.c:dist_cache_push:
  813|    202|static void dist_cache_push(struct rar5* rar, int value) {
  814|    202|	int* q = rar->cstate.dist_cache;
  815|       |
  816|    202|	q[3] = q[2];
  817|    202|	q[2] = q[1];
  818|    202|	q[1] = q[0];
  819|    202|	q[0] = value;
  820|    202|}
archive_read_support_format_rar5.c:copy_string:
 2997|    236|static int copy_string(struct archive_read* a, int len, int dist) {
 2998|    236|	struct rar5* rar = get_context(a);
 2999|    236|	const ssize_t cmask = rar->cstate.window_mask;
 3000|    236|	const uint64_t write_ptr = rar->cstate.write_ptr +
 3001|    236|	    rar->cstate.solid_offset;
 3002|    236|	int i;
 3003|       |
 3004|    236|	if (rar->cstate.window_buf == NULL)
  ------------------
  |  Branch (3004:6): [True: 0, False: 236]
  ------------------
 3005|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3006|       |
 3007|       |	/* The unpacker spends most of the time in this function. It would be
 3008|       |	 * a good idea to introduce some optimizations here.
 3009|       |	 *
 3010|       |	 * Just remember that this loop treats buffers that overlap differently
 3011|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3012|       |	 * call will not be enough. */
 3013|       |
 3014|  71.3k|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3014:13): [True: 71.1k, False: 236]
  ------------------
 3015|  71.1k|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3016|  71.1k|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3017|  71.1k|		rar->cstate.window_buf[write_idx] =
 3018|  71.1k|		    rar->cstate.window_buf[read_idx];
 3019|  71.1k|	}
 3020|       |
 3021|    236|	rar->cstate.write_ptr += len;
 3022|    236|	return ARCHIVE_OK;
  ------------------
  |  |  192|    236|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3023|    236|}
archive_read_support_format_rar5.c:parse_filter:
 2908|      1|static int parse_filter(struct archive_read* ar, const uint8_t* p) {
 2909|      1|	uint32_t block_start, block_length;
 2910|      1|	uint16_t filter_type;
 2911|      1|	struct filter_info* filt = NULL;
 2912|      1|	struct rar5* rar = get_context(ar);
 2913|      1|	int ret;
 2914|       |
 2915|       |	/* Read the parameters from the input stream. */
 2916|      1|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar, p, &block_start)))
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2916:5): [True: 0, False: 1]
  ------------------
 2917|      0|		return ret;
 2918|       |
 2919|      1|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar, p, &block_length)))
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2919:5): [True: 0, False: 1]
  ------------------
 2920|      0|		return ret;
 2921|       |
 2922|      1|	if(ARCHIVE_OK != (ret = read_bits_16(ar, rar, p, &filter_type)))
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2922:5): [True: 0, False: 1]
  ------------------
 2923|      0|		return ret;
 2924|       |
 2925|      1|	filter_type >>= 13;
 2926|      1|	skip_bits(rar, 3);
 2927|       |
 2928|       |	/* Perform some sanity checks on this filter parameters. Note that we
 2929|       |	 * allow only DELTA, E8/E9 and ARM filters here, because rest of
 2930|       |	 * filters are not used in RARv5. */
 2931|       |
 2932|      1|	if(block_length < 4 ||
  ------------------
  |  Branch (2932:5): [True: 0, False: 1]
  ------------------
 2933|      1|	    block_length > 0x400000 ||
  ------------------
  |  Branch (2933:6): [True: 1, False: 0]
  ------------------
 2934|      1|	    filter_type > FILTER_ARM ||
  ------------------
  |  Branch (2934:6): [True: 0, False: 0]
  ------------------
 2935|      1|	    !is_valid_filter_block_start(rar, block_start))
  ------------------
  |  Branch (2935:6): [True: 0, False: 0]
  ------------------
 2936|      1|	{
 2937|      1|		archive_set_error(&ar->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2938|      1|		    "Invalid filter encountered");
 2939|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2940|      1|	}
 2941|       |
 2942|       |	/* Allocate a new filter. */
 2943|      0|	filt = add_new_filter(rar);
 2944|      0|	if(filt == NULL) {
  ------------------
  |  Branch (2944:5): [True: 0, False: 0]
  ------------------
 2945|      0|		archive_set_error(&ar->archive, ENOMEM,
 2946|      0|		    "Can't allocate memory for a filter descriptor.");
 2947|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2948|      0|	}
 2949|       |
 2950|      0|	filt->type = filter_type;
 2951|      0|	filt->block_start = rar->cstate.write_ptr + block_start;
 2952|      0|	filt->block_length = block_length;
 2953|       |
 2954|      0|	rar->cstate.last_block_start = filt->block_start;
 2955|      0|	rar->cstate.last_block_length = filt->block_length;
 2956|       |
 2957|       |	/* Read some more data in case this is a DELTA filter. Other filter
 2958|       |	 * types don't require any additional data over what was already
 2959|       |	 * read. */
 2960|      0|	if(filter_type == FILTER_DELTA) {
  ------------------
  |  Branch (2960:5): [True: 0, False: 0]
  ------------------
 2961|      0|		int channels;
 2962|       |
 2963|      0|		if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar, p, 5, &channels)))
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2963:6): [True: 0, False: 0]
  ------------------
 2964|      0|			return ret;
 2965|       |
 2966|      0|		filt->channels = channels + 1;
 2967|      0|	}
 2968|       |
 2969|      0|	return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2970|      0|}
archive_read_support_format_rar5.c:parse_filter_data:
 2857|      2|{
 2858|      2|	int i, bytes, ret;
 2859|      2|	uint32_t data = 0;
 2860|       |
 2861|      2|	if(ARCHIVE_OK != (ret = read_consume_bits(a, rar, p, 2, &bytes)))
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2861:5): [True: 0, False: 2]
  ------------------
 2862|      0|		return ret;
 2863|       |
 2864|      2|	bytes++;
 2865|       |
 2866|      7|	for(i = 0; i < bytes; i++) {
  ------------------
  |  Branch (2866:13): [True: 5, False: 2]
  ------------------
 2867|      5|		uint16_t byte;
 2868|       |
 2869|      5|		if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &byte))) {
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2869:6): [True: 0, False: 5]
  ------------------
 2870|      0|			return ret;
 2871|      0|		}
 2872|       |
 2873|       |		/* Cast to uint32_t will ensure the shift operation will not
 2874|       |		 * produce undefined result. */
 2875|      5|		data += ((uint32_t) byte >> 8) << (i * 8);
 2876|      5|		skip_bits(rar, 8);
 2877|      5|	}
 2878|       |
 2879|      2|	*filter_data = data;
 2880|      2|	return ARCHIVE_OK;
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2881|      2|}
archive_read_support_format_rar5.c:dist_cache_touch:
  822|     34|static int dist_cache_touch(struct rar5* rar, int idx) {
  823|     34|	int* q = rar->cstate.dist_cache;
  824|     34|	int i, dist = q[idx];
  825|       |
  826|     82|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (826:15): [True: 48, False: 34]
  ------------------
  827|     48|		q[i] = q[i - 1];
  828|       |
  829|     34|	q[0] = dist;
  830|     34|	return dist;
  831|     34|}
archive_read_support_format_rar5.c:bf_is_last_block:
  500|  4.91k|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  501|  4.91k|	return (hdr->block_flags_u8 >> 6) & 1;
  502|  4.91k|}
archive_read_support_format_rar5.c:apply_filters:
  761|    200|static int apply_filters(struct archive_read* a) {
  762|    200|	struct filter_info* flt;
  763|    200|	struct rar5* rar = get_context(a);
  764|    200|	int ret;
  765|       |
  766|    200|	rar->cstate.all_filters_applied = 0;
  767|       |
  768|       |	/* Get the first filter that can be applied to our data. The data
  769|       |	 * needs to be fully unpacked before the filter can be run. */
  770|    200|	if(CDE_OK == cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (770:5): [True: 0, False: 200]
  ------------------
  771|    200|	    cdeque_filter_p(&flt))) {
  772|       |		/* Check if our unpacked data fully covers this filter's
  773|       |		 * range. */
  774|      0|		if(rar->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (774:6): [True: 0, False: 0]
  ------------------
  775|      0|		    rar->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (775:7): [True: 0, False: 0]
  ------------------
  776|      0|		    flt->block_length) {
  777|       |			/* Check if we have some data pending to be written
  778|       |			 * right before the filter's start offset. */
  779|      0|			if(rar->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (779:7): [True: 0, False: 0]
  ------------------
  780|       |				/* Run the filter specified by descriptor
  781|       |				 * `flt`. */
  782|      0|				ret = run_filter(a, flt);
  783|      0|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (783:8): [True: 0, False: 0]
  ------------------
  784|       |					/* Filter failure, return error. */
  785|      0|					return ret;
  786|      0|				}
  787|       |
  788|       |				/* Filter descriptor won't be needed anymore
  789|       |				 * after it's used, * so remove it from the
  790|       |				 * filter list and free its memory. */
  791|      0|				(void) cdeque_pop_front(&rar->cstate.filters,
  792|      0|				    cdeque_filter_p(&flt));
  793|       |
  794|      0|				free(flt);
  795|      0|			} else {
  796|       |				/* We can't run filters yet, dump the memory
  797|       |				 * right before the filter. */
  798|      0|				push_window_data(a, rar,
  799|      0|				    rar->cstate.last_write_ptr,
  800|      0|				    flt->block_start);
  801|      0|			}
  802|       |
  803|       |			/* Return 'filter applied or not needed' state to the
  804|       |			 * caller. */
  805|      0|			return ARCHIVE_RETRY;
  ------------------
  |  |  193|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  806|      0|		}
  807|      0|	}
  808|       |
  809|    200|	rar->cstate.all_filters_applied = 1;
  810|    200|	return ARCHIVE_OK;
  ------------------
  |  |  192|    200|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  811|    200|}
archive_read_support_format_rar5.c:push_data_ready:
 3652|    203|{
 3653|    203|	int i;
 3654|       |
 3655|       |	/* Don't push if we're in skip mode. This is needed because solid
 3656|       |	 * streams need full processing even if we're skipping data. After
 3657|       |	 * fully processing the stream, we need to discard the generated bytes,
 3658|       |	 * because we're interested only in the side effect: building up the
 3659|       |	 * internal window circular buffer. This window buffer will be used
 3660|       |	 * later during unpacking of requested data. */
 3661|    203|	if(rar->skip_mode)
  ------------------
  |  Branch (3661:5): [True: 146, False: 57]
  ------------------
 3662|    146|		return ARCHIVE_OK;
  ------------------
  |  |  192|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3663|       |
 3664|       |	/* Sanity check. */
 3665|     57|	if(offset != rar->file.last_offset + rar->file.last_size) {
  ------------------
  |  Branch (3665:5): [True: 0, False: 57]
  ------------------
 3666|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3667|      0|		    "Sanity check error: output stream is not continuous");
 3668|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3669|      0|	}
 3670|       |
 3671|     60|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   62|     60|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3671:13): [True: 60, False: 0]
  ------------------
 3672|     60|		struct data_ready* d = &rar->cstate.dready[i];
 3673|     60|		if(!d->used) {
  ------------------
  |  Branch (3673:6): [True: 57, False: 3]
  ------------------
 3674|     57|			d->used = 1;
 3675|     57|			d->buf = buf;
 3676|     57|			d->size = size;
 3677|     57|			d->offset = offset;
 3678|       |
 3679|       |			/* These fields are used only in sanity checking. */
 3680|     57|			rar->file.last_offset = offset;
 3681|     57|			rar->file.last_size = size;
 3682|       |
 3683|       |			/* Calculate the checksum of this new block before
 3684|       |			 * submitting data to libarchive's engine. */
 3685|     57|			update_crc(rar, d->buf, d->size);
 3686|       |
 3687|     57|			return ARCHIVE_OK;
  ------------------
  |  |  192|     57|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3688|     57|		}
 3689|     60|	}
 3690|       |
 3691|       |	/* Program counter will reach this code if the `rar->cstate.data_ready`
 3692|       |	 * stack will be filled up so that no new entries will be allowed. The
 3693|       |	 * code shouldn't allow such situation to occur. So we treat this case
 3694|       |	 * as an internal error. */
 3695|       |
 3696|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3697|      0|	    "Error: premature end of data_ready stack");
 3698|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3699|     57|}
archive_read_support_format_rar5.c:cdeque_front:
  411|    200|static int cdeque_front(struct cdeque* d, void** value) {
  412|    200|	if(d->size > 0) {
  ------------------
  |  Branch (412:5): [True: 0, False: 200]
  ------------------
  413|      0|		cdeque_front_fast(d, value);
  414|      0|		return CDE_OK;
  415|      0|	} else
  416|    200|		return CDE_OUT_OF_BOUNDS;
  417|    200|}
archive_read_support_format_rar5.c:push_window_data:
  757|    200|{
  758|    200|	push_data(a, rar, rar->cstate.window_buf, idx_begin, idx_end);
  759|    200|}
archive_read_support_format_rar5.c:push_data:
  713|    200|{
  714|    200|	const ssize_t wmask = rar->cstate.window_mask;
  715|    200|	const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
  716|    200|	    rar->cstate.last_write_ptr) & wmask;
  717|       |
  718|    200|	idx_begin += rar->cstate.solid_offset;
  719|    200|	idx_end += rar->cstate.solid_offset;
  720|       |
  721|       |	/* Check if our unpacked data is wrapped inside the window circular
  722|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  723|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  724|       |	 * part with one memcpy, and the second part with another memcpy. */
  725|       |
  726|    200|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (726:5): [True: 3, False: 197]
  ------------------
  727|       |		/* The data is wrapped (begin offset sis bigger than end
  728|       |		 * offset). */
  729|      3|		const ssize_t frag1_size = rar->cstate.window_size -
  730|      3|		    (idx_begin & wmask);
  731|      3|		const ssize_t frag2_size = idx_end & wmask;
  732|       |
  733|       |		/* Copy the first part of the buffer first. */
  734|      3|		push_data_ready(a, rar, buf + solid_write_ptr, frag1_size,
  735|      3|		    rar->cstate.last_write_ptr);
  736|       |
  737|       |		/* Copy the second part of the buffer. */
  738|      3|		push_data_ready(a, rar, buf, frag2_size,
  739|      3|		    rar->cstate.last_write_ptr + frag1_size);
  740|       |
  741|      3|		rar->cstate.last_write_ptr += frag1_size + frag2_size;
  742|    197|	} else {
  743|       |		/* Data is not wrapped, so we can just use one call to copy the
  744|       |		 * data. */
  745|    197|		push_data_ready(a, rar,
  746|    197|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  747|    197|		    rar->cstate.last_write_ptr);
  748|       |
  749|    197|		rar->cstate.last_write_ptr += idx_end - idx_begin;
  750|    197|	}
  751|    200|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4137|  7.41k|static int rar5_read_data_skip(struct archive_read *a) {
 4138|  7.41k|	struct rar5* rar = get_context(a);
 4139|       |
 4140|  7.41k|	if(rar->main.solid) {
  ------------------
  |  Branch (4140:5): [True: 3.40k, False: 4.01k]
  ------------------
 4141|       |		/* In solid archives, instead of skipping the data, we need to
 4142|       |		 * extract it, and dispose the result. The side effect of this
 4143|       |		 * operation will be setting up the initial window buffer state
 4144|       |		 * needed to be able to extract the selected file. */
 4145|       |
 4146|  3.40k|		int ret;
 4147|       |
 4148|       |		/* Make sure to process all blocks in the compressed stream. */
 4149|  4.88k|		while(rar->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4149:9): [True: 1.58k, False: 3.29k]
  ------------------
 4150|       |			/* Setting the "skip mode" will allow us to skip
 4151|       |			 * checksum checks during data skipping. Checking the
 4152|       |			 * checksum of skipped data isn't really necessary and
 4153|       |			 * it's only slowing things down.
 4154|       |			 *
 4155|       |			 * This is incremented instead of setting to 1 because
 4156|       |			 * this data skipping function can be called
 4157|       |			 * recursively. */
 4158|  1.58k|			rar->skip_mode++;
 4159|       |
 4160|       |			/* We're disposing 1 block of data, so we use triple
 4161|       |			 * NULLs in arguments. */
 4162|  1.58k|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4163|       |
 4164|       |			/* Turn off "skip mode". */
 4165|  1.58k|			rar->skip_mode--;
 4166|       |
 4167|  1.58k|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  191|  1.58k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4167:7): [True: 0, False: 1.58k]
  |  Branch (4167:18): [True: 107, False: 1.48k]
  ------------------
 4168|       |				/* Propagate any potential error conditions
 4169|       |				 * to the caller. */
 4170|    107|				return ret;
 4171|    107|			}
 4172|  1.58k|		}
 4173|  4.01k|	} else {
 4174|       |		/* In standard archives, we can just jump over the compressed
 4175|       |		 * stream. Each file in non-solid archives starts from an empty
 4176|       |		 * window buffer. */
 4177|       |
 4178|  4.01k|		if(ARCHIVE_OK != consume(a, rar->file.bytes_remaining)) {
  ------------------
  |  |  192|  4.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4178:6): [True: 1, False: 4.01k]
  ------------------
 4179|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4180|      1|		}
 4181|       |
 4182|  4.01k|		rar->file.bytes_remaining = 0;
 4183|  4.01k|	}
 4184|       |
 4185|  7.31k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  7.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4186|  7.41k|}
archive_read_support_format_rar5.c:rar5_seek_data:
 4190|     12|{
 4191|     12|	(void) a;
 4192|     12|	(void) offset;
 4193|     12|	(void) whence;
 4194|       |
 4195|       |	/* We're a streaming unpacker, and we don't support seeking. */
 4196|       |
 4197|     12|	return ARCHIVE_FATAL;
  ------------------
  |  |  198|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4198|     12|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4200|    238|static int rar5_cleanup(struct archive_read *a) {
 4201|    238|	struct rar5* rar = get_context(a);
 4202|       |
 4203|    238|	free(rar->cstate.window_buf);
 4204|    238|	free(rar->cstate.filtered_buf);
 4205|    238|	clear_data_ready_stack(rar);
 4206|       |
 4207|    238|	free(rar->vol.push_buf);
 4208|       |
 4209|    238|	free_filters(rar);
 4210|    238|	cdeque_free(&rar->cstate.filters);
 4211|       |
 4212|    238|	free(rar);
 4213|    238|	a->format->data = NULL;
 4214|       |
 4215|    238|	return ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4216|    238|}
archive_read_support_format_rar5.c:cdeque_free:
  469|    238|static void cdeque_free(struct cdeque* d) {
  470|    238|	if(!d)
  ------------------
  |  Branch (470:5): [True: 0, False: 238]
  ------------------
  471|      0|		return;
  472|       |
  473|    238|	if(!d->arr)
  ------------------
  |  Branch (473:5): [True: 0, False: 238]
  ------------------
  474|      0|		return;
  475|       |
  476|    238|	free(d->arr);
  477|       |
  478|    238|	d->arr = NULL;
  479|    238|	d->beg_pos = -1;
  480|    238|	d->end_pos = -1;
  481|    238|	d->cap_mask = 0;
  482|    238|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4218|     54|static int rar5_capabilities(struct archive_read * a) {
 4219|     54|	(void) a;
 4220|     54|	return 0;
 4221|     54|}

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

archive_read_support_format_gnutar:
  244|    238|{
  245|    238|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  246|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_gnutar");
  247|    238|	return (archive_read_support_format_tar(a));
  248|    238|}
archive_read_support_format_tar:
  253|    476|{
  254|    476|	struct archive_read *a = (struct archive_read *)_a;
  255|    476|	struct tar *tar;
  256|    476|	int r;
  257|       |
  258|    476|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    476|	do { \
  |  |  152|    476|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    476|			(allowed_states), (function_name)); \
  |  |  154|    476|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    476|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 476]
  |  |  ------------------
  |  |  155|    476|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    476|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  259|    476|	    ARCHIVE_STATE_NEW, "archive_read_support_format_tar");
  260|       |
  261|    476|	tar = (struct tar *)calloc(1, sizeof(*tar));
  262|    476|	if (tar == NULL) {
  ------------------
  |  Branch (262:6): [True: 0, False: 476]
  ------------------
  263|      0|		archive_set_error(&a->archive, ENOMEM,
  264|      0|		    "Can't allocate tar data");
  265|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  266|      0|	}
  267|       |#ifdef HAVE_COPYFILE_H
  268|       |	/* Set this by default on Mac OS. */
  269|       |	tar->process_mac_extensions = 1;
  270|       |#endif
  271|       |
  272|    476|	r = __archive_read_register_format(a, tar, "tar",
  273|    476|	    archive_read_format_tar_bid,
  274|    476|	    archive_read_format_tar_options,
  275|    476|	    archive_read_format_tar_read_header,
  276|    476|	    archive_read_format_tar_read_data,
  277|    476|	    archive_read_format_tar_skip,
  278|    476|	    NULL,
  279|    476|	    archive_read_format_tar_cleanup,
  280|    476|	    NULL,
  281|    476|	    NULL);
  282|       |
  283|    476|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (283:6): [True: 238, False: 238]
  ------------------
  284|    238|		free(tar);
  285|    476|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  286|    476|}
archive_read_support_format_tar.c:archive_read_format_tar_cleanup:
  290|    238|{
  291|    238|	struct tar *tar;
  292|       |
  293|    238|	tar = (struct tar *)(a->format->data);
  294|    238|	gnu_clear_sparse_list(tar);
  295|    238|	archive_string_free(&tar->entry_pathname);
  296|    238|	archive_string_free(&tar->entry_pathname_override);
  297|    238|	archive_string_free(&tar->entry_uname);
  298|    238|	archive_string_free(&tar->entry_gname);
  299|    238|	archive_string_free(&tar->line);
  300|    238|	archive_string_free(&tar->pax_global);
  301|    238|	archive_string_free(&tar->longname);
  302|    238|	archive_string_free(&tar->localname);
  303|    238|	free(tar);
  304|    238|	(a->format->data) = NULL;
  305|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  306|    238|}
archive_read_support_format_tar.c:gnu_clear_sparse_list:
 2930|   291k|{
 2931|   291k|	struct sparse_block *p;
 2932|       |
 2933|   582k|	while (tar->sparse_list != NULL) {
  ------------------
  |  Branch (2933:9): [True: 290k, False: 291k]
  ------------------
 2934|   290k|		p = tar->sparse_list;
 2935|   290k|		tar->sparse_list = p->next;
 2936|   290k|		free(p);
 2937|   290k|	}
 2938|   291k|	tar->sparse_last = NULL;
 2939|   291k|}
archive_read_support_format_tar.c:archive_read_format_tar_bid:
  362|    236|{
  363|    236|	int bid;
  364|    236|	const char *h;
  365|    236|	const struct archive_entry_header_ustar *header;
  366|       |
  367|    236|	(void)best_bid; /* UNUSED */
  368|       |
  369|    236|	bid = 0;
  370|       |
  371|       |	/* Now let's look at the actual header and see if it matches. */
  372|    236|	h = __archive_read_ahead(a, 512, NULL);
  373|    236|	if (h == NULL)
  ------------------
  |  Branch (373:6): [True: 5, False: 231]
  ------------------
  374|      5|		return (-1);
  375|       |
  376|       |	/* If it's an end-of-archive mark, we can handle it. */
  377|    231|	if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (377:6): [True: 27, False: 204]
  |  Branch (377:19): [True: 20, False: 7]
  ------------------
  378|       |		/*
  379|       |		 * Usually, I bid the number of bits verified, but
  380|       |		 * in this case, 4096 seems excessive so I picked 10 as
  381|       |		 * an arbitrary but reasonable-seeming value.
  382|       |		 */
  383|     20|		return (10);
  384|     20|	}
  385|       |
  386|       |	/* If it's not an end-of-archive mark, it must have a valid checksum.*/
  387|    211|	if (!checksum(a, h))
  ------------------
  |  Branch (387:6): [True: 206, False: 5]
  ------------------
  388|    206|		return (0);
  389|      5|	bid += 48;  /* Checksum is usually 6 octal digits. */
  390|       |
  391|      5|	header = (const struct archive_entry_header_ustar *)h;
  392|       |
  393|       |	/* Recognize POSIX formats. */
  394|      5|	if ((memcmp(header->magic, "ustar\0", 6) == 0)
  ------------------
  |  Branch (394:6): [True: 0, False: 5]
  ------------------
  395|      5|	    && (memcmp(header->version, "00", 2) == 0))
  ------------------
  |  Branch (395:9): [True: 0, False: 0]
  ------------------
  396|      0|		bid += 56;
  397|       |
  398|       |	/* Recognize GNU tar format. */
  399|      5|	if ((memcmp(header->magic, "ustar ", 6) == 0)
  ------------------
  |  Branch (399:6): [True: 1, False: 4]
  ------------------
  400|      5|	    && (memcmp(header->version, " \0", 2) == 0))
  ------------------
  |  Branch (400:9): [True: 1, False: 0]
  ------------------
  401|      1|		bid += 56;
  402|       |
  403|       |	/* Type flag must be null, digit or A-Z, a-z. */
  404|      5|	if (header->typeflag[0] != 0 &&
  ------------------
  |  Branch (404:6): [True: 1, False: 4]
  ------------------
  405|      5|	    !( header->typeflag[0] >= '0' && header->typeflag[0] <= '9') &&
  ------------------
  |  Branch (405:9): [True: 1, False: 0]
  |  Branch (405:39): [True: 1, False: 0]
  ------------------
  406|      5|	    !( header->typeflag[0] >= 'A' && header->typeflag[0] <= 'Z') &&
  ------------------
  |  Branch (406:9): [True: 0, False: 0]
  |  Branch (406:39): [True: 0, False: 0]
  ------------------
  407|      5|	    !( header->typeflag[0] >= 'a' && header->typeflag[0] <= 'z') )
  ------------------
  |  Branch (407:9): [True: 0, False: 0]
  |  Branch (407:39): [True: 0, False: 0]
  ------------------
  408|      0|		return (0);
  409|      5|	bid += 2;  /* 6 bits of variation in an 8-bit field leaves 2 bits. */
  410|       |
  411|       |	/*
  412|       |	 * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
  413|       |	 */
  414|      5|	if (validate_number_field(header->mode, sizeof(header->mode)) == 0
  ------------------
  |  Branch (414:6): [True: 0, False: 5]
  ------------------
  415|      5|	    || validate_number_field(header->uid, sizeof(header->uid)) == 0
  ------------------
  |  Branch (415:9): [True: 0, False: 5]
  ------------------
  416|      5|	    || validate_number_field(header->gid, sizeof(header->gid)) == 0
  ------------------
  |  Branch (416:9): [True: 0, False: 5]
  ------------------
  417|      5|	    || validate_number_field(header->mtime, sizeof(header->mtime)) == 0
  ------------------
  |  Branch (417:9): [True: 0, False: 5]
  ------------------
  418|      5|	    || validate_number_field(header->size, sizeof(header->size)) == 0
  ------------------
  |  Branch (418:9): [True: 0, False: 5]
  ------------------
  419|      5|	    || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
  ------------------
  |  Branch (419:9): [True: 0, False: 5]
  ------------------
  420|      5|	    || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0) {
  ------------------
  |  Branch (420:9): [True: 0, False: 5]
  ------------------
  421|      0|		bid = 0;
  422|      0|	}
  423|       |
  424|      5|	return (bid);
  425|      5|}
archive_read_support_format_tar.c:archive_block_is_null:
 1022|  16.4k|{
 1023|  16.4k|	unsigned i;
 1024|       |
 1025|  8.34M|	for (i = 0; i < 512; i++)
  ------------------
  |  Branch (1025:14): [True: 8.33M, False: 16.1k]
  ------------------
 1026|  8.33M|		if (*p++)
  ------------------
  |  Branch (1026:7): [True: 311, False: 8.33M]
  ------------------
 1027|    311|			return (0);
 1028|  16.1k|	return (1);
 1029|  16.4k|}
archive_read_support_format_tar.c:checksum:
  967|   291k|{
  968|   291k|	const unsigned char *bytes;
  969|   291k|	const struct archive_entry_header_ustar	*header;
  970|   291k|	int check, sum;
  971|   291k|	size_t i;
  972|       |
  973|   291k|	(void)a; /* UNUSED */
  974|   291k|	bytes = (const unsigned char *)h;
  975|   291k|	header = (const struct archive_entry_header_ustar *)h;
  976|       |
  977|       |	/* Checksum field must hold an octal number */
  978|   295k|	for (i = 0; i < sizeof(header->checksum); ++i) {
  ------------------
  |  Branch (978:14): [True: 295k, False: 544]
  ------------------
  979|   295k|		char c = header->checksum[i];
  980|   295k|		if (c != ' ' && c != '\0' && (c < '0' || c > '7'))
  ------------------
  |  Branch (980:7): [True: 293k, False: 1.60k]
  |  Branch (980:19): [True: 290k, False: 2.67k]
  |  Branch (980:33): [True: 97, False: 290k]
  |  Branch (980:44): [True: 290k, False: 274]
  ------------------
  981|   290k|			return 0;
  982|   295k|	}
  983|       |
  984|       |	/*
  985|       |	 * Test the checksum.  Note that POSIX specifies _unsigned_
  986|       |	 * bytes for this calculation.
  987|       |	 */
  988|    544|	sum = (int)tar_atol(header->checksum, sizeof(header->checksum));
  989|    544|	check = 0;
  990|  81.0k|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (990:14): [True: 80.5k, False: 544]
  ------------------
  991|  80.5k|		check += (unsigned char)bytes[i];
  992|  4.89k|	for (; i < 156; i++)
  ------------------
  |  Branch (992:9): [True: 4.35k, False: 544]
  ------------------
  993|  4.35k|		check += 32;
  994|   194k|	for (; i < 512; i++)
  ------------------
  |  Branch (994:9): [True: 193k, False: 544]
  ------------------
  995|   193k|		check += (unsigned char)bytes[i];
  996|    544|	if (sum == check)
  ------------------
  |  Branch (996:6): [True: 2, False: 542]
  ------------------
  997|      2|		return (1);
  998|       |
  999|       |	/*
 1000|       |	 * Repeat test with _signed_ bytes, just in case this archive
 1001|       |	 * was created by an old BSD, Solaris, or HP-UX tar with a
 1002|       |	 * broken checksum calculation.
 1003|       |	 */
 1004|    542|	check = 0;
 1005|  80.7k|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1005:14): [True: 80.2k, False: 542]
  ------------------
 1006|  80.2k|		check += (signed char)bytes[i];
 1007|  4.87k|	for (; i < 156; i++)
  ------------------
  |  Branch (1007:9): [True: 4.33k, False: 542]
  ------------------
 1008|  4.33k|		check += 32;
 1009|   193k|	for (; i < 512; i++)
  ------------------
  |  Branch (1009:9): [True: 192k, False: 542]
  ------------------
 1010|   192k|		check += (signed char)bytes[i];
 1011|    542|	if (sum == check)
  ------------------
  |  Branch (1011:6): [True: 8, False: 534]
  ------------------
 1012|      8|		return (1);
 1013|       |
 1014|    534|	return (0);
 1015|    542|}
archive_read_support_format_tar.c:tar_atol:
 3253|    576|{
 3254|       |	/*
 3255|       |	 * Technically, GNU tar considers a field to be in base-256
 3256|       |	 * only if the first byte is 0xff or 0x80.
 3257|       |	 */
 3258|    576|	if (*p & 0x80)
  ------------------
  |  Branch (3258:6): [True: 0, False: 576]
  ------------------
 3259|      0|		return (tar_atol256(p, char_cnt));
 3260|    576|	return (tar_atol8(p, char_cnt));
 3261|    576|}
archive_read_support_format_tar.c:tar_atol8:
 3314|    576|{
 3315|    576|	return tar_atol_base_n(p, char_cnt, 8);
 3316|    576|}
archive_read_support_format_tar.c:tar_atol_base_n:
 3270|    576|{
 3271|    576|	int64_t	l, maxval, limit, last_digit_limit;
 3272|    576|	int digit, sign;
 3273|       |
 3274|    576|	maxval = INT64_MAX;
 3275|    576|	limit = INT64_MAX / base;
 3276|    576|	last_digit_limit = INT64_MAX % base;
 3277|       |
 3278|       |	/* the pointer will not be dereferenced if char_cnt is zero
 3279|       |	 * due to the way the && operator is evaluated.
 3280|       |	 */
 3281|  2.17k|	while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (3281:9): [True: 1.97k, False: 200]
  |  Branch (3281:27): [True: 1.60k, False: 376]
  |  Branch (3281:40): [True: 0, False: 376]
  ------------------
 3282|  1.60k|		p++;
 3283|  1.60k|		char_cnt--;
 3284|  1.60k|	}
 3285|       |
 3286|    576|	sign = 1;
 3287|    576|	if (char_cnt != 0 && *p == '-') {
  ------------------
  |  Branch (3287:6): [True: 376, False: 200]
  |  Branch (3287:23): [True: 0, False: 376]
  ------------------
 3288|      0|		sign = -1;
 3289|      0|		p++;
 3290|      0|		char_cnt--;
 3291|       |
 3292|      0|		maxval = INT64_MIN;
 3293|      0|		limit = -(INT64_MIN / base);
 3294|      0|		last_digit_limit = -(INT64_MIN % base);
 3295|      0|	}
 3296|       |
 3297|    576|	l = 0;
 3298|    576|	if (char_cnt != 0) {
  ------------------
  |  Branch (3298:6): [True: 376, False: 200]
  ------------------
 3299|    376|		digit = *p - '0';
 3300|    606|		while (digit >= 0 && digit < base  && char_cnt != 0) {
  ------------------
  |  Branch (3300:10): [True: 250, False: 356]
  |  Branch (3300:24): [True: 250, False: 0]
  |  Branch (3300:41): [True: 230, False: 20]
  ------------------
 3301|    230|			if (l>limit || (l == limit && digit >= last_digit_limit)) {
  ------------------
  |  Branch (3301:8): [True: 0, False: 230]
  |  Branch (3301:20): [True: 0, False: 230]
  |  Branch (3301:34): [True: 0, False: 0]
  ------------------
 3302|      0|				return maxval; /* Truncate on overflow. */
 3303|      0|			}
 3304|    230|			l = (l * base) + digit;
 3305|    230|			digit = *++p - '0';
 3306|    230|			char_cnt--;
 3307|    230|		}
 3308|    376|	}
 3309|    576|	return (sign < 0) ? -l : l;
  ------------------
  |  Branch (3309:9): [True: 0, False: 576]
  ------------------
 3310|    576|}
archive_read_support_format_tar.c:validate_number_field:
  333|     35|{
  334|     35|	unsigned char marker = (unsigned char)p_field[0];
  335|     35|	if (marker == 128 || marker == 255 || marker == 0) {
  ------------------
  |  Branch (335:6): [True: 0, False: 35]
  |  Branch (335:23): [True: 0, False: 35]
  |  Branch (335:40): [True: 30, False: 5]
  ------------------
  336|       |		/* Base-256 marker, there's nothing we can check. */
  337|     30|		return 1;
  338|     30|	} else {
  339|       |		/* Must be octal */
  340|      5|		size_t i = 0;
  341|       |		/* Skip any leading spaces */
  342|      5|		while (i < i_size && p_field[i] == ' ') {
  ------------------
  |  Branch (342:10): [True: 5, False: 0]
  |  Branch (342:24): [True: 0, False: 5]
  ------------------
  343|      0|			++i;
  344|      0|		}
  345|       |		/* Skip octal digits. */
  346|     48|		while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
  ------------------
  |  Branch (346:10): [True: 48, False: 0]
  |  Branch (346:24): [True: 43, False: 5]
  |  Branch (346:45): [True: 43, False: 0]
  ------------------
  347|     43|			++i;
  348|     43|		}
  349|       |		/* Any remaining characters must be space or NUL padding. */
  350|     10|		while (i < i_size) {
  ------------------
  |  Branch (350:10): [True: 5, False: 5]
  ------------------
  351|      5|			if (p_field[i] != ' ' && p_field[i] != 0) {
  ------------------
  |  Branch (351:8): [True: 5, False: 0]
  |  Branch (351:29): [True: 0, False: 5]
  ------------------
  352|      0|				return 0;
  353|      0|			}
  354|      5|			++i;
  355|      5|		}
  356|      5|		return 1;
  357|      5|	}
  358|     35|}
archive_read_support_format_tar.c:archive_read_format_tar_options:
  430|    476|{
  431|    476|	struct tar *tar;
  432|    476|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  196|    476|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  433|       |
  434|    476|	tar = (struct tar *)(a->format->data);
  435|    476|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (435:6): [True: 0, False: 476]
  ------------------
  436|       |		/* Handle UTF-8 filenames as libarchive 2.x */
  437|      0|		tar->compat_2x = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (437:21): [True: 0, False: 0]
  |  Branch (437:36): [True: 0, False: 0]
  ------------------
  438|      0|		tar->init_default_conversion = tar->compat_2x;
  439|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  440|    476|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (440:13): [True: 0, False: 476]
  ------------------
  441|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (441:7): [True: 0, False: 0]
  |  Branch (441:22): [True: 0, False: 0]
  ------------------
  442|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  443|      0|			    "tar: hdrcharset option needs a character-set name");
  444|      0|		else {
  445|      0|			tar->opt_sconv =
  446|      0|			    archive_string_conversion_from_charset(
  447|      0|				&a->archive, val, 0);
  448|      0|			if (tar->opt_sconv != NULL)
  ------------------
  |  Branch (448:8): [True: 0, False: 0]
  ------------------
  449|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  450|      0|			else
  451|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  452|      0|		}
  453|      0|		return (ret);
  454|    476|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (454:13): [True: 238, False: 238]
  ------------------
  455|    238|		tar->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (455:34): [True: 238, False: 0]
  |  Branch (455:49): [True: 238, False: 0]
  ------------------
  456|    238|		return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  457|    238|	} else if (strcmp(key, "read_concatenated_archives") == 0) {
  ------------------
  |  Branch (457:13): [True: 238, False: 0]
  ------------------
  458|    238|		tar->read_concatenated_archives = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (458:38): [True: 238, False: 0]
  |  Branch (458:53): [True: 238, False: 0]
  ------------------
  459|    238|		return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  460|    238|	}
  461|       |
  462|       |	/* Note: The "warn" return is just to inform the options
  463|       |	 * supervisor that we didn't handle it.  It will generate
  464|       |	 * a suitable error if no one used this option. */
  465|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  466|    476|}
archive_read_support_format_tar.c:archive_read_format_tar_read_header:
  498|   290k|{
  499|       |	/*
  500|       |	 * When converting tar archives to cpio archives, it is
  501|       |	 * essential that each distinct file have a distinct inode
  502|       |	 * number.  To simplify this, we keep a static count here to
  503|       |	 * assign fake dev/inode numbers to each tar entry.  Note that
  504|       |	 * pax format archives may overwrite this with something more
  505|       |	 * useful.
  506|       |	 *
  507|       |	 * Ideally, we would track every file read from the archive so
  508|       |	 * that we could assign the same dev/ino pair to hardlinks,
  509|       |	 * but the memory required to store a complete lookup table is
  510|       |	 * probably not worthwhile just to support the relatively
  511|       |	 * obscure tar->cpio conversion case.
  512|       |	 */
  513|       |	/* TODO: Move this into `struct tar` to avoid conflicts
  514|       |	 * when reading multiple archives */
  515|   290k|	static int default_inode;
  516|   290k|	static int default_dev;
  517|   290k|	struct tar *tar;
  518|   290k|	const char *p;
  519|   290k|	const wchar_t *wp;
  520|   290k|	int r;
  521|   290k|	size_t l, unconsumed = 0;
  522|       |
  523|       |	/* Assign default device/inode values. */
  524|   290k|	archive_entry_set_dev(entry, 1 + default_dev); /* Don't use zero. */
  525|   290k|	archive_entry_set_ino(entry, ++default_inode); /* Don't use zero. */
  526|       |	/* Limit generated st_ino number to 16 bits. */
  527|   290k|	if (default_inode >= 0xffff) {
  ------------------
  |  Branch (527:6): [True: 4, False: 290k]
  ------------------
  528|      4|		++default_dev;
  529|      4|		default_inode = 0;
  530|      4|	}
  531|       |
  532|   290k|	tar = (struct tar *)(a->format->data);
  533|   290k|	tar->entry_offset = 0;
  534|   290k|	gnu_clear_sparse_list(tar);
  535|   290k|	tar->realsize = -1; /* Mark this as "unset" */
  536|   290k|	tar->realsize_override = 0;
  537|       |
  538|       |	/* Setup default string conversion. */
  539|   290k|	tar->sconv = tar->opt_sconv;
  540|   290k|	if (tar->sconv == NULL) {
  ------------------
  |  Branch (540:6): [True: 290k, False: 0]
  ------------------
  541|   290k|		if (!tar->init_default_conversion) {
  ------------------
  |  Branch (541:7): [True: 10, False: 290k]
  ------------------
  542|     10|			tar->sconv_default =
  543|     10|			    archive_string_default_conversion_for_read(&(a->archive));
  544|     10|			tar->init_default_conversion = 1;
  545|     10|		}
  546|   290k|		tar->sconv = tar->sconv_default;
  547|   290k|	}
  548|       |
  549|   290k|	r = tar_read_header(a, tar, entry, &unconsumed);
  550|       |
  551|   290k|	tar_flush_unconsumed(a, &unconsumed);
  552|       |
  553|       |	/*
  554|       |	 * "non-sparse" files are really just sparse files with
  555|       |	 * a single block.
  556|       |	 */
  557|   290k|	if (tar->sparse_list == NULL) {
  ------------------
  |  Branch (557:6): [True: 290k, False: 0]
  ------------------
  558|   290k|		if (gnu_add_sparse_entry(a, tar, 0, tar->entry_bytes_remaining)
  ------------------
  |  Branch (558:7): [True: 0, False: 290k]
  ------------------
  559|   290k|		    != ARCHIVE_OK)
  ------------------
  |  |  192|   290k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  560|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|   290k|	} else {
  562|      0|		struct sparse_block *sb;
  563|       |
  564|      0|		for (sb = tar->sparse_list; sb != NULL; sb = sb->next) {
  ------------------
  |  Branch (564:31): [True: 0, False: 0]
  ------------------
  565|      0|			if (!sb->hole)
  ------------------
  |  Branch (565:8): [True: 0, False: 0]
  ------------------
  566|      0|				archive_entry_sparse_add_entry(entry,
  567|      0|				    sb->offset, sb->remaining);
  568|      0|		}
  569|      0|	}
  570|       |
  571|   290k|	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  192|   581k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  185|      5|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (571:6): [True: 5, False: 290k]
  |  Branch (571:25): [True: 5, False: 0]
  ------------------
  572|       |		/*
  573|       |		 * "Regular" entry with trailing '/' is really
  574|       |		 * directory: This is needed for certain old tar
  575|       |		 * variants and even for some broken newer ones.
  576|       |		 */
  577|      5|		if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (577:7): [True: 5, False: 0]
  ------------------
  578|      5|			l = wcslen(wp);
  579|      5|			if (l > 0 && wp[l - 1] == L'/') {
  ------------------
  |  Branch (579:8): [True: 5, False: 0]
  |  Branch (579:17): [True: 0, False: 5]
  ------------------
  580|      0|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  581|      0|				tar->entry_bytes_remaining = 0;
  582|      0|				tar->entry_padding = 0;
  583|      0|			}
  584|      5|		} else if ((p = archive_entry_pathname(entry)) != NULL) {
  ------------------
  |  Branch (584:14): [True: 0, False: 0]
  ------------------
  585|      0|			l = strlen(p);
  586|      0|			if (l > 0 && p[l - 1] == '/') {
  ------------------
  |  Branch (586:8): [True: 0, False: 0]
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  588|      0|				tar->entry_bytes_remaining = 0;
  589|      0|				tar->entry_padding = 0;
  590|      0|			}
  591|      0|		}
  592|      5|	}
  593|   290k|	return (r);
  594|   290k|}
archive_read_support_format_tar.c:tar_read_header:
  705|   290k|{
  706|   290k|	ssize_t bytes;
  707|   290k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  192|   290k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  708|   290k|	int eof_fatal = 0; /* EOF is okay at some points... */
  709|   290k|	const char *h;
  710|   290k|	const struct archive_entry_header_ustar *header;
  711|   290k|	const struct archive_entry_header_gnutar *gnuheader;
  712|       |
  713|       |	/* Bitmask of what header types we've seen. */
  714|   290k|	int32_t seen_headers = 0;
  715|   290k|	static const int32_t seen_A_header = 1;
  716|   290k|	static const int32_t seen_g_header = 2;
  717|   290k|	static const int32_t seen_K_header = 4;
  718|   290k|	static const int32_t seen_L_header = 8;
  719|   290k|	static const int32_t seen_V_header = 16;
  720|   290k|	static const int32_t seen_x_header = 32; /* Also X */
  721|   290k|	static const int32_t seen_mac_metadata = 512;
  722|       |
  723|   290k|	tar->pax_hdrcharset_utf8 = 1;
  724|   290k|	tar->sparse_gnu_attributes_seen = 0;
  725|   290k|	archive_string_empty(&(tar->entry_gname));
  ------------------
  |  |  181|   290k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  726|   290k|	archive_string_empty(&(tar->entry_pathname));
  ------------------
  |  |  181|   290k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  727|   290k|	archive_string_empty(&(tar->entry_pathname_override));
  ------------------
  |  |  181|   290k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  728|   290k|	archive_string_empty(&(tar->entry_uname));
  ------------------
  |  |  181|   290k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  729|       |
  730|       |	/* Ensure format is set. */
  731|   290k|	if (a->archive.archive_format_name == NULL) {
  ------------------
  |  Branch (731:6): [True: 10, False: 290k]
  ------------------
  732|     10|		a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  326|     10|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  733|     10|		a->archive.archive_format_name = "tar";
  734|     10|	}
  735|       |
  736|       |	/*
  737|       |	 * TODO: Write global/default pax options into
  738|       |	 * 'entry' struct here before overwriting with
  739|       |	 * file-specific options.
  740|       |	 */
  741|       |
  742|       |	/* Loop over all the headers needed for the next entry */
  743|   290k|	for (;;) {
  744|       |
  745|       |		/* Find the next valid header record. */
  746|   307k|		while (1) {
  ------------------
  |  Branch (746:10): [Folded - Ignored]
  ------------------
  747|   307k|			tar_flush_unconsumed(a, unconsumed);
  748|       |
  749|       |			/* Read 512-byte header record */
  750|   307k|			h = __archive_read_ahead(a, 512, &bytes);
  751|   307k|			if (bytes < 0)
  ------------------
  |  Branch (751:8): [True: 1, False: 307k]
  ------------------
  752|      1|				return ((int)bytes);
  753|   307k|			if (bytes == 0) { /* EOF at a block boundary. */
  ------------------
  |  Branch (753:8): [True: 4, False: 307k]
  ------------------
  754|      4|				if (eof_fatal) {
  ------------------
  |  Branch (754:9): [True: 0, False: 4]
  ------------------
  755|       |					/* We've read a special header already;
  756|       |					 * if there's no regular header, then this is
  757|       |					 * a premature EOF. */
  758|      0|					archive_set_error(&a->archive, EINVAL,
  759|      0|							  "Damaged tar archive");
  760|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  761|      4|				} else {
  762|      4|					return (ARCHIVE_EOF);
  ------------------
  |  |  191|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  763|      4|				}
  764|      4|			}
  765|   307k|			if (bytes < 512) {  /* Short block at EOF; this is bad. */
  ------------------
  |  Branch (765:8): [True: 5, False: 307k]
  ------------------
  766|      5|				archive_set_error(&a->archive,
  767|      5|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  768|      5|				    "Truncated tar archive"
  769|      5|				    " detected while reading next heaader");
  770|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  771|      5|			}
  772|   307k|			*unconsumed += 512;
  773|       |
  774|   307k|			if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (774:8): [True: 16.4k, False: 290k]
  |  Branch (774:21): [True: 16.1k, False: 304]
  ------------------
  775|       |				/* We found a NULL block which indicates end-of-archive */
  776|       |
  777|  16.1k|				if (tar->read_concatenated_archives) {
  ------------------
  |  Branch (777:9): [True: 16.1k, False: 0]
  ------------------
  778|       |					/* We're ignoring NULL blocks, so keep going. */
  779|  16.1k|					continue;
  780|  16.1k|				}
  781|       |
  782|       |				/* Try to consume a second all-null record, as well. */
  783|       |				/* If we can't, that's okay. */
  784|      0|				tar_flush_unconsumed(a, unconsumed);
  785|      0|				h = __archive_read_ahead(a, 512, NULL);
  786|      0|				if (h != NULL && h[0] == 0 && archive_block_is_null(h))
  ------------------
  |  Branch (786:9): [True: 0, False: 0]
  |  Branch (786:22): [True: 0, False: 0]
  |  Branch (786:35): [True: 0, False: 0]
  ------------------
  787|      0|						__archive_read_consume(a, 512);
  788|       |
  789|      0|				archive_clear_error(&a->archive);
  790|      0|				return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  791|  16.1k|			}
  792|       |
  793|       |			/* This is NOT a null block, so it must be a valid header. */
  794|   290k|			if (!checksum(a, h)) {
  ------------------
  |  Branch (794:8): [True: 290k, False: 5]
  ------------------
  795|   290k|				tar_flush_unconsumed(a, unconsumed);
  796|   290k|				archive_set_error(&a->archive, EINVAL, "Damaged tar archive");
  797|       |				/* If we've read some critical information (pax headers, etc)
  798|       |				 * and _then_ see a bad header, we can't really recover. */
  799|   290k|				if (eof_fatal) {
  ------------------
  |  Branch (799:9): [True: 0, False: 290k]
  ------------------
  800|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  801|   290k|				} else {
  802|   290k|					return (ARCHIVE_RETRY);
  ------------------
  |  |  193|   290k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  803|   290k|				}
  804|   290k|			}
  805|      5|			break;
  806|   290k|		}
  807|       |
  808|       |		/* Determine the format variant. */
  809|      5|		header = (const struct archive_entry_header_ustar *)h;
  810|      5|		switch(header->typeflag[0]) {
  811|      0|		case 'A': /* Solaris tar ACL */
  ------------------
  |  Branch (811:3): [True: 0, False: 5]
  ------------------
  812|      0|			if (seen_headers & seen_A_header) {
  ------------------
  |  Branch (812:8): [True: 0, False: 0]
  ------------------
  813|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  814|      0|			}
  815|      0|			seen_headers |= seen_A_header;
  816|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  817|      0|			a->archive.archive_format_name = "Solaris tar";
  818|      0|			err2 = header_Solaris_ACL(a, tar, entry, h, unconsumed);
  819|      0|			break;
  820|      0|		case 'g': /* POSIX-standard 'g' header. */
  ------------------
  |  Branch (820:3): [True: 0, False: 5]
  ------------------
  821|      0|			if (seen_headers & seen_g_header) {
  ------------------
  |  Branch (821:8): [True: 0, False: 0]
  ------------------
  822|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  823|      0|			}
  824|      0|			seen_headers |= seen_g_header;
  825|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  826|      0|			a->archive.archive_format_name = "POSIX pax interchange format";
  827|      0|			err2 = header_pax_global(a, tar, entry, h, unconsumed);
  828|      0|			break;
  829|      0|		case 'K': /* Long link name (GNU tar, others) */
  ------------------
  |  Branch (829:3): [True: 0, False: 5]
  ------------------
  830|      0|			if (seen_headers & seen_K_header) {
  ------------------
  |  Branch (830:8): [True: 0, False: 0]
  ------------------
  831|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  832|      0|			}
  833|      0|			seen_headers |= seen_K_header;
  834|      0|			err2 = header_gnu_longlink(a, tar, entry, h, unconsumed);
  835|      0|			break;
  836|      0|		case 'L': /* Long filename (GNU tar, others) */
  ------------------
  |  Branch (836:3): [True: 0, False: 5]
  ------------------
  837|      0|			if (seen_headers & seen_L_header) {
  ------------------
  |  Branch (837:8): [True: 0, False: 0]
  ------------------
  838|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  839|      0|			}
  840|      0|			seen_headers |= seen_L_header;
  841|      0|			err2 = header_gnu_longname(a, tar, entry, h, unconsumed);
  842|      0|			break;
  843|      0|		case 'V': /* GNU volume header */
  ------------------
  |  Branch (843:3): [True: 0, False: 5]
  ------------------
  844|      0|			if (seen_headers & seen_V_header) {
  ------------------
  |  Branch (844:8): [True: 0, False: 0]
  ------------------
  845|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  846|      0|			}
  847|      0|			seen_headers |= seen_V_header;
  848|      0|			err2 = header_volume(a, tar, entry, h, unconsumed);
  849|      0|			break;
  850|      0|		case 'X': /* Used by SUN tar; same as 'x'. */
  ------------------
  |  Branch (850:3): [True: 0, False: 5]
  ------------------
  851|      0|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (851:8): [True: 0, False: 0]
  ------------------
  852|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  853|      0|			}
  854|      0|			seen_headers |= seen_x_header;
  855|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  856|      0|			a->archive.archive_format_name =
  857|      0|				"POSIX pax interchange format (Sun variant)";
  858|      0|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  859|      0|			break;
  860|      0|		case 'x': /* POSIX-standard 'x' header. */
  ------------------
  |  Branch (860:3): [True: 0, False: 5]
  ------------------
  861|      0|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (861:8): [True: 0, False: 0]
  ------------------
  862|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  863|      0|			}
  864|      0|			seen_headers |= seen_x_header;
  865|      0|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  866|      0|			a->archive.archive_format_name = "POSIX pax interchange format";
  867|      0|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  868|      0|			break;
  869|      5|		default: /* Regular header: Legacy tar, GNU tar, or ustar */
  ------------------
  |  Branch (869:3): [True: 5, False: 0]
  ------------------
  870|      5|			gnuheader = (const struct archive_entry_header_gnutar *)h;
  871|      5|			if (memcmp(gnuheader->magic, "ustar  \0", 8) == 0) {
  ------------------
  |  Branch (871:8): [True: 1, False: 4]
  ------------------
  872|      1|				a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  330|      1|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  326|      1|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  873|      1|				a->archive.archive_format_name = "GNU tar format";
  874|      1|				err2 = header_gnutar(a, tar, entry, h, unconsumed);
  875|      4|			} else if (memcmp(header->magic, "ustar", 5) == 0) {
  ------------------
  |  Branch (875:15): [True: 0, False: 4]
  ------------------
  876|      0|				if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (876:9): [True: 0, False: 0]
  ------------------
  877|      0|					a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR;
  ------------------
  |  |  327|      0|#define	ARCHIVE_FORMAT_TAR_USTAR		(ARCHIVE_FORMAT_TAR | 1)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  878|      0|					a->archive.archive_format_name = "POSIX ustar format";
  879|      0|				}
  880|      0|				err2 = header_ustar(a, tar, entry, h);
  881|      4|			} else {
  882|      4|				a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  326|      4|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  883|      4|				a->archive.archive_format_name = "tar (non-POSIX)";
  884|      4|				err2 = header_old_tar(a, tar, entry, h);
  885|      4|			}
  886|      5|			err = err_combine(err, err2);
  ------------------
  |  |  172|      5|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (172:27): [True: 0, False: 5]
  |  |  ------------------
  ------------------
  887|       |			/* We return warnings or success as-is.  Anything else is fatal. */
  888|      5|			if (err < ARCHIVE_WARN) {
  ------------------
  |  |  194|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (888:8): [True: 0, False: 5]
  ------------------
  889|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  890|      0|			}
  891|       |			/* Filename of the form `._filename` is an AppleDouble
  892|       |			 * extension entry.  The body is the macOS metadata blob;
  893|       |			 * this is followed by another entry with the actual
  894|       |			 * regular file data.
  895|       |			 * This design has two drawbacks:
  896|       |			 * = it's brittle; you might just have a file with such a name
  897|       |			 * = it duplicates any long pathname extensions
  898|       |			 *
  899|       |			 * TODO: This probably shouldn't be here at all.  Consider
  900|       |			 * just returning the contents as a regular entry here and
  901|       |			 * then dealing with it when we write data to disk.
  902|       |			 */
  903|      5|			if (tar->process_mac_extensions
  ------------------
  |  Branch (903:8): [True: 5, False: 0]
  ------------------
  904|      5|			    && ((seen_headers & seen_mac_metadata) == 0)
  ------------------
  |  Branch (904:11): [True: 5, False: 0]
  ------------------
  905|      5|			    && is_mac_metadata_entry(entry)) {
  ------------------
  |  Branch (905:11): [True: 0, False: 5]
  ------------------
  906|      0|				err2 = read_mac_metadata_blob(a, entry, unconsumed);
  907|      0|				if (err2 < ARCHIVE_WARN) {
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (907:9): [True: 0, False: 0]
  ------------------
  908|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  909|      0|				}
  910|      0|				err = err_combine(err, err2);
  ------------------
  |  |  172|      0|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (172:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  911|       |				/* Note: Other headers can appear again. */
  912|      0|				seen_headers = seen_mac_metadata;
  913|      0|				break;
  914|      0|			}
  915|       |
  916|       |			/* Reconcile GNU sparse attributes */
  917|      5|			if (tar->sparse_gnu_attributes_seen) {
  ------------------
  |  Branch (917:8): [True: 0, False: 5]
  ------------------
  918|       |				/* Only 'S' (GNU sparse) and ustar '0' regular files can be sparse */
  919|      0|				if (tar->filetype != 'S' && tar->filetype != '0') {
  ------------------
  |  Branch (919:9): [True: 0, False: 0]
  |  Branch (919:33): [True: 0, False: 0]
  ------------------
  920|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  921|      0|							  "Non-regular file cannot be sparse");
  922|      0|					return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  923|      0|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (923:16): [True: 0, False: 0]
  ------------------
  924|      0|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (924:9): [True: 0, False: 0]
  ------------------
  925|       |					/* Sparse map already parsed from 'x' header */
  926|      0|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (926:16): [True: 0, False: 0]
  ------------------
  927|      0|				    tar->sparse_gnu_minor == 1) {
  ------------------
  |  Branch (927:9): [True: 0, False: 0]
  ------------------
  928|       |					/* Sparse map already parsed from 'x' header */
  929|      0|				} else if (tar->sparse_gnu_major == 1 &&
  ------------------
  |  Branch (929:16): [True: 0, False: 0]
  ------------------
  930|      0|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (930:9): [True: 0, False: 0]
  ------------------
  931|       |					/* Sparse map is prepended to file contents */
  932|      0|					ssize_t bytes_read;
  933|      0|					bytes_read = gnu_sparse_10_read(a, tar, unconsumed);
  934|      0|					if (bytes_read < 0)
  ------------------
  |  Branch (934:10): [True: 0, False: 0]
  ------------------
  935|      0|						return ((int)bytes_read);
  936|      0|					tar->entry_bytes_remaining -= bytes_read;
  937|      0|				} else {
  938|      0|					archive_set_error(&a->archive,
  939|      0|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  940|      0|							  "Unrecognized GNU sparse file format");
  941|      0|					return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  942|      0|				}
  943|      0|			}
  944|      5|			return (err);
  945|      5|		}
  946|       |
  947|       |		/* We're between headers ... */
  948|      0|		err = err_combine(err, err2);
  ------------------
  |  |  172|      0|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (172:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  949|      0|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (949:7): [True: 0, False: 0]
  ------------------
  950|      0|			return (err);
  951|       |
  952|       |		/* The GNU volume header and the pax `g` global header
  953|       |		 * are both allowed to be the only header in an
  954|       |		 * archive.  If we've seen any other header, a
  955|       |		 * following EOF is fatal. */
  956|      0|		if ((seen_headers & ~seen_V_header & ~seen_g_header) != 0) {
  ------------------
  |  Branch (956:7): [True: 0, False: 0]
  ------------------
  957|      0|			eof_fatal = 1;
  958|      0|		}
  959|      0|	}
  960|   290k|}
archive_read_support_format_tar.c:header_gnutar:
 2805|      1|{
 2806|      1|	const struct archive_entry_header_gnutar *header;
 2807|      1|	int64_t t;
 2808|      1|	int err = ARCHIVE_OK;
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2809|       |
 2810|       |	/*
 2811|       |	 * GNU header is like POSIX ustar, except 'prefix' is
 2812|       |	 * replaced with some other fields. This also means the
 2813|       |	 * filename is stored as in old-style archives.
 2814|       |	 */
 2815|       |
 2816|       |	/* Grab fields common to all tar variants. */
 2817|      1|	err = header_common(a, tar, entry, h);
 2818|      1|	if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2818:6): [True: 0, False: 1]
  ------------------
 2819|      0|		return (err);
 2820|       |
 2821|       |	/* Copy filename over (to ensure null termination). */
 2822|      1|	header = (const struct archive_entry_header_gnutar *)h;
 2823|      1|	const char *existing_pathname = archive_entry_pathname(entry);
 2824|      1|	if (existing_pathname == NULL || existing_pathname[0] == '\0') {
  ------------------
  |  Branch (2824:6): [True: 1, False: 0]
  |  Branch (2824:35): [True: 0, False: 0]
  ------------------
 2825|      1|		if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|      1|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (2825:7): [True: 0, False: 1]
  ------------------
 2826|      1|		    header->name, sizeof(header->name), tar->sconv) != 0) {
 2827|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 2828|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2828:8): [True: 0, False: 0]
  ------------------
 2829|      0|				return (err);
 2830|      0|		}
 2831|      1|	}
 2832|       |
 2833|       |	/* Fields common to ustar and GNU */
 2834|       |	/* XXX Can the following be factored out since it's common
 2835|       |	 * to ustar and gnu tar?  Is it okay to move it down into
 2836|       |	 * header_common, perhaps?  */
 2837|      1|	const char *existing_uname = archive_entry_uname(entry);
 2838|      1|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (2838:6): [True: 1, False: 0]
  |  Branch (2838:32): [True: 0, False: 0]
  ------------------
 2839|      1|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|      1|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (2839:7): [True: 0, False: 1]
  ------------------
 2840|      1|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 2841|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 2842|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2842:8): [True: 0, False: 0]
  ------------------
 2843|      0|				return (err);
 2844|      0|		}
 2845|      1|	}
 2846|       |
 2847|      1|	const char *existing_gname = archive_entry_gname(entry);
 2848|      1|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (2848:6): [True: 1, False: 0]
  |  Branch (2848:32): [True: 0, False: 0]
  ------------------
 2849|      1|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|      1|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (2849:7): [True: 0, False: 1]
  ------------------
 2850|      1|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 2851|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 2852|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2852:8): [True: 0, False: 0]
  ------------------
 2853|      0|				return (err);
 2854|      0|		}
 2855|      1|	}
 2856|       |
 2857|       |	/* Parse out device numbers only for char and block specials */
 2858|      1|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (2858:6): [True: 0, False: 1]
  |  Branch (2858:36): [True: 0, False: 1]
  ------------------
 2859|      0|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (2859:7): [True: 0, False: 0]
  ------------------
 2860|      0|			archive_entry_set_rdevmajor(entry, (dev_t)
 2861|      0|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 2862|      0|			archive_entry_set_rdevminor(entry, (dev_t)
 2863|      0|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 2864|      0|		}
 2865|      1|	} else {
 2866|      1|		archive_entry_set_rdev(entry, 0);
 2867|      1|	}
 2868|       |
 2869|      1|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 2870|       |
 2871|       |	/* Grab GNU-specific fields. */
 2872|      1|	if (!archive_entry_atime_is_set(entry)) {
  ------------------
  |  Branch (2872:6): [True: 1, False: 0]
  ------------------
 2873|      1|		t = tar_atol(header->atime, sizeof(header->atime));
 2874|      1|		if (t > 0)
  ------------------
  |  Branch (2874:7): [True: 0, False: 1]
  ------------------
 2875|      0|			archive_entry_set_atime(entry, t, 0);
 2876|      1|	}
 2877|      1|	if (!archive_entry_ctime_is_set(entry)) {
  ------------------
  |  Branch (2877:6): [True: 1, False: 0]
  ------------------
 2878|      1|		t = tar_atol(header->ctime, sizeof(header->ctime));
 2879|      1|		if (t > 0)
  ------------------
  |  Branch (2879:7): [True: 0, False: 1]
  ------------------
 2880|      0|			archive_entry_set_ctime(entry, t, 0);
 2881|      1|	}
 2882|       |
 2883|      1|	if (header->realsize[0] != 0) {
  ------------------
  |  Branch (2883:6): [True: 0, False: 1]
  ------------------
 2884|      0|		tar->realsize
 2885|      0|		    = tar_atol(header->realsize, sizeof(header->realsize));
 2886|      0|		archive_entry_set_size(entry, tar->realsize);
 2887|      0|		tar->realsize_override = 1;
 2888|      0|	}
 2889|       |
 2890|      1|	if (header->sparse[0].offset[0] != 0) {
  ------------------
  |  Branch (2890:6): [True: 0, False: 1]
  ------------------
 2891|      0|		if (gnu_sparse_old_read(a, tar, header, unconsumed)
  ------------------
  |  Branch (2891:7): [True: 0, False: 0]
  ------------------
 2892|      0|		    != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2893|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2894|      1|	} else {
 2895|      1|		if (header->isextended[0] != 0) {
  ------------------
  |  Branch (2895:7): [True: 0, False: 1]
  ------------------
 2896|       |			/* XXX WTF? XXX */
 2897|      0|		}
 2898|      1|	}
 2899|       |
 2900|      1|	return (err);
 2901|      1|}
archive_read_support_format_tar.c:header_common:
 1294|      5|{
 1295|      5|	const struct archive_entry_header_ustar	*header;
 1296|      5|	const char *existing_linkpath;
 1297|      5|	const wchar_t *existing_wcs_linkpath;
 1298|      5|	int     err = ARCHIVE_OK;
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1299|       |
 1300|      5|	header = (const struct archive_entry_header_ustar *)h;
 1301|       |
 1302|       |	/* Parse out the numeric fields (all are octal) */
 1303|       |
 1304|       |	/* Split mode handling: Set filetype always, perm only if not already set */
 1305|      5|	archive_entry_set_filetype(entry,
 1306|      5|	    (mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1307|      5|	if (!archive_entry_perm_is_set(entry)) {
  ------------------
  |  Branch (1307:6): [True: 5, False: 0]
  ------------------
 1308|      5|		archive_entry_set_perm(entry,
 1309|      5|			(mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1310|      5|	}
 1311|      5|	if (!archive_entry_uid_is_set(entry)) {
  ------------------
  |  Branch (1311:6): [True: 5, False: 0]
  ------------------
 1312|      5|		archive_entry_set_uid(entry, tar_atol(header->uid, sizeof(header->uid)));
 1313|      5|	}
 1314|      5|	if (!archive_entry_gid_is_set(entry)) {
  ------------------
  |  Branch (1314:6): [True: 5, False: 0]
  ------------------
 1315|      5|		archive_entry_set_gid(entry, tar_atol(header->gid, sizeof(header->gid)));
 1316|      5|	}
 1317|       |
 1318|      5|	tar->entry_bytes_remaining = tar_atol(header->size, sizeof(header->size));
 1319|      5|	if (tar->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (1319:6): [True: 0, False: 5]
  ------------------
 1320|      0|		tar->entry_bytes_remaining = 0;
 1321|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1322|      0|		    "Tar entry has negative size");
 1323|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1324|      0|	}
 1325|      5|	if (tar->entry_bytes_remaining > entry_limit) {
  ------------------
  |  Branch (1325:6): [True: 0, False: 5]
  ------------------
 1326|      0|		tar->entry_bytes_remaining = 0;
 1327|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1328|      0|		    "Tar entry size overflow");
 1329|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1330|      0|	}
 1331|      5|	if (!tar->realsize_override) {
  ------------------
  |  Branch (1331:6): [True: 5, False: 0]
  ------------------
 1332|      5|		tar->realsize = tar->entry_bytes_remaining;
 1333|      5|	}
 1334|      5|	archive_entry_set_size(entry, tar->realsize);
 1335|       |
 1336|      5|	if (!archive_entry_mtime_is_set(entry)) {
  ------------------
  |  Branch (1336:6): [True: 5, False: 0]
  ------------------
 1337|      5|		archive_entry_set_mtime(entry, tar_atol(header->mtime, sizeof(header->mtime)), 0);
 1338|      5|	}
 1339|       |
 1340|       |	/* Handle the tar type flag appropriately. */
 1341|      5|	tar->filetype = header->typeflag[0];
 1342|       |
 1343|       |	/*
 1344|       |	 * TODO: If the linkpath came from Pax extension header, then
 1345|       |	 * we should obey the hdrcharset_utf8 flag when converting these.
 1346|       |	 */
 1347|      5|	switch (tar->filetype) {
 1348|      0|	case '1': /* Hard link */
  ------------------
  |  Branch (1348:2): [True: 0, False: 5]
  ------------------
 1349|      0|		archive_entry_set_link_to_hardlink(entry);
 1350|      0|		existing_wcs_linkpath = archive_entry_hardlink_w(entry);
 1351|      0|		existing_linkpath = archive_entry_hardlink(entry);
 1352|      0|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1352:8): [True: 0, False: 0]
  |  Branch (1352:37): [True: 0, False: 0]
  ------------------
 1353|      0|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1353:11): [True: 0, False: 0]
  |  Branch (1353:44): [True: 0, False: 0]
  ------------------
 1354|      0|			struct archive_string linkpath;
 1355|      0|			archive_string_init(&linkpath);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1356|      0|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1357|      0|					header->linkname, sizeof(header->linkname));
 1358|      0|			if (archive_entry_copy_hardlink_l(entry, linkpath.s,
  ------------------
  |  |   74|      0|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
  |  Branch (1358:8): [True: 0, False: 0]
  ------------------
 1359|      0|							  archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 1360|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1361|      0|								  "Linkname");
 1362|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1362:9): [True: 0, False: 0]
  ------------------
 1363|      0|					archive_string_free(&linkpath);
 1364|      0|					return (err);
 1365|      0|				}
 1366|      0|			}
 1367|      0|			archive_string_free(&linkpath);
 1368|      0|		}
 1369|       |		/*
 1370|       |		 * The following may seem odd, but: Technically, tar
 1371|       |		 * does not store the file type for a "hard link"
 1372|       |		 * entry, only the fact that it is a hard link.  So, I
 1373|       |		 * leave the type zero normally.  But, pax interchange
 1374|       |		 * format allows hard links to have data, which
 1375|       |		 * implies that the underlying entry is a regular
 1376|       |		 * file.
 1377|       |		 */
 1378|      0|		if (archive_entry_size(entry) > 0)
  ------------------
  |  Branch (1378:7): [True: 0, False: 0]
  ------------------
 1379|      0|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1380|       |
 1381|       |		/*
 1382|       |		 * A tricky point: Traditionally, tar readers have
 1383|       |		 * ignored the size field when reading hardlink
 1384|       |		 * entries, and some writers put non-zero sizes even
 1385|       |		 * though the body is empty.  POSIX blessed this
 1386|       |		 * convention in the 1988 standard, but broke with
 1387|       |		 * this tradition in 2001 by permitting hardlink
 1388|       |		 * entries to store valid bodies in pax interchange
 1389|       |		 * format, but not in ustar format.  Since there is no
 1390|       |		 * hard and fast way to distinguish pax interchange
 1391|       |		 * from earlier archives (the 'x' and 'g' entries are
 1392|       |		 * optional, after all), we need a heuristic.
 1393|       |		 */
 1394|      0|		if (archive_entry_size(entry) == 0) {
  ------------------
  |  Branch (1394:7): [True: 0, False: 0]
  ------------------
 1395|       |			/* If the size is already zero, we're done. */
 1396|      0|		}  else if (a->archive.archive_format
  ------------------
  |  Branch (1396:15): [True: 0, False: 0]
  ------------------
 1397|      0|		    == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  328|      0|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
 1398|       |			/* Definitely pax extended; must obey hardlink size. */
 1399|      0|		} else if (a->archive.archive_format == ARCHIVE_FORMAT_TAR
  ------------------
  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (1399:14): [True: 0, False: 0]
  ------------------
 1400|      0|		    || a->archive.archive_format == ARCHIVE_FORMAT_TAR_GNUTAR)
  ------------------
  |  |  330|      0|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  326|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (1400:10): [True: 0, False: 0]
  ------------------
 1401|      0|		{
 1402|       |			/* Old-style or GNU tar: we must ignore the size. */
 1403|      0|			archive_entry_set_size(entry, 0);
 1404|      0|			tar->entry_bytes_remaining = 0;
 1405|      0|		} else if (archive_read_format_tar_bid(a, 50) > 50) {
  ------------------
  |  Branch (1405:14): [True: 0, False: 0]
  ------------------
 1406|       |			/*
 1407|       |			 * We don't know if it's pax: If the bid
 1408|       |			 * function sees a valid ustar header
 1409|       |			 * immediately following, then let's ignore
 1410|       |			 * the hardlink size.
 1411|       |			 */
 1412|      0|			archive_entry_set_size(entry, 0);
 1413|      0|			tar->entry_bytes_remaining = 0;
 1414|      0|		}
 1415|       |		/*
 1416|       |		 * TODO: There are still two cases I'd like to handle:
 1417|       |		 *   = a ustar non-pax archive with a hardlink entry at
 1418|       |		 *     end-of-archive.  (Look for block of nulls following?)
 1419|       |		 *   = a pax archive that has not seen any pax headers
 1420|       |		 *     and has an entry which is a hardlink entry storing
 1421|       |		 *     a body containing an uncompressed tar archive.
 1422|       |		 * The first is worth addressing; I don't see any reliable
 1423|       |		 * way to deal with the second possibility.
 1424|       |		 */
 1425|      0|		break;
 1426|      0|	case '2': /* Symlink */
  ------------------
  |  Branch (1426:2): [True: 0, False: 5]
  ------------------
 1427|      0|		archive_entry_set_link_to_symlink(entry);
 1428|      0|		existing_wcs_linkpath = archive_entry_symlink_w(entry);
 1429|      0|		existing_linkpath = archive_entry_symlink(entry);
 1430|      0|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1430:8): [True: 0, False: 0]
  |  Branch (1430:37): [True: 0, False: 0]
  ------------------
 1431|      0|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1431:11): [True: 0, False: 0]
  |  Branch (1431:44): [True: 0, False: 0]
  ------------------
 1432|      0|			struct archive_string linkpath;
 1433|      0|			archive_string_init(&linkpath);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1434|      0|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1435|      0|					header->linkname, sizeof(header->linkname));
 1436|      0|			if (archive_entry_copy_symlink_l(entry, linkpath.s,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (1436:8): [True: 0, False: 0]
  ------------------
 1437|      0|			    archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 1438|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1439|      0|				    "Linkname");
 1440|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1440:9): [True: 0, False: 0]
  ------------------
 1441|      0|					archive_string_free(&linkpath);
 1442|      0|					return (err);
 1443|      0|				}
 1444|      0|			}
 1445|      0|			archive_string_free(&linkpath);
 1446|      0|		}
 1447|      0|		archive_entry_set_filetype(entry, AE_IFLNK);
  ------------------
  |  |  186|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1448|      0|		archive_entry_set_size(entry, 0);
 1449|      0|		tar->entry_bytes_remaining = 0;
 1450|      0|		break;
 1451|      0|	case '3': /* Character device */
  ------------------
  |  Branch (1451:2): [True: 0, False: 5]
  ------------------
 1452|      0|		archive_entry_set_filetype(entry, AE_IFCHR);
  ------------------
  |  |  188|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1453|      0|		archive_entry_set_size(entry, 0);
 1454|      0|		tar->entry_bytes_remaining = 0;
 1455|      0|		break;
 1456|      0|	case '4': /* Block device */
  ------------------
  |  Branch (1456:2): [True: 0, False: 5]
  ------------------
 1457|      0|		archive_entry_set_filetype(entry, AE_IFBLK);
  ------------------
  |  |  189|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1458|      0|		archive_entry_set_size(entry, 0);
 1459|      0|		tar->entry_bytes_remaining = 0;
 1460|      0|		break;
 1461|      0|	case '5': /* Dir */
  ------------------
  |  Branch (1461:2): [True: 0, False: 5]
  ------------------
 1462|      0|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1463|      0|		archive_entry_set_size(entry, 0);
 1464|      0|		tar->entry_bytes_remaining = 0;
 1465|      0|		break;
 1466|      0|	case '6': /* FIFO device */
  ------------------
  |  Branch (1466:2): [True: 0, False: 5]
  ------------------
 1467|      0|		archive_entry_set_filetype(entry, AE_IFIFO);
  ------------------
  |  |  191|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1468|      0|		archive_entry_set_size(entry, 0);
 1469|      0|		tar->entry_bytes_remaining = 0;
 1470|      0|		break;
 1471|      0|	case 'D': /* GNU incremental directory type */
  ------------------
  |  Branch (1471:2): [True: 0, False: 5]
  ------------------
 1472|       |		/*
 1473|       |		 * No special handling is actually required here.
 1474|       |		 * It might be nice someday to preprocess the file list and
 1475|       |		 * provide it to the client, though.
 1476|       |		 */
 1477|      0|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1478|      0|		break;
 1479|      0|	case 'M': /* GNU "Multi-volume" (remainder of file from last archive)*/
  ------------------
  |  Branch (1479:2): [True: 0, False: 5]
  ------------------
 1480|       |		/*
 1481|       |		 * As far as I can tell, this is just like a regular file
 1482|       |		 * entry, except that the contents should be _appended_ to
 1483|       |		 * the indicated file at the indicated offset.  This may
 1484|       |		 * require some API work to fully support.
 1485|       |		 */
 1486|      0|		break;
 1487|      0|	case 'N': /* Old GNU "long filename" entry. */
  ------------------
  |  Branch (1487:2): [True: 0, False: 5]
  ------------------
 1488|       |		/* The body of this entry is a script for renaming
 1489|       |		 * previously-extracted entries.  Ugh.  It will never
 1490|       |		 * be supported by libarchive. */
 1491|      0|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1492|      0|		break;
 1493|      0|	case 'S': /* GNU sparse files */
  ------------------
  |  Branch (1493:2): [True: 0, False: 5]
  ------------------
 1494|       |		/*
 1495|       |		 * Sparse files are really just regular files with
 1496|       |		 * sparse information in the extended area.
 1497|       |		 */
 1498|       |		/* FALLTHROUGH */
 1499|      1|	case '0': /* ustar "regular" file */
  ------------------
  |  Branch (1499:2): [True: 1, False: 4]
  ------------------
 1500|       |		/* FALLTHROUGH */
 1501|      5|	default: /* Non-standard file types */
  ------------------
  |  Branch (1501:2): [True: 4, False: 1]
  ------------------
 1502|       |		/*
 1503|       |		 * Per POSIX: non-recognized types should always be
 1504|       |		 * treated as regular files.
 1505|       |		 */
 1506|      5|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|      5|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1507|      5|		break;
 1508|      5|	}
 1509|      5|	return (err);
 1510|      5|}
archive_read_support_format_tar.c:header_old_tar:
 1518|      4|{
 1519|      4|	const struct archive_entry_header_ustar	*header;
 1520|      4|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1521|       |
 1522|       |	/* Copy filename over (to ensure null termination). */
 1523|      4|	header = (const struct archive_entry_header_ustar *)h;
 1524|      4|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|      4|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1524:6): [True: 0, False: 4]
  ------------------
 1525|      4|	    header->name, sizeof(header->name), tar->sconv) != 0) {
 1526|      0|		err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1527|      0|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1527:7): [True: 0, False: 0]
  ------------------
 1528|      0|			return (err);
 1529|      0|	}
 1530|       |
 1531|       |	/* Grab rest of common fields */
 1532|      4|	err2 = header_common(a, tar, entry, h);
 1533|      4|	if (err > err2)
  ------------------
  |  Branch (1533:6): [True: 0, False: 4]
  ------------------
 1534|      0|		err = err2;
 1535|       |
 1536|      4|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1537|      4|	return (err);
 1538|      4|}
archive_read_support_format_tar.c:is_mac_metadata_entry:
 1544|      5|is_mac_metadata_entry(struct archive_entry *entry) {
 1545|      5|	const char *p, *name;
 1546|      5|	const wchar_t *wp, *wname;
 1547|       |
 1548|      5|	wname = wp = archive_entry_pathname_w(entry);
 1549|      5|	if (wp != NULL) {
  ------------------
  |  Branch (1549:6): [True: 5, False: 0]
  ------------------
 1550|       |		/* Find the last path element. */
 1551|     13|		for (; *wp != L'\0'; ++wp) {
  ------------------
  |  Branch (1551:10): [True: 8, False: 5]
  ------------------
 1552|      8|			if (wp[0] == '/' && wp[1] != L'\0')
  ------------------
  |  Branch (1552:8): [True: 0, False: 8]
  |  Branch (1552:24): [True: 0, False: 0]
  ------------------
 1553|      0|				wname = wp + 1;
 1554|      8|		}
 1555|       |		/*
 1556|       |		 * If last path element starts with "._", then
 1557|       |		 * this is a Mac extension.
 1558|       |		 */
 1559|      5|		if (wname[0] == L'.' && wname[1] == L'_' && wname[2] != L'\0')
  ------------------
  |  Branch (1559:7): [True: 0, False: 5]
  |  Branch (1559:27): [True: 0, False: 0]
  |  Branch (1559:47): [True: 0, False: 0]
  ------------------
 1560|      0|			return 1;
 1561|      5|	} else {
 1562|       |		/* Find the last path element. */
 1563|      0|		name = p = archive_entry_pathname(entry);
 1564|      0|		if (p == NULL)
  ------------------
  |  Branch (1564:7): [True: 0, False: 0]
  ------------------
 1565|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1566|      0|		for (; *p != '\0'; ++p) {
  ------------------
  |  Branch (1566:10): [True: 0, False: 0]
  ------------------
 1567|      0|			if (p[0] == '/' && p[1] != '\0')
  ------------------
  |  Branch (1567:8): [True: 0, False: 0]
  |  Branch (1567:23): [True: 0, False: 0]
  ------------------
 1568|      0|				name = p + 1;
 1569|      0|		}
 1570|       |		/*
 1571|       |		 * If last path element starts with "._", then
 1572|       |		 * this is a Mac extension.
 1573|       |		 */
 1574|      0|		if (name[0] == '.' && name[1] == '_' && name[2] != '\0')
  ------------------
  |  Branch (1574:7): [True: 0, False: 0]
  |  Branch (1574:25): [True: 0, False: 0]
  |  Branch (1574:43): [True: 0, False: 0]
  ------------------
 1575|      0|			return 1;
 1576|      0|	}
 1577|       |	/* Not a mac extension */
 1578|      5|	return 0;
 1579|      5|}
archive_read_support_format_tar.c:tar_flush_unconsumed:
  474|   888k|{
  475|   888k|	if (*unconsumed) {
  ------------------
  |  Branch (475:6): [True: 307k, False: 581k]
  ------------------
  476|       |/*
  477|       |		void *data = (void *)__archive_read_ahead(a, *unconsumed, NULL);
  478|       |		 * this block of code is to poison claimed unconsumed space, ensuring
  479|       |		 * things break if it is in use still.
  480|       |		 * currently it WILL break things, so enable it only for debugging this issue
  481|       |		if (data) {
  482|       |			memset(data, 0xff, *unconsumed);
  483|       |		}
  484|       |*/
  485|   307k|		__archive_read_consume(a, *unconsumed);
  486|   307k|		*unconsumed = 0;
  487|   307k|	}
  488|   888k|}
archive_read_support_format_tar.c:gnu_add_sparse_entry:
 2906|   290k|{
 2907|   290k|	struct sparse_block *p;
 2908|       |
 2909|   290k|	p = (struct sparse_block *)calloc(1, sizeof(*p));
 2910|   290k|	if (p == NULL) {
  ------------------
  |  Branch (2910:6): [True: 0, False: 290k]
  ------------------
 2911|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 2912|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2913|      0|	}
 2914|   290k|	if (tar->sparse_last != NULL)
  ------------------
  |  Branch (2914:6): [True: 0, False: 290k]
  ------------------
 2915|      0|		tar->sparse_last->next = p;
 2916|   290k|	else
 2917|   290k|		tar->sparse_list = p;
 2918|   290k|	tar->sparse_last = p;
 2919|   290k|	if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) {
  ------------------
  |  Branch (2919:6): [True: 0, False: 290k]
  |  Branch (2919:23): [True: 0, False: 290k]
  |  Branch (2919:37): [True: 0, False: 290k]
  ------------------
 2920|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data");
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2921|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2922|      0|	}
 2923|   290k|	p->offset = offset;
 2924|   290k|	p->remaining = remaining;
 2925|   290k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|   290k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2926|   290k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_data:
  599|      7|{
  600|      7|	ssize_t bytes_read;
  601|      7|	struct tar *tar;
  602|      7|	struct sparse_block *p;
  603|       |
  604|      7|	tar = (struct tar *)(a->format->data);
  605|       |
  606|      7|	for (;;) {
  607|       |		/* Remove exhausted entries from sparse list. */
  608|     12|		while (tar->sparse_list != NULL &&
  ------------------
  |  Branch (608:10): [True: 6, False: 6]
  ------------------
  609|     12|		    tar->sparse_list->remaining == 0) {
  ------------------
  |  Branch (609:7): [True: 5, False: 1]
  ------------------
  610|      5|			p = tar->sparse_list;
  611|      5|			tar->sparse_list = p->next;
  612|      5|			free(p);
  613|      5|		}
  614|       |
  615|      7|		if (tar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (615:7): [True: 1, False: 6]
  ------------------
  616|      1|			__archive_read_consume(a, tar->entry_bytes_unconsumed);
  617|      1|			tar->entry_bytes_unconsumed = 0;
  618|      1|		}
  619|       |
  620|       |		/* If we're at end of file, return EOF. */
  621|      7|		if (tar->sparse_list == NULL ||
  ------------------
  |  Branch (621:7): [True: 6, False: 1]
  ------------------
  622|      7|		    tar->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (622:7): [True: 0, False: 1]
  ------------------
  623|      6|			if (__archive_read_consume(a, tar->entry_padding) < 0)
  ------------------
  |  Branch (623:8): [True: 0, False: 6]
  ------------------
  624|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  625|      6|			tar->entry_padding = 0;
  626|      6|			*buff = NULL;
  627|      6|			*size = 0;
  628|      6|			*offset = tar->realsize;
  629|      6|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  630|      6|		}
  631|       |
  632|      1|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  633|      1|		if (bytes_read < 0)
  ------------------
  |  Branch (633:7): [True: 0, False: 1]
  ------------------
  634|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  635|      1|		if (*buff == NULL) {
  ------------------
  |  Branch (635:7): [True: 0, False: 1]
  ------------------
  636|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  637|      0|			    "Truncated tar archive"
  638|      0|			    " detected while reading data");
  639|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  640|      0|		}
  641|      1|		if (bytes_read > tar->entry_bytes_remaining)
  ------------------
  |  Branch (641:7): [True: 1, False: 0]
  ------------------
  642|      1|			bytes_read = (ssize_t)tar->entry_bytes_remaining;
  643|       |		/* Don't read more than is available in the
  644|       |		 * current sparse block. */
  645|      1|		if (tar->sparse_list->remaining < bytes_read)
  ------------------
  |  Branch (645:7): [True: 0, False: 1]
  ------------------
  646|      0|			bytes_read = (ssize_t)tar->sparse_list->remaining;
  647|      1|		*size = bytes_read;
  648|      1|		*offset = tar->sparse_list->offset;
  649|      1|		tar->sparse_list->remaining -= bytes_read;
  650|      1|		tar->sparse_list->offset += bytes_read;
  651|      1|		tar->entry_bytes_remaining -= bytes_read;
  652|      1|		tar->entry_bytes_unconsumed = bytes_read;
  653|       |
  654|      1|		if (!tar->sparse_list->hole)
  ------------------
  |  Branch (654:7): [True: 1, False: 0]
  ------------------
  655|      1|			return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  656|       |		/* Current is hole data and skip this. */
  657|      1|	}
  658|      7|}
archive_read_support_format_tar.c:archive_read_format_tar_skip:
  662|      5|{
  663|      5|	int64_t bytes_skipped;
  664|      5|	int64_t request;
  665|      5|	struct sparse_block *p;
  666|      5|	struct tar* tar;
  667|       |
  668|      5|	tar = (struct tar *)(a->format->data);
  669|       |
  670|       |	/* Do not consume the hole of a sparse file. */
  671|      5|	request = 0;
  672|      5|	for (p = tar->sparse_list; p != NULL; p = p->next) {
  ------------------
  |  Branch (672:29): [True: 0, False: 5]
  ------------------
  673|      0|		if (!p->hole) {
  ------------------
  |  Branch (673:7): [True: 0, False: 0]
  ------------------
  674|      0|			if (p->remaining >= INT64_MAX - request) {
  ------------------
  |  Branch (674:8): [True: 0, False: 0]
  ------------------
  675|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  676|      0|			}
  677|      0|			request += p->remaining;
  678|      0|		}
  679|      0|	}
  680|      5|	if (request > tar->entry_bytes_remaining)
  ------------------
  |  Branch (680:6): [True: 0, False: 5]
  ------------------
  681|      0|		request = tar->entry_bytes_remaining;
  682|      5|	request += tar->entry_padding + tar->entry_bytes_unconsumed;
  683|       |
  684|      5|	bytes_skipped = __archive_read_consume(a, request);
  685|      5|	if (bytes_skipped < 0)
  ------------------
  |  Branch (685:6): [True: 0, False: 5]
  ------------------
  686|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  687|       |
  688|      5|	tar->entry_bytes_remaining = 0;
  689|      5|	tar->entry_bytes_unconsumed = 0;
  690|      5|	tar->entry_padding = 0;
  691|       |
  692|       |	/* Free the sparse list. */
  693|      5|	gnu_clear_sparse_list(tar);
  694|       |
  695|      5|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  696|      5|}

archive_read_support_format_warc:
  140|    238|{
  141|    238|	struct archive_read *a = (struct archive_read *)_a;
  142|    238|	struct warc_s *w;
  143|    238|	int r;
  144|       |
  145|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  146|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  147|       |
  148|    238|	if ((w = calloc(1, sizeof(*w))) == NULL) {
  ------------------
  |  Branch (148:6): [True: 0, False: 238]
  ------------------
  149|      0|		archive_set_error(&a->archive, ENOMEM,
  150|      0|		    "Can't allocate warc data");
  151|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  152|      0|	}
  153|       |
  154|    238|	r = __archive_read_register_format(
  155|    238|		a, w, "warc",
  156|    238|		_warc_bid, NULL, _warc_rdhdr, _warc_read,
  157|    238|		_warc_skip, NULL, _warc_cleanup, NULL, NULL);
  158|       |
  159|    238|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (159:6): [True: 0, False: 238]
  ------------------
  160|      0|		free(w);
  161|      0|		return (r);
  162|      0|	}
  163|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  164|    238|}
archive_read_support_format_warc.c:_warc_cleanup:
  168|    238|{
  169|    238|	struct warc_s *w = a->format->data;
  170|       |
  171|    238|	if (w->pool.len > 0U) {
  ------------------
  |  Branch (171:6): [True: 0, False: 238]
  ------------------
  172|      0|		free(w->pool.str);
  173|      0|	}
  174|    238|	archive_string_free(&w->sver);
  175|    238|	free(w);
  176|    238|	a->format->data = NULL;
  177|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  178|    238|}
archive_read_support_format_warc.c:_warc_bid:
  182|    236|{
  183|    236|	const char *hdr;
  184|    236|	ssize_t nrd;
  185|    236|	unsigned int ver;
  186|       |
  187|    236|	(void)best_bid; /* UNUSED */
  188|       |
  189|       |	/* check first line of file, it should be a record already */
  190|    236|	if ((hdr = __archive_read_ahead(a, 12U, &nrd)) == NULL) {
  ------------------
  |  Branch (190:6): [True: 5, False: 231]
  ------------------
  191|       |		/* no idea what to do */
  192|      5|		return -1;
  193|    231|	} else if (nrd < 12) {
  ------------------
  |  Branch (193:13): [True: 0, False: 231]
  ------------------
  194|       |		/* nah, not for us, our magic cookie is at least 12 bytes */
  195|      0|		return -1;
  196|      0|	}
  197|       |
  198|       |	/* otherwise snarf the record's version number */
  199|    231|	ver = _warc_rdver(hdr, nrd);
  200|    231|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (200:6): [True: 230, False: 1]
  |  Branch (200:21): [True: 0, False: 1]
  ------------------
  201|       |		/* we only support WARC 0.12 to 1.0 */
  202|    230|		return -1;
  203|    230|	}
  204|       |
  205|       |	/* otherwise be confident */
  206|      1|	return (64);
  207|    231|}
archive_read_support_format_warc.c:_warc_rdver:
  618|    232|{
  619|    232|	static const char magic[] = "WARC/";
  620|    232|	const char *c;
  621|    232|	unsigned int ver = 0U;
  622|    232|	unsigned int end = 0U;
  623|       |
  624|    232|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (624:6): [True: 0, False: 232]
  |  Branch (624:18): [True: 230, False: 2]
  ------------------
  625|       |		/* buffer too small or invalid magic */
  626|    230|		return ver;
  627|    230|	}
  628|       |	/* looks good so far, read the version number for a laugh */
  629|      2|	buf += sizeof(magic) - 1U;
  630|       |
  631|      2|	if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
  ------------------
  |  Branch (631:41): [True: 2, False: 0]
  ------------------
  632|      2|	    isdigit((unsigned char)buf[2U])) {
  633|       |		/* we support a maximum of 2 digits in the minor version */
  634|      2|		if (isdigit((unsigned char)buf[3U]))
  635|      2|			end = 1U;
  636|       |		/* set up major version */
  637|      2|		ver = (buf[0U] - '0') * 10000U;
  638|       |		/* set up minor version */
  639|      2|		if (end == 1U) {
  ------------------
  |  Branch (639:7): [True: 2, False: 0]
  ------------------
  640|      2|			ver += (buf[2U] - '0') * 1000U;
  641|      2|			ver += (buf[3U] - '0') * 100U;
  642|      2|		} else
  643|      0|			ver += (buf[2U] - '0') * 100U;
  644|       |		/*
  645|       |		 * WARC below version 0.12 has a space-separated header
  646|       |		 * WARC 0.12 and above terminates the version with a CRLF
  647|       |		 */
  648|      2|		c = buf + 3U + end;
  649|      2|		if (ver >= 1200U) {
  ------------------
  |  Branch (649:7): [True: 2, False: 0]
  ------------------
  650|      2|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (650:8): [True: 0, False: 2]
  ------------------
  651|      0|				ver = 0U;
  652|      2|		} else {
  653|       |			/* ver < 1200U */
  654|      0|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (654:8): [True: 0, False: 0]
  |  Branch (654:21): [True: 0, False: 0]
  ------------------
  655|      0|				ver = 0U;
  656|      0|		}
  657|      2|	}
  658|      2|	return ver;
  659|    232|}
archive_read_support_format_warc.c:_warc_rdhdr:
  211|      1|{
  212|      1|#define HDR_PROBE_LEN		(12U)
  213|      1|	struct warc_s *w = a->format->data;
  214|      1|	unsigned int ver;
  215|      1|	const char *buf;
  216|      1|	ssize_t nrd;
  217|      1|	const char *eoh;
  218|      1|	char *tmp;
  219|       |	/* for the file name, saves some strndup()'ing */
  220|      1|	warc_string_t fnam;
  221|       |	/* warc record type, not that we really use it a lot */
  222|      1|	warc_type_t ftyp;
  223|       |	/* content-length+error monad */
  224|      1|	ssize_t cntlen;
  225|       |	/* record time is the WARC-Date time we reinterpret it as ctime */
  226|      1|	time_t rtime;
  227|       |	/* mtime is the Last-Modified time which will be the entry's mtime */
  228|      1|	time_t mtime;
  229|       |
  230|      1|start_over:
  231|       |	/* just use read_ahead() they keep track of unconsumed
  232|       |	 * bits and bobs for us; no need to put an extra shift in
  233|       |	 * and reproduce that functionality here */
  234|      1|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  212|      1|#define HDR_PROBE_LEN		(12U)
  ------------------
  235|       |
  236|      1|	if (nrd < 0) {
  ------------------
  |  Branch (236:6): [True: 0, False: 1]
  ------------------
  237|       |		/* no good */
  238|      0|		archive_set_error(
  239|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  240|      0|			"Bad record header");
  241|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  242|      1|	} else if (buf == NULL) {
  ------------------
  |  Branch (242:13): [True: 0, False: 1]
  ------------------
  243|       |		/* there should be room for at least WARC/bla\r\n
  244|       |		 * must be EOF therefore */
  245|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  246|      0|	}
  247|       | 	/* looks good so far, try and find the end of the header now */
  248|      1|	eoh = _warc_find_eoh(buf, nrd);
  249|      1|	if (eoh == NULL) {
  ------------------
  |  Branch (249:6): [True: 0, False: 1]
  ------------------
  250|       |		/* still no good, the header end might be beyond the
  251|       |		 * probe we've requested, but then again who'd cram
  252|       |		 * so much stuff into the header *and* be 28500-compliant */
  253|      0|		archive_set_error(
  254|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  255|      0|			"Bad record header");
  256|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  257|      0|	}
  258|      1|	ver = _warc_rdver(buf, eoh - buf);
  259|       |	/* we currently support WARC 0.12 to 1.0 */
  260|      1|	if (ver == 0U) {
  ------------------
  |  Branch (260:6): [True: 0, False: 1]
  ------------------
  261|      0|		archive_set_error(
  262|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  263|      0|			"Invalid record version");
  264|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  265|      1|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (265:13): [True: 0, False: 1]
  |  Branch (265:28): [True: 0, False: 1]
  ------------------
  266|      0|		archive_set_error(
  267|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  268|      0|			"Unsupported record version: %u.%u",
  269|      0|			ver / 10000, (ver % 10000) / 100);
  270|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  271|      0|	}
  272|      1|	cntlen = _warc_rdlen(buf, eoh - buf);
  273|      1|	if (cntlen < 0) {
  ------------------
  |  Branch (273:6): [True: 1, False: 0]
  ------------------
  274|       |		/* nightmare!  the specs say content-length is mandatory
  275|       |		 * so I don't feel overly bad stopping the reader here */
  276|      1|		archive_set_error(
  277|      1|			&a->archive, EINVAL,
  278|      1|			"Bad content length");
  279|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  280|      1|	}
  281|      0|	rtime = _warc_rdrtm(buf, eoh - buf);
  282|      0|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (282:6): [True: 0, False: 0]
  ------------------
  283|       |		/* record time is mandatory as per WARC/1.0,
  284|       |		 * so just barf here, fast and loud */
  285|      0|		archive_set_error(
  286|      0|			&a->archive, EINVAL,
  287|      0|			"Bad record time");
  288|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  289|      0|	}
  290|       |
  291|       |	/* let the world know we're a WARC archive */
  292|      0|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  345|      0|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  293|      0|	if (ver != w->pver) {
  ------------------
  |  Branch (293:6): [True: 0, False: 0]
  ------------------
  294|       |		/* stringify this entry's version */
  295|      0|		archive_string_sprintf(&w->sver,
  296|      0|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  297|       |		/* remember the version */
  298|      0|		w->pver = ver;
  299|      0|	}
  300|       |	/* start off with the type */
  301|      0|	ftyp = _warc_rdtyp(buf, eoh - buf);
  302|       |	/* and let future calls know about the content */
  303|      0|	w->cntlen = cntlen;
  304|      0|	w->cntoff = 0U;
  305|      0|	mtime = 0;/* Avoid compiling error on some platform. */
  306|       |
  307|      0|	switch (ftyp) {
  308|      0|	case WT_RSRC:
  ------------------
  |  Branch (308:2): [True: 0, False: 0]
  ------------------
  309|      0|	case WT_RSP:
  ------------------
  |  Branch (309:2): [True: 0, False: 0]
  ------------------
  310|       |		/* only try and read the filename in the cases that are
  311|       |		 * guaranteed to have one */
  312|      0|		fnam = _warc_rduri(buf, eoh - buf);
  313|       |		/* check the last character in the URI to avoid creating
  314|       |		 * directory endpoints as files, see Todo above */
  315|      0|		if (fnam.len == 0 || fnam.str[fnam.len - 1] == '/') {
  ------------------
  |  Branch (315:7): [True: 0, False: 0]
  |  Branch (315:24): [True: 0, False: 0]
  ------------------
  316|       |			/* break here for now */
  317|      0|			fnam.len = 0U;
  318|      0|			fnam.str = NULL;
  319|      0|			break;
  320|      0|		}
  321|       |		/* bang to our string pool, so we save a
  322|       |		 * malloc()+free() roundtrip */
  323|      0|		if (fnam.len + 1U > w->pool.len) {
  ------------------
  |  Branch (323:7): [True: 0, False: 0]
  ------------------
  324|      0|			w->pool.len = ((fnam.len + 64U) / 64U) * 64U;
  325|      0|			tmp = realloc(w->pool.str, w->pool.len);
  326|      0|			if (tmp == NULL) {
  ------------------
  |  Branch (326:8): [True: 0, False: 0]
  ------------------
  327|      0|				archive_set_error(
  328|      0|					&a->archive, ENOMEM,
  329|      0|					"Out of memory");
  330|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  331|      0|			}
  332|      0|			w->pool.str = tmp;
  333|      0|		}
  334|      0|		memcpy(w->pool.str, fnam.str, fnam.len);
  335|      0|		w->pool.str[fnam.len] = '\0';
  336|       |		/* let no one else know about the pool, it's a secret, shhh */
  337|      0|		fnam.str = w->pool.str;
  338|       |
  339|       |		/* snarf mtime or deduce from rtime
  340|       |		 * this is a custom header added by our writer, it's quite
  341|       |		 * hard to believe anyone else would go through with it
  342|       |		 * (apart from being part of some http responses of course) */
  343|      0|		if ((mtime = _warc_rdmtm(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (343:7): [True: 0, False: 0]
  ------------------
  344|      0|			mtime = rtime;
  345|      0|		}
  346|      0|		break;
  347|      0|	case WT_NONE:
  ------------------
  |  Branch (347:2): [True: 0, False: 0]
  ------------------
  348|      0|	case WT_INFO:
  ------------------
  |  Branch (348:2): [True: 0, False: 0]
  ------------------
  349|      0|	case WT_META:
  ------------------
  |  Branch (349:2): [True: 0, False: 0]
  ------------------
  350|      0|	case WT_REQ:
  ------------------
  |  Branch (350:2): [True: 0, False: 0]
  ------------------
  351|      0|	case WT_RVIS:
  ------------------
  |  Branch (351:2): [True: 0, False: 0]
  ------------------
  352|      0|	case WT_CONV:
  ------------------
  |  Branch (352:2): [True: 0, False: 0]
  ------------------
  353|      0|	case WT_CONT:
  ------------------
  |  Branch (353:2): [True: 0, False: 0]
  ------------------
  354|      0|	case LAST_WT:
  ------------------
  |  Branch (354:2): [True: 0, False: 0]
  ------------------
  355|      0|	default:
  ------------------
  |  Branch (355:2): [True: 0, False: 0]
  ------------------
  356|      0|		fnam.len = 0U;
  357|      0|		fnam.str = NULL;
  358|      0|		break;
  359|      0|	}
  360|       |
  361|       |	/* now eat some of those delicious buffer bits */
  362|      0|	__archive_read_consume(a, eoh - buf);
  363|       |
  364|      0|	switch (ftyp) {
  365|      0|	case WT_RSRC:
  ------------------
  |  Branch (365:2): [True: 0, False: 0]
  ------------------
  366|      0|	case WT_RSP:
  ------------------
  |  Branch (366:2): [True: 0, False: 0]
  ------------------
  367|      0|		if (fnam.len > 0U) {
  ------------------
  |  Branch (367:7): [True: 0, False: 0]
  ------------------
  368|       |			/* populate entry object */
  369|      0|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  370|      0|			archive_entry_copy_pathname(entry, fnam.str);
  371|      0|			archive_entry_set_size(entry, cntlen);
  372|      0|			archive_entry_set_perm(entry, 0644);
  373|       |			/* rtime is the new ctime, mtime stays mtime */
  374|      0|			archive_entry_set_ctime(entry, rtime, 0L);
  375|      0|			archive_entry_set_mtime(entry, mtime, 0L);
  376|      0|			break;
  377|      0|		}
  378|       |		/* FALLTHROUGH */
  379|      0|	case WT_NONE:
  ------------------
  |  Branch (379:2): [True: 0, False: 0]
  ------------------
  380|      0|	case WT_INFO:
  ------------------
  |  Branch (380:2): [True: 0, False: 0]
  ------------------
  381|      0|	case WT_META:
  ------------------
  |  Branch (381:2): [True: 0, False: 0]
  ------------------
  382|      0|	case WT_REQ:
  ------------------
  |  Branch (382:2): [True: 0, False: 0]
  ------------------
  383|      0|	case WT_RVIS:
  ------------------
  |  Branch (383:2): [True: 0, False: 0]
  ------------------
  384|      0|	case WT_CONV:
  ------------------
  |  Branch (384:2): [True: 0, False: 0]
  ------------------
  385|      0|	case WT_CONT:
  ------------------
  |  Branch (385:2): [True: 0, False: 0]
  ------------------
  386|      0|	case LAST_WT:
  ------------------
  |  Branch (386:2): [True: 0, False: 0]
  ------------------
  387|      0|	default:
  ------------------
  |  Branch (387:2): [True: 0, False: 0]
  ------------------
  388|       |		/* consume the content and start over */
  389|      0|		_warc_skip(a);
  390|      0|		goto start_over;
  391|      0|	}
  392|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|      0|}
archive_read_support_format_warc.c:_warc_find_eoh:
  837|      1|{
  838|      1|	static const char _marker[] = "\r\n\r\n";
  839|      1|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  840|       |
  841|      1|	if (hit != NULL) {
  ------------------
  |  Branch (841:6): [True: 1, False: 0]
  ------------------
  842|      1|		hit += sizeof(_marker) - 1U;
  843|      1|	}
  844|      1|	return hit;
  845|      1|}
archive_read_support_format_warc.c:xmemmem:
  459|      2|{
  460|      2|	const char *const eoh = hay + haysize;
  461|      2|	const char *const eon = needle + needlesize;
  462|      2|	const char *hp;
  463|      2|	const char *np;
  464|      2|	const char *cand;
  465|      2|	unsigned int hsum;
  466|      2|	unsigned int nsum;
  467|      2|	unsigned int eqp;
  468|       |
  469|       |	/* trivial checks first
  470|       |         * a 0-sized needle is defined to be found anywhere in haystack
  471|       |         * then run strchr() to find a candidate in HAYSTACK (i.e. a portion
  472|       |         * that happens to begin with *NEEDLE) */
  473|      2|	if (needlesize == 0UL) {
  ------------------
  |  Branch (473:6): [True: 0, False: 2]
  ------------------
  474|      0|		return deconst(hay);
  475|      2|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (475:13): [True: 0, False: 2]
  ------------------
  476|       |		/* trivial */
  477|      0|		return NULL;
  478|      0|	}
  479|       |
  480|       |	/* First characters of haystack and needle are the same now. Both are
  481|       |	 * guaranteed to be at least one character long.  Now computes the sum
  482|       |	 * of characters values of needle together with the sum of the first
  483|       |	 * needle_len characters of haystack. */
  484|      2|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  485|     21|	     hp < eoh && np < eon;
  ------------------
  |  Branch (485:7): [True: 21, False: 0]
  |  Branch (485:19): [True: 19, False: 2]
  ------------------
  486|     19|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  487|       |
  488|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  489|      2|	if (np < eon) {
  ------------------
  |  Branch (489:6): [True: 0, False: 2]
  ------------------
  490|       |		/* haystack is smaller than needle, :O */
  491|      0|		return NULL;
  492|      2|	} else if (eqp) {
  ------------------
  |  Branch (492:13): [True: 0, False: 2]
  ------------------
  493|       |		/* found a match */
  494|      0|		return deconst(hay);
  495|      0|	}
  496|       |
  497|       |	/* now loop through the rest of haystack,
  498|       |	 * updating the sum iteratively */
  499|   556k|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (499:19): [True: 556k, False: 1]
  ------------------
  500|   556k|		hsum ^= *cand++;
  501|   556k|		hsum ^= *hp;
  502|       |
  503|       |		/* Since the sum of the characters is already known to be
  504|       |		 * equal at that point, it is enough to check just NEEDLESIZE - 1
  505|       |		 * characters for equality,
  506|       |		 * also CAND is by design < HP, so no need for range checks */
  507|   556k|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (507:7): [True: 268k, False: 287k]
  |  Branch (507:23): [True: 1, False: 268k]
  ------------------
  508|      1|			return deconst(cand);
  509|      1|		}
  510|   556k|	}
  511|      1|	return NULL;
  512|      2|}
archive_read_support_format_warc.c:deconst:
  452|      1|{
  453|      1|	return (void *)(uintptr_t)c;
  454|      1|}
archive_read_support_format_warc.c:_warc_rdlen:
  749|      1|{
  750|      1|	static const char _key[] = "\r\nContent-Length:";
  751|      1|	const char *val, *eol;
  752|      1|	char *on = NULL;
  753|      1|	long int len;
  754|       |
  755|      1|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (755:6): [True: 1, False: 0]
  ------------------
  756|       |		/* no bother */
  757|      1|		return -1;
  758|      1|	}
  759|      0|	val += sizeof(_key) - 1U;
  760|      0|	if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (760:6): [True: 0, False: 0]
  ------------------
  761|       |		/* no end of line */
  762|      0|		return -1;
  763|      0|	}
  764|       |
  765|       |	/* skip leading whitespace */
  766|      0|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (766:9): [True: 0, False: 0]
  |  Branch (766:23): [True: 0, False: 0]
  |  Branch (766:38): [True: 0, False: 0]
  ------------------
  767|      0|		val++;
  768|       |	/* there must be at least one digit */
  769|      0|	if (!isdigit((unsigned char)*val))
  ------------------
  |  Branch (769:6): [True: 0, False: 0]
  ------------------
  770|      0|		return -1;
  771|      0|	errno = 0;
  772|      0|	len = strtol(val, &on, 10);
  773|      0|	if (errno != 0 || on != eol) {
  ------------------
  |  Branch (773:6): [True: 0, False: 0]
  |  Branch (773:20): [True: 0, False: 0]
  ------------------
  774|       |		/* line must end here */
  775|      0|		return -1;
  776|      0|	}
  777|       |
  778|      0|	return (size_t)len;
  779|      0|}

archive_read_support_format_xar:
  445|    238|{
  446|    238|	struct xar *xar;
  447|    238|	struct archive_read *a = (struct archive_read *)_a;
  448|    238|	int r;
  449|       |
  450|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
  451|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_xar");
  452|       |
  453|    238|	xar = (struct xar *)calloc(1, sizeof(*xar));
  454|    238|	if (xar == NULL) {
  ------------------
  |  Branch (454:6): [True: 0, False: 238]
  ------------------
  455|      0|		archive_set_error(&a->archive, ENOMEM,
  456|      0|		    "Can't allocate xar data");
  457|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  458|      0|	}
  459|       |
  460|       |	/* initialize xar->file_queue */
  461|    238|	xar->file_queue.allocated = 0;
  462|    238|	xar->file_queue.used = 0;
  463|    238|	xar->file_queue.files = NULL;
  464|       |
  465|    238|	r = __archive_read_register_format(a,
  466|    238|	    xar,
  467|    238|	    "xar",
  468|    238|	    xar_bid,
  469|    238|	    NULL,
  470|    238|	    xar_read_header,
  471|    238|	    xar_read_data,
  472|    238|	    xar_read_data_skip,
  473|    238|	    NULL,
  474|    238|	    xar_cleanup,
  475|    238|	    NULL,
  476|    238|	    NULL);
  477|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (477:6): [True: 0, False: 238]
  ------------------
  478|      0|		free(xar);
  479|    238|	return (r);
  480|    238|}
archive_read_support_format_xar.c:xar_bid:
  484|    236|{
  485|    236|	const unsigned char *b;
  486|    236|	int bid;
  487|       |
  488|    236|	(void)best_bid; /* UNUSED */
  489|       |
  490|    236|	b = __archive_read_ahead(a, HEADER_SIZE, NULL);
  ------------------
  |  |  100|    236|#define HEADER_SIZE	28
  ------------------
  491|    236|	if (b == NULL)
  ------------------
  |  Branch (491:6): [True: 5, False: 231]
  ------------------
  492|      5|		return (-1);
  493|       |
  494|    231|	bid = 0;
  495|       |	/*
  496|       |	 * Verify magic code
  497|       |	 */
  498|    231|	if (archive_be32dec(b) != HEADER_MAGIC)
  ------------------
  |  |   99|    231|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (498:6): [True: 230, False: 1]
  ------------------
  499|    230|		return (0);
  500|      1|	bid += 32;
  501|       |	/*
  502|       |	 * Verify header size
  503|       |	 */
  504|      1|	if (archive_be16dec(b+4) != HEADER_SIZE)
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  |  Branch (504:6): [True: 0, False: 1]
  ------------------
  505|      0|		return (0);
  506|      1|	bid += 16;
  507|       |	/*
  508|       |	 * Verify header version
  509|       |	 */
  510|      1|	if (archive_be16dec(b+6) != HEADER_VERSION)
  ------------------
  |  |  101|      1|#define HEADER_VERSION	1
  ------------------
  |  Branch (510:6): [True: 0, False: 1]
  ------------------
  511|      0|		return (0);
  512|      1|	bid += 16;
  513|       |	/*
  514|       |	 * Verify type of checksum
  515|       |	 */
  516|      1|	switch (archive_be32dec(b+24)) {
  517|      0|	case CKSUM_NONE:
  ------------------
  |  |  102|      0|#define CKSUM_NONE	0
  ------------------
  |  Branch (517:2): [True: 0, False: 1]
  ------------------
  518|      0|	case CKSUM_SHA1:
  ------------------
  |  |  103|      0|#define CKSUM_SHA1	1
  ------------------
  |  Branch (518:2): [True: 0, False: 1]
  ------------------
  519|      1|	case CKSUM_MD5:
  ------------------
  |  |  104|      1|#define CKSUM_MD5	2
  ------------------
  |  Branch (519:2): [True: 1, False: 0]
  ------------------
  520|      1|		bid += 32;
  521|      1|		break;
  522|      0|	default:
  ------------------
  |  Branch (522:2): [True: 0, False: 1]
  ------------------
  523|      0|		return (0);
  524|      1|	}
  525|       |
  526|      1|	return (bid);
  527|      1|}
archive_read_support_format_xar.c:xar_read_header:
  667|      1|{
  668|      1|	struct xar *xar;
  669|      1|	struct xar_file *file;
  670|      1|	struct xattr *xattr;
  671|      1|	int r;
  672|       |
  673|      1|	xar = (struct xar *)(a->format->data);
  674|      1|	r = ARCHIVE_OK;
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  675|       |
  676|      1|	if (xar->offset == 0) {
  ------------------
  |  Branch (676:6): [True: 1, False: 0]
  ------------------
  677|       |		/* Create a character conversion object. */
  678|      1|		if (xar->sconv == NULL) {
  ------------------
  |  Branch (678:7): [True: 1, False: 0]
  ------------------
  679|      1|			xar->sconv = archive_string_conversion_from_charset(
  680|      1|			    &(a->archive), "UTF-8", 1);
  681|      1|			if (xar->sconv == NULL)
  ------------------
  |  Branch (681:8): [True: 0, False: 1]
  ------------------
  682|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  683|      1|		}
  684|       |
  685|       |		/* Read TOC. */
  686|      1|		r = read_toc(a);
  687|      1|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (687:7): [True: 1, False: 0]
  ------------------
  688|      1|			return (r);
  689|      1|	}
  690|       |
  691|      0|	for (;;) {
  692|      0|		file = xar->file = heap_get_entry(&(xar->file_queue));
  693|      0|		if (file == NULL) {
  ------------------
  |  Branch (693:7): [True: 0, False: 0]
  ------------------
  694|      0|			xar->end_of_file = 1;
  695|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  696|      0|		}
  697|      0|		if ((file->mode & AE_IFMT) != AE_IFDIR)
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		if ((file->mode & AE_IFMT) != AE_IFDIR)
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (697:7): [True: 0, False: 0]
  ------------------
  698|      0|			break;
  699|      0|		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  155|      0|#define HAS_PATHNAME		0x00002
  ------------------
              		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  161|      0|#define HAS_TYPE		0x00080
  ------------------
  |  Branch (699:7): [True: 0, False: 0]
  ------------------
  700|      0|			break;
  701|       |		/*
  702|       |		 * If a file type is a directory and it does not have
  703|       |		 * any metadata, do not export.
  704|       |		 */
  705|      0|		file_free(file);
  706|      0|	}
  707|      0|        if (file->has & HAS_ATIME) {
  ------------------
  |  |  171|      0|#define HAS_ATIME		0x20000
  ------------------
  |  Branch (707:13): [True: 0, False: 0]
  ------------------
  708|      0|          archive_entry_set_atime(entry, file->atime, 0);
  709|      0|        }
  710|      0|        if (file->has & HAS_CTIME) {
  ------------------
  |  |  169|      0|#define HAS_CTIME		0x08000
  ------------------
  |  Branch (710:13): [True: 0, False: 0]
  ------------------
  711|      0|          archive_entry_set_ctime(entry, file->ctime, 0);
  712|      0|        }
  713|      0|        if (file->has & HAS_MTIME) {
  ------------------
  |  |  170|      0|#define HAS_MTIME		0x10000
  ------------------
  |  Branch (713:13): [True: 0, False: 0]
  ------------------
  714|      0|          archive_entry_set_mtime(entry, file->mtime, 0);
  715|      0|        }
  716|      0|	archive_entry_set_gid(entry, file->gid);
  717|      0|	if (file->gname.length > 0 &&
  ------------------
  |  Branch (717:6): [True: 0, False: 0]
  ------------------
  718|      0|	    archive_entry_copy_gname_l(entry, file->gname.s,
  ------------------
  |  |   71|      0|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (718:6): [True: 0, False: 0]
  ------------------
  719|      0|		archive_strlen(&(file->gname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  720|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (720:7): [True: 0, False: 0]
  ------------------
  721|      0|			archive_set_error(&a->archive, ENOMEM,
  722|      0|			    "Can't allocate memory for Gname");
  723|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  724|      0|		}
  725|      0|		archive_set_error(&a->archive,
  726|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  727|      0|		    "Gname cannot be converted from %s to current locale.",
  728|      0|		    archive_string_conversion_charset_name(xar->sconv));
  729|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  730|      0|	}
  731|      0|	archive_entry_set_uid(entry, file->uid);
  732|      0|	if (file->uname.length > 0 &&
  ------------------
  |  Branch (732:6): [True: 0, False: 0]
  ------------------
  733|      0|	    archive_entry_copy_uname_l(entry, file->uname.s,
  ------------------
  |  |   86|      0|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (733:6): [True: 0, False: 0]
  ------------------
  734|      0|		archive_strlen(&(file->uname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  735|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (735:7): [True: 0, False: 0]
  ------------------
  736|      0|			archive_set_error(&a->archive, ENOMEM,
  737|      0|			    "Can't allocate memory for Uname");
  738|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  739|      0|		}
  740|      0|		archive_set_error(&a->archive,
  741|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  742|      0|		    "Uname cannot be converted from %s to current locale.",
  743|      0|		    archive_string_conversion_charset_name(xar->sconv));
  744|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  745|      0|	}
  746|      0|	archive_entry_set_mode(entry, file->mode);
  747|      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 (747:6): [True: 0, False: 0]
  ------------------
  748|      0|	    archive_strlen(&(file->pathname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  749|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (749:7): [True: 0, False: 0]
  ------------------
  750|      0|			archive_set_error(&a->archive, ENOMEM,
  751|      0|			    "Can't allocate memory for Pathname");
  752|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  753|      0|		}
  754|      0|		archive_set_error(&a->archive,
  755|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  756|      0|		    "Pathname cannot be converted from %s to current locale.",
  757|      0|		    archive_string_conversion_charset_name(xar->sconv));
  758|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  759|      0|	}
  760|       |
  761|       |
  762|      0|	if (file->symlink.length > 0 &&
  ------------------
  |  Branch (762:6): [True: 0, False: 0]
  ------------------
  763|      0|	    archive_entry_copy_symlink_l(entry, file->symlink.s,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (763:6): [True: 0, False: 0]
  ------------------
  764|      0|		archive_strlen(&(file->symlink)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  765|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (765:7): [True: 0, False: 0]
  ------------------
  766|      0|			archive_set_error(&a->archive, ENOMEM,
  767|      0|			    "Can't allocate memory for Linkname");
  768|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  769|      0|		}
  770|      0|		archive_set_error(&a->archive,
  771|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  772|      0|		    "Linkname cannot be converted from %s to current locale.",
  773|      0|		    archive_string_conversion_charset_name(xar->sconv));
  774|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  775|      0|	}
  776|       |	/* Set proper nlink. */
  777|      0|	if ((file->mode & AE_IFMT) == AE_IFDIR)
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) == AE_IFDIR)
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (777:6): [True: 0, False: 0]
  ------------------
  778|      0|		archive_entry_set_nlink(entry, file->subdirs + 2);
  779|      0|	else
  780|      0|		archive_entry_set_nlink(entry, file->nlink);
  781|      0|	archive_entry_set_size(entry, file->size);
  782|      0|	if (archive_strlen(&(file->hardlink)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (782:6): [True: 0, False: 0]
  ------------------
  783|      0|		archive_entry_set_hardlink(entry, file->hardlink.s);
  784|      0|	archive_entry_set_ino64(entry, file->ino64);
  785|      0|	if (file->has & HAS_DEV)
  ------------------
  |  |  162|      0|#define HAS_DEV			0x00100
  ------------------
  |  Branch (785:6): [True: 0, False: 0]
  ------------------
  786|      0|		archive_entry_set_dev(entry, file->dev);
  787|      0|	if (file->has & HAS_DEVMAJOR)
  ------------------
  |  |  163|      0|#define HAS_DEVMAJOR		0x00200
  ------------------
  |  Branch (787:6): [True: 0, False: 0]
  ------------------
  788|      0|		archive_entry_set_devmajor(entry, file->devmajor);
  789|      0|	if (file->has & HAS_DEVMINOR)
  ------------------
  |  |  164|      0|#define HAS_DEVMINOR		0x00400
  ------------------
  |  Branch (789:6): [True: 0, False: 0]
  ------------------
  790|      0|		archive_entry_set_devminor(entry, file->devminor);
  791|      0|	if (archive_strlen(&(file->fflags_text)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (791:6): [True: 0, False: 0]
  ------------------
  792|      0|		archive_entry_copy_fflags_text(entry, file->fflags_text.s);
  793|       |
  794|      0|	xar->entry_init = 1;
  795|      0|	xar->entry_total = 0;
  796|      0|	xar->entry_remaining = file->length;
  797|      0|	xar->entry_size = file->size;
  798|      0|	xar->entry_encoding = file->encoding;
  799|      0|	xar->entry_a_sum = file->a_sum;
  800|      0|	xar->entry_e_sum = file->e_sum;
  801|       |	/*
  802|       |	 * Read extended attributes.
  803|       |	 */
  804|      0|	xattr = file->xattr_list;
  805|      0|	while (xattr != NULL) {
  ------------------
  |  Branch (805:9): [True: 0, False: 0]
  ------------------
  806|      0|		const void *d;
  807|      0|		size_t outbytes = 0;
  808|      0|		size_t used = 0;
  809|       |
  810|      0|		r = move_reading_point(a, xattr->offset);
  811|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (811:7): [True: 0, False: 0]
  ------------------
  812|      0|			break;
  813|      0|		r = rd_contents_init(a, xattr->encoding,
  814|      0|		    xattr->a_sum.alg, xattr->e_sum.alg);
  815|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (815:7): [True: 0, False: 0]
  ------------------
  816|      0|			break;
  817|      0|		d = NULL;
  818|      0|		r = rd_contents(a, &d, &outbytes, &used, xattr->length);
  819|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (819:7): [True: 0, False: 0]
  ------------------
  820|      0|			break;
  821|      0|		if (outbytes != xattr->size) {
  ------------------
  |  Branch (821:7): [True: 0, False: 0]
  ------------------
  822|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  823|      0|			    "Decompressed size error");
  824|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  825|      0|			break;
  826|      0|		}
  827|      0|		r = checksum_final(a,
  828|      0|		    xattr->a_sum.val, xattr->a_sum.len,
  829|      0|		    xattr->e_sum.val, xattr->e_sum.len);
  830|      0|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (830:7): [True: 0, False: 0]
  ------------------
  831|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  832|       |			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  833|       |			    "Xattr checksum error");
  834|       |			r = ARCHIVE_WARN;
  835|       |			break;
  836|       |#endif
  837|      0|		}
  838|      0|		if (xattr->name.s == NULL) {
  ------------------
  |  Branch (838:7): [True: 0, False: 0]
  ------------------
  839|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  840|      0|			    "Xattr name error");
  841|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  842|      0|			break;
  843|      0|		}
  844|      0|		archive_entry_xattr_add_entry(entry,
  845|      0|		    xattr->name.s, d, outbytes);
  846|      0|		xattr = xattr->next;
  847|      0|	}
  848|      0|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (848:6): [True: 0, False: 0]
  ------------------
  849|      0|		file_free(file);
  850|      0|		return (r);
  851|      0|	}
  852|       |
  853|      0|	if (xar->entry_remaining > 0)
  ------------------
  |  Branch (853:6): [True: 0, False: 0]
  ------------------
  854|       |		/* Move reading point to the beginning of current
  855|       |		 * file contents. */
  856|      0|		r = move_reading_point(a, file->offset);
  857|      0|	else
  858|      0|		r = ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  859|       |
  860|      0|	file_free(file);
  861|      0|	return (r);
  862|      0|}
archive_read_support_format_xar.c:read_toc:
  531|      1|{
  532|      1|	struct xar *xar;
  533|      1|	struct xar_file *file;
  534|      1|	const unsigned char *b;
  535|      1|	uint64_t toc_compressed_size;
  536|      1|	uint64_t toc_uncompressed_size;
  537|      1|	uint32_t toc_chksum_alg;
  538|      1|	ssize_t bytes;
  539|      1|	int r;
  540|       |
  541|      1|	xar = (struct xar *)(a->format->data);
  542|       |
  543|       |	/*
  544|       |	 * Read xar header.
  545|       |	 */
  546|      1|	b = __archive_read_ahead(a, HEADER_SIZE, &bytes);
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  547|      1|	if (bytes < 0)
  ------------------
  |  Branch (547:6): [True: 0, False: 1]
  ------------------
  548|      0|		return ((int)bytes);
  549|      1|	if (bytes < HEADER_SIZE) {
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  |  Branch (549:6): [True: 0, False: 1]
  ------------------
  550|      0|		archive_set_error(&a->archive,
  551|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  552|      0|		    "Truncated archive header");
  553|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  554|      0|	}
  555|       |
  556|      1|	if (archive_be32dec(b) != HEADER_MAGIC) {
  ------------------
  |  |   99|      1|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (556:6): [True: 0, False: 1]
  ------------------
  557|      0|		archive_set_error(&a->archive,
  558|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  559|      0|		    "Invalid header magic");
  560|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|      0|	}
  562|      1|	if (archive_be16dec(b+6) != HEADER_VERSION) {
  ------------------
  |  |  101|      1|#define HEADER_VERSION	1
  ------------------
  |  Branch (562:6): [True: 0, False: 1]
  ------------------
  563|      0|		archive_set_error(&a->archive,
  564|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  565|      0|		    "Unsupported header version(%d)",
  566|      0|		    archive_be16dec(b+6));
  567|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  568|      0|	}
  569|      1|	toc_compressed_size = archive_be64dec(b+8);
  570|      1|	xar->toc_remaining = toc_compressed_size;
  571|      1|	toc_uncompressed_size = archive_be64dec(b+16);
  572|      1|	toc_chksum_alg = archive_be32dec(b+24);
  573|      1|	__archive_read_consume(a, HEADER_SIZE);
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  574|      1|	xar->offset += HEADER_SIZE;
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  575|      1|	xar->toc_total = 0;
  576|       |
  577|       |	/*
  578|       |	 * Read TOC(Table of Contents).
  579|       |	 */
  580|       |	/* Initialize reading contents. */
  581|      1|	r = move_reading_point(a, HEADER_SIZE);
  ------------------
  |  |  100|      1|#define HEADER_SIZE	28
  ------------------
  582|      1|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (582:6): [True: 0, False: 1]
  ------------------
  583|      0|		return (r);
  584|      1|	r = rd_contents_init(a, GZIP, toc_chksum_alg, CKSUM_NONE);
  ------------------
  |  |  102|      1|#define CKSUM_NONE	0
  ------------------
  585|      1|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (585:6): [True: 0, False: 1]
  ------------------
  586|      0|		return (r);
  587|       |
  588|      1|#ifdef HAVE_LIBXML_XMLREADER_H
  589|      1|	r = xml2_read_toc(a);
  590|       |#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
  591|       |	r = expat_read_toc(a);
  592|       |#endif
  593|      1|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (593:6): [True: 1, False: 0]
  ------------------
  594|      1|		return (r);
  595|       |
  596|       |	/* Set 'The HEAP' base. */
  597|      0|	xar->h_base = xar->offset;
  598|      0|	if (xar->toc_total != toc_uncompressed_size) {
  ------------------
  |  Branch (598:6): [True: 0, False: 0]
  ------------------
  599|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  600|      0|		    "TOC uncompressed size error");
  601|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  602|      0|	}
  603|       |
  604|       |	/*
  605|       |	 * Checksum TOC
  606|       |	 */
  607|      0|	if (toc_chksum_alg != CKSUM_NONE) {
  ------------------
  |  |  102|      0|#define CKSUM_NONE	0
  ------------------
  |  Branch (607:6): [True: 0, False: 0]
  ------------------
  608|      0|		r = move_reading_point(a, xar->toc_chksum_offset);
  609|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (609:7): [True: 0, False: 0]
  ------------------
  610|      0|			return (r);
  611|      0|		b = __archive_read_ahead(a,
  612|      0|			(size_t)xar->toc_chksum_size, &bytes);
  613|      0|		if (bytes < 0)
  ------------------
  |  Branch (613:7): [True: 0, False: 0]
  ------------------
  614|      0|			return ((int)bytes);
  615|      0|		if ((uint64_t)bytes < xar->toc_chksum_size) {
  ------------------
  |  Branch (615:7): [True: 0, False: 0]
  ------------------
  616|      0|			archive_set_error(&a->archive,
  617|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  618|      0|			    "Truncated archive file");
  619|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  620|      0|		}
  621|      0|		r = checksum_final(a, b,
  622|      0|			(size_t)xar->toc_chksum_size, NULL, 0);
  623|      0|		__archive_read_consume(a, xar->toc_chksum_size);
  624|      0|		xar->offset += xar->toc_chksum_size;
  625|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  626|       |		if (r != ARCHIVE_OK)
  627|       |			return (ARCHIVE_FATAL);
  628|       |#endif
  629|      0|	}
  630|       |
  631|       |	/*
  632|       |	 * Connect hardlinked files.
  633|       |	 */
  634|      0|	for (file = xar->hdlink_orgs; file != NULL; file = file->hdnext) {
  ------------------
  |  Branch (634:32): [True: 0, False: 0]
  ------------------
  635|      0|		struct hdlink **hdlink;
  636|       |
  637|      0|		for (hdlink = &(xar->hdlink_list); *hdlink != NULL;
  ------------------
  |  Branch (637:38): [True: 0, False: 0]
  ------------------
  638|      0|		    hdlink = &((*hdlink)->next)) {
  639|      0|			if ((*hdlink)->id == file->id) {
  ------------------
  |  Branch (639:8): [True: 0, False: 0]
  ------------------
  640|      0|				struct hdlink *hltmp;
  641|      0|				struct xar_file *f2;
  642|      0|				int nlink = (*hdlink)->cnt + 1;
  643|       |
  644|      0|				file->nlink = nlink;
  645|      0|				for (f2 = (*hdlink)->files; f2 != NULL;
  ------------------
  |  Branch (645:33): [True: 0, False: 0]
  ------------------
  646|      0|				    f2 = f2->hdnext) {
  647|      0|					f2->nlink = nlink;
  648|      0|					archive_string_copy(
  ------------------
  |  |  133|      0|	((dest)->length = 0, archive_string_concat((dest), (src)))
  ------------------
  649|      0|					    &(f2->hardlink), &(file->pathname));
  650|      0|				}
  651|       |				/* Remove resolved files from hdlist_list. */
  652|      0|				hltmp = *hdlink;
  653|      0|				*hdlink = hltmp->next;
  654|      0|				free(hltmp);
  655|      0|				break;
  656|      0|			}
  657|      0|		}
  658|      0|	}
  659|      0|	a->archive.archive_format = ARCHIVE_FORMAT_XAR;
  ------------------
  |  |  340|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  660|      0|	a->archive.archive_format_name = "xar";
  661|       |
  662|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  663|      0|}
archive_read_support_format_xar.c:xml2_read_toc:
 3170|      1|{
 3171|      1|	xmlTextReaderPtr reader;
 3172|      1|	struct xmlattr_list list;
 3173|      1|	int r;
 3174|       |
 3175|      1|	reader = xmlReaderForIO(xml2_read_cb, xml2_close_cb, a, NULL, NULL, 0);
 3176|      1|	if (reader == NULL) {
  ------------------
  |  Branch (3176:6): [True: 0, False: 1]
  ------------------
 3177|      0|		archive_set_error(&a->archive, ENOMEM,
 3178|      0|		    "Couldn't allocate memory for xml parser");
 3179|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3180|      0|	}
 3181|      1|	xmlTextReaderSetErrorHandler(reader, xml2_error_hdr, a);
 3182|       |
 3183|      1|	while ((r = xmlTextReaderRead(reader)) == 1) {
  ------------------
  |  Branch (3183:9): [True: 0, False: 1]
  ------------------
 3184|      0|		const char *name, *value;
 3185|      0|		int type, empty;
 3186|       |
 3187|      0|		type = xmlTextReaderNodeType(reader);
 3188|      0|		name = (const char *)xmlTextReaderConstLocalName(reader);
 3189|      0|		switch (type) {
 3190|      0|		case XML_READER_TYPE_ELEMENT:
  ------------------
  |  Branch (3190:3): [True: 0, False: 0]
  ------------------
 3191|      0|			empty = xmlTextReaderIsEmptyElement(reader);
 3192|      0|			r = xml2_xmlattr_setup(a, &list, reader);
 3193|      0|			if (r == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3193:8): [True: 0, False: 0]
  ------------------
 3194|      0|				r = xml_start(a, name, &list);
 3195|      0|			xmlattr_cleanup(&list);
 3196|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3196:8): [True: 0, False: 0]
  ------------------
 3197|      0|				xmlFreeTextReader(reader);
 3198|      0|				xmlCleanupParser();
 3199|      0|				return (r);
 3200|      0|			}
 3201|      0|			if (empty)
  ------------------
  |  Branch (3201:8): [True: 0, False: 0]
  ------------------
 3202|      0|				xml_end(a, name);
 3203|      0|			break;
 3204|      0|		case XML_READER_TYPE_END_ELEMENT:
  ------------------
  |  Branch (3204:3): [True: 0, False: 0]
  ------------------
 3205|      0|			xml_end(a, name);
 3206|      0|			break;
 3207|      0|		case XML_READER_TYPE_TEXT:
  ------------------
  |  Branch (3207:3): [True: 0, False: 0]
  ------------------
 3208|      0|			value = (const char *)xmlTextReaderConstValue(reader);
 3209|      0|			xml_data(a, value, strlen(value));
 3210|      0|			break;
 3211|      0|		case XML_READER_TYPE_SIGNIFICANT_WHITESPACE:
  ------------------
  |  Branch (3211:3): [True: 0, False: 0]
  ------------------
 3212|      0|		default:
  ------------------
  |  Branch (3212:3): [True: 0, False: 0]
  ------------------
 3213|      0|			break;
 3214|      0|		}
 3215|      0|		if (r < 0)
  ------------------
  |  Branch (3215:7): [True: 0, False: 0]
  ------------------
 3216|      0|			break;
 3217|      0|	}
 3218|      1|	xmlFreeTextReader(reader);
 3219|      1|	xmlCleanupParser();
 3220|       |
 3221|      1|	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3221:10): [True: 0, False: 1]
  ------------------
 3222|      1|}
archive_read_support_format_xar.c:xml2_read_cb:
 3111|    695|{
 3112|    695|	struct archive_read *a;
 3113|    695|	struct xar *xar;
 3114|    695|	const void *d;
 3115|    695|	size_t outbytes;
 3116|    695|	size_t used = 0;
 3117|    695|	int r;
 3118|       |
 3119|    695|	a = (struct archive_read *)context;
 3120|    695|	xar = (struct xar *)(a->format->data);
 3121|       |
 3122|    695|	if (xar->toc_remaining <= 0)
  ------------------
  |  Branch (3122:6): [True: 0, False: 695]
  ------------------
 3123|      0|		return (0);
 3124|    695|	d = buffer;
 3125|    695|	outbytes = len;
 3126|    695|	r = rd_contents(a, &d, &outbytes, &used, xar->toc_remaining);
 3127|    695|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    695|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3127:6): [True: 1, False: 694]
  ------------------
 3128|      1|		return (r);
 3129|    694|	__archive_read_consume(a, used);
 3130|    694|	xar->toc_remaining -= used;
 3131|    694|	xar->offset += used;
 3132|    694|	xar->toc_total += outbytes;
 3133|    694|	PRINT_TOC(buffer, len);
 3134|       |
 3135|    694|	return ((int)outbytes);
 3136|    695|}
archive_read_support_format_xar.c:xml2_close_cb:
 3140|      1|{
 3141|       |
 3142|      1|	(void)context; /* UNUSED */
 3143|      1|	return (0);
 3144|      1|}
archive_read_support_format_xar.c:xml2_error_hdr:
 3149|      1|{
 3150|      1|	struct archive_read *a;
 3151|       |
 3152|      1|	(void)locator; /* UNUSED */
 3153|      1|	a = (struct archive_read *)arg;
 3154|      1|	switch (severity) {
  ------------------
  |  Branch (3154:10): [True: 0, False: 1]
  ------------------
 3155|      0|	case XML_PARSER_SEVERITY_VALIDITY_WARNING:
  ------------------
  |  Branch (3155:2): [True: 0, False: 1]
  ------------------
 3156|      0|	case XML_PARSER_SEVERITY_WARNING:
  ------------------
  |  Branch (3156:2): [True: 0, False: 1]
  ------------------
 3157|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3158|      0|		    "XML Parsing error: %s", msg);
 3159|      0|		break;
 3160|      0|	case XML_PARSER_SEVERITY_VALIDITY_ERROR:
  ------------------
  |  Branch (3160:2): [True: 0, False: 1]
  ------------------
 3161|      1|	case XML_PARSER_SEVERITY_ERROR:
  ------------------
  |  Branch (3161:2): [True: 1, False: 0]
  ------------------
 3162|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3163|      1|		    "XML Parsing error: %s", msg);
 3164|      1|		break;
 3165|      1|	}
 3166|      1|}
archive_read_support_format_xar.c:move_reading_point:
  983|      1|{
  984|      1|	struct xar *xar;
  985|       |
  986|      1|	xar = (struct xar *)(a->format->data);
  987|      1|	if (xar->offset - xar->h_base != offset) {
  ------------------
  |  Branch (987:6): [True: 0, False: 1]
  ------------------
  988|       |		/* Seek forward to the start of file contents. */
  989|      0|		int64_t step;
  990|       |
  991|      0|		step = offset - (xar->offset - xar->h_base);
  992|      0|		if (step > 0) {
  ------------------
  |  Branch (992:7): [True: 0, False: 0]
  ------------------
  993|      0|			step = __archive_read_consume(a, step);
  994|      0|			if (step < 0)
  ------------------
  |  Branch (994:8): [True: 0, False: 0]
  ------------------
  995|      0|				return ((int)step);
  996|      0|			xar->offset += step;
  997|      0|		} else {
  998|      0|			int64_t pos = __archive_read_seek(a, xar->h_base + offset, SEEK_SET);
  999|      0|			if (pos == ARCHIVE_FAILED) {
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (999:8): [True: 0, False: 0]
  ------------------
 1000|      0|				archive_set_error(&(a->archive),
 1001|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1002|      0|				    "Cannot seek.");
 1003|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1004|      0|			}
 1005|      0|			xar->offset = pos;
 1006|      0|		}
 1007|      0|	}
 1008|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1009|      1|}
archive_read_support_format_xar.c:rd_contents_init:
 1014|      1|{
 1015|      1|	int r;
 1016|       |
 1017|       |	/* Init decompress library. */
 1018|      1|	if ((r = decompression_init(a, encoding)) != ARCHIVE_OK)
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1018:6): [True: 0, False: 1]
  ------------------
 1019|      0|		return (r);
 1020|       |	/* Init checksum library. */
 1021|      1|	checksum_init(a, a_sum_alg, e_sum_alg);
 1022|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1023|      1|}
archive_read_support_format_xar.c:decompression_init:
 1453|      1|{
 1454|      1|	struct xar *xar;
 1455|      1|	const char *detail;
 1456|      1|	int r;
 1457|       |
 1458|      1|	xar = (struct xar *)(a->format->data);
 1459|      1|	xar->rd_encoding = encoding;
 1460|      1|	switch (encoding) {
 1461|      0|	case NONE:
  ------------------
  |  Branch (1461:2): [True: 0, False: 1]
  ------------------
 1462|      0|		break;
 1463|      1|	case GZIP:
  ------------------
  |  Branch (1463:2): [True: 1, False: 0]
  ------------------
 1464|      1|		if (xar->stream_valid)
  ------------------
  |  Branch (1464:7): [True: 0, False: 1]
  ------------------
 1465|      0|			r = inflateReset(&(xar->stream));
 1466|      1|		else
 1467|      1|			r = inflateInit(&(xar->stream));
 1468|      1|		if (r != Z_OK) {
  ------------------
  |  Branch (1468:7): [True: 0, False: 1]
  ------------------
 1469|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1470|      0|			    "Couldn't initialize zlib stream.");
 1471|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1472|      0|		}
 1473|      1|		xar->stream_valid = 1;
 1474|      1|		xar->stream.total_in = 0;
 1475|      1|		xar->stream.total_out = 0;
 1476|      1|		break;
 1477|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1478|      0|	case BZIP2:
  ------------------
  |  Branch (1478:2): [True: 0, False: 1]
  ------------------
 1479|      0|		if (xar->bzstream_valid) {
  ------------------
  |  Branch (1479:7): [True: 0, False: 0]
  ------------------
 1480|      0|			BZ2_bzDecompressEnd(&(xar->bzstream));
 1481|      0|			xar->bzstream_valid = 0;
 1482|      0|		}
 1483|      0|		r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 0);
 1484|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1484:7): [True: 0, False: 0]
  ------------------
 1485|      0|			r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 1);
 1486|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1486:7): [True: 0, False: 0]
  ------------------
 1487|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1488|      0|			detail = NULL;
 1489|      0|			switch (r) {
  ------------------
  |  Branch (1489:12): [True: 0, False: 0]
  ------------------
 1490|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1490:4): [True: 0, False: 0]
  ------------------
 1491|      0|				detail = "invalid setup parameter";
 1492|      0|				break;
 1493|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1493:4): [True: 0, False: 0]
  ------------------
 1494|      0|				err = ENOMEM;
 1495|      0|				detail = "out of memory";
 1496|      0|				break;
 1497|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1497:4): [True: 0, False: 0]
  ------------------
 1498|      0|				detail = "mis-compiled library";
 1499|      0|				break;
 1500|      0|			}
 1501|      0|			archive_set_error(&a->archive, err,
 1502|      0|			    "Internal error initializing decompressor: %s",
 1503|      0|			    detail == NULL ? "??" : detail);
  ------------------
  |  Branch (1503:8): [True: 0, False: 0]
  ------------------
 1504|      0|			xar->bzstream_valid = 0;
 1505|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1506|      0|		}
 1507|      0|		xar->bzstream_valid = 1;
 1508|      0|		xar->bzstream.total_in_lo32 = 0;
 1509|      0|		xar->bzstream.total_in_hi32 = 0;
 1510|      0|		xar->bzstream.total_out_lo32 = 0;
 1511|      0|		xar->bzstream.total_out_hi32 = 0;
 1512|      0|		break;
 1513|      0|#endif
 1514|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1515|      0|#if LZMA_VERSION_MAJOR >= 5
 1516|       |/* Effectively disable the limiter. */
 1517|      0|#define LZMA_MEMLIMIT   UINT64_MAX
 1518|       |#else
 1519|       |/* NOTE: This needs to check memory size which running system has. */
 1520|       |#define LZMA_MEMLIMIT   (1U << 30)
 1521|       |#endif
 1522|      0|	case XZ:
  ------------------
  |  Branch (1522:2): [True: 0, False: 1]
  ------------------
 1523|      0|	case LZMA:
  ------------------
  |  Branch (1523:2): [True: 0, False: 1]
  ------------------
 1524|      0|		if (xar->lzstream_valid) {
  ------------------
  |  Branch (1524:7): [True: 0, False: 0]
  ------------------
 1525|      0|			lzma_end(&(xar->lzstream));
 1526|      0|			xar->lzstream_valid = 0;
 1527|      0|		}
 1528|      0|		if (xar->entry_encoding == XZ)
  ------------------
  |  Branch (1528:7): [True: 0, False: 0]
  ------------------
 1529|      0|			r = lzma_stream_decoder(&(xar->lzstream),
 1530|      0|			    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  | 1517|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1531|      0|			    LZMA_CONCATENATED);
 1532|      0|		else
 1533|      0|			r = lzma_alone_decoder(&(xar->lzstream),
 1534|      0|			    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  | 1517|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1535|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1535:7): [True: 0, False: 0]
  ------------------
 1536|      0|			switch (r) {
 1537|      0|			case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1537:4): [True: 0, False: 0]
  ------------------
 1538|      0|				archive_set_error(&a->archive,
 1539|      0|				    ENOMEM,
 1540|      0|				    "Internal error initializing "
 1541|      0|				    "compression library: "
 1542|      0|				    "Cannot allocate memory");
 1543|      0|				break;
 1544|      0|			case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1544:4): [True: 0, False: 0]
  ------------------
 1545|      0|				archive_set_error(&a->archive,
 1546|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1547|      0|				    "Internal error initializing "
 1548|      0|				    "compression library: "
 1549|      0|				    "Invalid or unsupported options");
 1550|      0|				break;
 1551|      0|			default:
  ------------------
  |  Branch (1551:4): [True: 0, False: 0]
  ------------------
 1552|      0|				archive_set_error(&a->archive,
 1553|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1554|      0|				    "Internal error initializing "
 1555|      0|				    "lzma library");
 1556|      0|				break;
 1557|      0|			}
 1558|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1559|      0|		}
 1560|      0|		xar->lzstream_valid = 1;
 1561|      0|		xar->lzstream.total_in = 0;
 1562|      0|		xar->lzstream.total_out = 0;
 1563|      0|		break;
 1564|      0|#endif
 1565|       |	/*
 1566|       |	 * Unsupported compression.
 1567|       |	 */
 1568|      0|	default:
  ------------------
  |  Branch (1568:2): [True: 0, False: 1]
  ------------------
 1569|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1570|       |	case BZIP2:
 1571|       |#endif
 1572|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1573|       |	case LZMA:
 1574|       |	case XZ:
 1575|       |#endif
 1576|      0|		switch (xar->entry_encoding) {
 1577|      0|		case BZIP2: detail = "bzip2"; break;
  ------------------
  |  Branch (1577:3): [True: 0, False: 0]
  ------------------
 1578|      0|		case LZMA: detail = "lzma"; break;
  ------------------
  |  Branch (1578:3): [True: 0, False: 0]
  ------------------
 1579|      0|		case XZ: detail = "xz"; break;
  ------------------
  |  Branch (1579:3): [True: 0, False: 0]
  ------------------
 1580|      0|		default: detail = "??"; break;
  ------------------
  |  Branch (1580:3): [True: 0, False: 0]
  ------------------
 1581|      0|		}
 1582|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1583|      0|		    "%s compression not supported on this platform",
 1584|      0|		    detail);
 1585|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1586|      1|	}
 1587|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1588|      1|}
archive_read_support_format_xar.c:checksum_init:
 1415|      1|{
 1416|      1|	struct xar *xar;
 1417|       |
 1418|      1|	xar = (struct xar *)(a->format->data);
 1419|      1|	_checksum_init(&(xar->a_sumwrk), a_sum_alg);
 1420|      1|	_checksum_init(&(xar->e_sumwrk), e_sum_alg);
 1421|      1|}
archive_read_support_format_xar.c:_checksum_init:
 1358|      2|{
 1359|      2|	sumwrk->alg = sum_alg;
 1360|      2|	switch (sum_alg) {
  ------------------
  |  Branch (1360:10): [True: 0, False: 2]
  ------------------
 1361|      1|	case CKSUM_NONE:
  ------------------
  |  |  102|      1|#define CKSUM_NONE	0
  ------------------
  |  Branch (1361:2): [True: 1, False: 1]
  ------------------
 1362|      1|		break;
 1363|      0|	case CKSUM_SHA1:
  ------------------
  |  |  103|      0|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1363:2): [True: 0, False: 2]
  ------------------
 1364|      0|		archive_sha1_init(&(sumwrk->sha1ctx));
  ------------------
  |  |  341|      0|  __archive_digest.sha1init(ctx)
  ------------------
 1365|      0|		break;
 1366|      1|	case CKSUM_MD5:
  ------------------
  |  |  104|      1|#define CKSUM_MD5	2
  ------------------
  |  Branch (1366:2): [True: 1, False: 1]
  ------------------
 1367|      1|		archive_md5_init(&(sumwrk->md5ctx));
  ------------------
  |  |  312|      1|  __archive_digest.md5init(ctx)
  ------------------
 1368|      1|		break;
 1369|      2|	}
 1370|      2|}
archive_read_support_format_xar.c:rd_contents:
 1028|    695|{
 1029|    695|	const unsigned char *b;
 1030|    695|	ssize_t bytes;
 1031|       |
 1032|       |	/* Get whatever bytes are immediately available. */
 1033|    695|	b = __archive_read_ahead(a, 1, &bytes);
 1034|    695|	if (bytes < 0)
  ------------------
  |  Branch (1034:6): [True: 0, False: 695]
  ------------------
 1035|      0|		return ((int)bytes);
 1036|    695|	if (bytes == 0) {
  ------------------
  |  Branch (1036:6): [True: 1, False: 694]
  ------------------
 1037|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1038|      1|		    "Truncated archive file");
 1039|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1040|      1|	}
 1041|    694|	if ((uint64_t)bytes > remaining)
  ------------------
  |  Branch (1041:6): [True: 0, False: 694]
  ------------------
 1042|      0|		bytes = (ssize_t)remaining;
 1043|       |
 1044|       |	/*
 1045|       |	 * Decompress contents of file.
 1046|       |	 */
 1047|    694|	*used = bytes;
 1048|    694|	if (decompress(a, buff, size, b, used) != ARCHIVE_OK)
  ------------------
  |  |  192|    694|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1048:6): [True: 0, False: 694]
  ------------------
 1049|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1050|       |
 1051|       |	/*
 1052|       |	 * Update checksum of a compressed data and a extracted data.
 1053|       |	 */
 1054|    694|	checksum_update(a, b, *used, *buff, *size);
 1055|       |
 1056|    694|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    694|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1057|    694|}
archive_read_support_format_xar.c:decompress:
 1593|    694|{
 1594|    694|	struct xar *xar;
 1595|    694|	void *outbuff;
 1596|    694|	size_t avail_in, avail_out;
 1597|    694|	int r;
 1598|       |
 1599|    694|	xar = (struct xar *)(a->format->data);
 1600|    694|	avail_in = *used;
 1601|    694|	outbuff = (void *)(uintptr_t)*buff;
 1602|    694|	if (outbuff == NULL) {
  ------------------
  |  Branch (1602:6): [True: 0, False: 694]
  ------------------
 1603|      0|		if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1603:7): [True: 0, False: 0]
  ------------------
 1604|      0|			xar->outbuff = malloc(OUTBUFF_SIZE);
  ------------------
  |  |  308|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1605|      0|			if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1605:8): [True: 0, False: 0]
  ------------------
 1606|      0|				archive_set_error(&a->archive, ENOMEM,
 1607|      0|				    "Couldn't allocate memory for out buffer");
 1608|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1609|      0|			}
 1610|      0|		}
 1611|      0|		outbuff = xar->outbuff;
 1612|      0|		*buff = outbuff;
 1613|      0|		avail_out = OUTBUFF_SIZE;
  ------------------
  |  |  308|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1614|      0|	} else
 1615|    694|		avail_out = *outbytes;
 1616|    694|	switch (xar->rd_encoding) {
 1617|    694|	case GZIP:
  ------------------
  |  Branch (1617:2): [True: 694, False: 0]
  ------------------
 1618|    694|		xar->stream.next_in = (Bytef *)(uintptr_t)b;
 1619|    694|		xar->stream.avail_in = (uInt)avail_in;
 1620|    694|		xar->stream.next_out = (unsigned char *)outbuff;
 1621|    694|		xar->stream.avail_out = (uInt)avail_out;
 1622|    694|		r = inflate(&(xar->stream), 0);
 1623|    694|		switch (r) {
 1624|    694|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1624:3): [True: 694, False: 0]
  ------------------
 1625|    694|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1625:3): [True: 0, False: 694]
  ------------------
 1626|    694|			break;
 1627|      0|		default:
  ------------------
  |  Branch (1627:3): [True: 0, False: 694]
  ------------------
 1628|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1629|      0|			    "File decompression failed (%d)", r);
 1630|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1631|    694|		}
 1632|    694|		*used = avail_in - xar->stream.avail_in;
 1633|    694|		*outbytes = avail_out - xar->stream.avail_out;
 1634|    694|		break;
 1635|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1636|      0|	case BZIP2:
  ------------------
  |  Branch (1636:2): [True: 0, False: 694]
  ------------------
 1637|      0|		xar->bzstream.next_in = (char *)(uintptr_t)b;
 1638|      0|		xar->bzstream.avail_in = (unsigned int)avail_in;
 1639|      0|		xar->bzstream.next_out = (char *)outbuff;
 1640|      0|		xar->bzstream.avail_out = (unsigned int)avail_out;
 1641|      0|		r = BZ2_bzDecompress(&(xar->bzstream));
 1642|      0|		switch (r) {
 1643|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1643:3): [True: 0, False: 0]
  ------------------
 1644|      0|			switch (BZ2_bzDecompressEnd(&(xar->bzstream))) {
 1645|      0|			case BZ_OK:
  ------------------
  |  Branch (1645:4): [True: 0, False: 0]
  ------------------
 1646|      0|				break;
 1647|      0|			default:
  ------------------
  |  Branch (1647:4): [True: 0, False: 0]
  ------------------
 1648|      0|				archive_set_error(&(a->archive),
 1649|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1650|      0|				    "Failed to clean up decompressor");
 1651|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1652|      0|			}
 1653|      0|			xar->bzstream_valid = 0;
 1654|       |			/* FALLTHROUGH */
 1655|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1655:3): [True: 0, False: 0]
  ------------------
 1656|      0|			break;
 1657|      0|		default:
  ------------------
  |  Branch (1657:3): [True: 0, False: 0]
  ------------------
 1658|      0|			archive_set_error(&(a->archive),
 1659|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1660|      0|			    "bzip decompression failed");
 1661|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1662|      0|		}
 1663|      0|		*used = avail_in - xar->bzstream.avail_in;
 1664|      0|		*outbytes = avail_out - xar->bzstream.avail_out;
 1665|      0|		break;
 1666|      0|#endif
 1667|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1668|      0|	case LZMA:
  ------------------
  |  Branch (1668:2): [True: 0, False: 694]
  ------------------
 1669|      0|	case XZ:
  ------------------
  |  Branch (1669:2): [True: 0, False: 694]
  ------------------
 1670|      0|		xar->lzstream.next_in = b;
 1671|      0|		xar->lzstream.avail_in = avail_in;
 1672|      0|		xar->lzstream.next_out = (unsigned char *)outbuff;
 1673|      0|		xar->lzstream.avail_out = avail_out;
 1674|      0|		r = lzma_code(&(xar->lzstream), LZMA_RUN);
 1675|      0|		switch (r) {
 1676|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1676:3): [True: 0, False: 0]
  ------------------
 1677|      0|			lzma_end(&(xar->lzstream));
 1678|      0|			xar->lzstream_valid = 0;
 1679|       |			/* FALLTHROUGH */
 1680|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1680:3): [True: 0, False: 0]
  ------------------
 1681|      0|			break;
 1682|      0|		default:
  ------------------
  |  Branch (1682:3): [True: 0, False: 0]
  ------------------
 1683|      0|			archive_set_error(&(a->archive),
 1684|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1685|      0|			    "%s decompression failed(%d)",
 1686|      0|			    (xar->entry_encoding == XZ)?"xz":"lzma",
  ------------------
  |  Branch (1686:8): [True: 0, False: 0]
  ------------------
 1687|      0|			    r);
 1688|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1689|      0|		}
 1690|      0|		*used = avail_in - xar->lzstream.avail_in;
 1691|      0|		*outbytes = avail_out - xar->lzstream.avail_out;
 1692|      0|		break;
 1693|      0|#endif
 1694|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1695|       |	case BZIP2:
 1696|       |#endif
 1697|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1698|       |	case LZMA:
 1699|       |	case XZ:
 1700|       |#endif
 1701|      0|	case NONE:
  ------------------
  |  Branch (1701:2): [True: 0, False: 694]
  ------------------
 1702|      0|	default:
  ------------------
  |  Branch (1702:2): [True: 0, False: 694]
  ------------------
 1703|      0|		if (outbuff == xar->outbuff) {
  ------------------
  |  Branch (1703:7): [True: 0, False: 0]
  ------------------
 1704|      0|			*buff = b;
 1705|      0|			*used = avail_in;
 1706|      0|			*outbytes = avail_in;
 1707|      0|		} else {
 1708|      0|			if (avail_out > avail_in)
  ------------------
  |  Branch (1708:8): [True: 0, False: 0]
  ------------------
 1709|      0|				avail_out = avail_in;
 1710|      0|			memcpy(outbuff, b, avail_out);
 1711|      0|			*used = avail_out;
 1712|      0|			*outbytes = avail_out;
 1713|      0|		}
 1714|      0|		break;
 1715|    694|	}
 1716|    694|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    694|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1717|    694|}
archive_read_support_format_xar.c:checksum_update:
 1426|    694|{
 1427|    694|	struct xar *xar;
 1428|       |
 1429|    694|	xar = (struct xar *)(a->format->data);
 1430|    694|	_checksum_update(&(xar->a_sumwrk), abuff, asize);
 1431|    694|	_checksum_update(&(xar->e_sumwrk), ebuff, esize);
 1432|    694|}
archive_read_support_format_xar.c:_checksum_update:
 1374|  1.38k|{
 1375|       |
 1376|  1.38k|	switch (sumwrk->alg) {
  ------------------
  |  Branch (1376:10): [True: 0, False: 1.38k]
  ------------------
 1377|    694|	case CKSUM_NONE:
  ------------------
  |  |  102|    694|#define CKSUM_NONE	0
  ------------------
  |  Branch (1377:2): [True: 694, False: 694]
  ------------------
 1378|    694|		break;
 1379|      0|	case CKSUM_SHA1:
  ------------------
  |  |  103|      0|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1379:2): [True: 0, False: 1.38k]
  ------------------
 1380|      0|		archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
  ------------------
  |  |  345|      0|  __archive_digest.sha1update(ctx, buf, n)
  ------------------
 1381|      0|		break;
 1382|    694|	case CKSUM_MD5:
  ------------------
  |  |  104|    694|#define CKSUM_MD5	2
  ------------------
  |  Branch (1382:2): [True: 694, False: 694]
  ------------------
 1383|    694|		archive_md5_update(&(sumwrk->md5ctx), buff, size);
  ------------------
  |  |  316|    694|  __archive_digest.md5update(ctx, buf, n)
  ------------------
 1384|    694|		break;
 1385|  1.38k|	}
 1386|  1.38k|}
archive_read_support_format_xar.c:_checksum_final:
 1390|    476|{
 1391|    476|	unsigned char sum[MAX_SUM_SIZE];
 1392|    476|	int r = ARCHIVE_OK;
  ------------------
  |  |  192|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1393|       |
 1394|    476|	switch (sumwrk->alg) {
  ------------------
  |  Branch (1394:10): [True: 0, False: 476]
  ------------------
 1395|    475|	case CKSUM_NONE:
  ------------------
  |  |  102|    475|#define CKSUM_NONE	0
  ------------------
  |  Branch (1395:2): [True: 475, False: 1]
  ------------------
 1396|    475|		break;
 1397|      0|	case CKSUM_SHA1:
  ------------------
  |  |  103|      0|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1397:2): [True: 0, False: 476]
  ------------------
 1398|      0|		archive_sha1_final(&(sumwrk->sha1ctx), sum);
  ------------------
  |  |  343|      0|  __archive_digest.sha1final(ctx, md)
  ------------------
 1399|      0|		if (len != SHA1_SIZE ||
  ------------------
  |  |  107|      0|#define SHA1_SIZE	20
  ------------------
  |  Branch (1399:7): [True: 0, False: 0]
  ------------------
 1400|      0|		    memcmp(val, sum, SHA1_SIZE) != 0)
  ------------------
  |  |  107|      0|#define SHA1_SIZE	20
  ------------------
  |  Branch (1400:7): [True: 0, False: 0]
  ------------------
 1401|      0|			r = ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1402|      0|		break;
 1403|      1|	case CKSUM_MD5:
  ------------------
  |  |  104|      1|#define CKSUM_MD5	2
  ------------------
  |  Branch (1403:2): [True: 1, False: 475]
  ------------------
 1404|      1|		archive_md5_final(&(sumwrk->md5ctx), sum);
  ------------------
  |  |  314|      1|  __archive_digest.md5final(ctx, md)
  ------------------
 1405|      1|		if (len != MD5_SIZE ||
  ------------------
  |  |  106|      2|#define MD5_SIZE	16
  ------------------
  |  Branch (1405:7): [True: 1, False: 0]
  ------------------
 1406|      1|		    memcmp(val, sum, MD5_SIZE) != 0)
  ------------------
  |  |  106|      0|#define MD5_SIZE	16
  ------------------
  |  Branch (1406:7): [True: 0, False: 0]
  ------------------
 1407|      1|			r = ARCHIVE_FAILED;
  ------------------
  |  |  196|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1408|      1|		break;
 1409|    476|	}
 1410|    476|	return (r);
 1411|    476|}
archive_read_support_format_xar.c:xar_cleanup:
  948|    238|{
  949|    238|	struct xar *xar;
  950|    238|	struct hdlink *hdlink;
  951|    238|	int i;
  952|    238|	int r;
  953|       |
  954|    238|	xar = (struct xar *)(a->format->data);
  955|    238|	checksum_cleanup(a);
  956|    238|	r = decompression_cleanup(a);
  957|    238|	hdlink = xar->hdlink_list;
  958|    238|	while (hdlink != NULL) {
  ------------------
  |  Branch (958:9): [True: 0, False: 238]
  ------------------
  959|      0|		struct hdlink *next = hdlink->next;
  960|       |
  961|      0|		free(hdlink);
  962|      0|		hdlink = next;
  963|      0|	}
  964|    238|	for (i = 0; i < xar->file_queue.used; i++)
  ------------------
  |  Branch (964:14): [True: 0, False: 238]
  ------------------
  965|      0|		file_free(xar->file_queue.files[i]);
  966|    238|	free(xar->file_queue.files);
  967|    238|	while (xar->unknowntags != NULL) {
  ------------------
  |  Branch (967:9): [True: 0, False: 238]
  ------------------
  968|      0|		struct unknown_tag *tag;
  969|       |
  970|      0|		tag = xar->unknowntags;
  971|      0|		xar->unknowntags = tag->next;
  972|      0|		archive_string_free(&(tag->name));
  973|      0|		free(tag);
  974|      0|	}
  975|    238|	free(xar->outbuff);
  976|    238|	free(xar);
  977|    238|	a->format->data = NULL;
  978|    238|	return (r);
  979|    238|}
archive_read_support_format_xar.c:checksum_cleanup:
 1762|    238|checksum_cleanup(struct archive_read *a) {
 1763|    238|	struct xar *xar;
 1764|       |
 1765|    238|	xar = (struct xar *)(a->format->data);
 1766|       |
 1767|    238|	_checksum_final(&(xar->a_sumwrk), NULL, 0);
 1768|    238|	_checksum_final(&(xar->e_sumwrk), NULL, 0);
 1769|    238|}
archive_read_support_format_xar.c:decompression_cleanup:
 1721|    238|{
 1722|    238|	struct xar *xar;
 1723|    238|	int r;
 1724|       |
 1725|    238|	xar = (struct xar *)(a->format->data);
 1726|    238|	r = ARCHIVE_OK;
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1727|    238|	if (xar->stream_valid) {
  ------------------
  |  Branch (1727:6): [True: 1, False: 237]
  ------------------
 1728|      1|		if (inflateEnd(&(xar->stream)) != Z_OK) {
  ------------------
  |  Branch (1728:7): [True: 0, False: 1]
  ------------------
 1729|      0|			archive_set_error(&a->archive,
 1730|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1731|      0|			    "Failed to clean up zlib decompressor");
 1732|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1733|      0|		}
 1734|      1|	}
 1735|    238|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1736|    238|	if (xar->bzstream_valid) {
  ------------------
  |  Branch (1736:6): [True: 0, False: 238]
  ------------------
 1737|      0|		if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (1737:7): [True: 0, False: 0]
  ------------------
 1738|      0|			archive_set_error(&a->archive,
 1739|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1740|      0|			    "Failed to clean up bzip2 decompressor");
 1741|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1742|      0|		}
 1743|      0|	}
 1744|    238|#endif
 1745|    238|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1746|    238|	if (xar->lzstream_valid)
  ------------------
  |  Branch (1746:6): [True: 0, False: 238]
  ------------------
 1747|      0|		lzma_end(&(xar->lzstream));
 1748|       |#elif defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1749|       |	if (xar->lzstream_valid) {
 1750|       |		if (lzmadec_end(&(xar->lzstream)) != LZMADEC_OK) {
 1751|       |			archive_set_error(&a->archive,
 1752|       |			    ARCHIVE_ERRNO_MISC,
 1753|       |			    "Failed to clean up lzmadec decompressor");
 1754|       |			r = ARCHIVE_FATAL;
 1755|       |		}
 1756|       |	}
 1757|       |#endif
 1758|    238|	return (r);
 1759|    238|}

archive_read_support_format_zip:
 3348|    238|{
 3349|    238|	int r;
 3350|    238|	r = archive_read_support_format_zip_streamable(a);
 3351|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3351:6): [True: 0, False: 238]
  ------------------
 3352|      0|		return r;
 3353|    238|	return (archive_read_support_format_zip_seekable(a));
 3354|    238|}
archive_read_support_format_zip_streamable:
 3595|    238|{
 3596|    238|	struct archive_read *a = (struct archive_read *)_a;
 3597|    238|	struct zip *zip;
 3598|    238|	int r;
 3599|       |
 3600|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3601|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 3602|       |
 3603|    238|	zip = (struct zip *)calloc(1, sizeof(*zip));
 3604|    238|	if (zip == NULL) {
  ------------------
  |  Branch (3604:6): [True: 0, False: 238]
  ------------------
 3605|      0|		archive_set_error(&a->archive, ENOMEM,
 3606|      0|		    "Can't allocate zip data");
 3607|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3608|      0|	}
 3609|       |
 3610|       |	/* Streamable reader doesn't support mac extensions. */
 3611|    238|	zip->process_mac_extensions = 0;
 3612|       |
 3613|       |	/*
 3614|       |	 * Until enough data has been read, we cannot tell about
 3615|       |	 * any encrypted entries yet.
 3616|       |	 */
 3617|    238|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|    238|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3618|    238|	zip->crc32func = real_crc32;
 3619|       |
 3620|    238|	r = __archive_read_register_format(a,
 3621|    238|	    zip,
 3622|    238|	    "zip",
 3623|    238|	    archive_read_format_zip_streamable_bid,
 3624|    238|	    archive_read_format_zip_options,
 3625|    238|	    archive_read_format_zip_streamable_read_header,
 3626|    238|	    archive_read_format_zip_read_data,
 3627|    238|	    archive_read_format_zip_read_data_skip_streamable,
 3628|    238|	    NULL,
 3629|    238|	    archive_read_format_zip_cleanup,
 3630|    238|	    archive_read_support_format_zip_capabilities_streamable,
 3631|    238|	    archive_read_format_zip_has_encrypted_entries);
 3632|       |
 3633|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3633:6): [True: 0, False: 238]
  ------------------
 3634|      0|		free(zip);
 3635|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3636|    238|}
archive_read_support_format_zip_seekable:
 4387|    238|{
 4388|    238|	struct archive_read *a = (struct archive_read *)_a;
 4389|    238|	struct zip *zip;
 4390|    238|	int r;
 4391|       |
 4392|    238|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|    238|	do { \
  |  |  152|    238|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|    238|			(allowed_states), (function_name)); \
  |  |  154|    238|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  198|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 238]
  |  |  ------------------
  |  |  155|    238|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|    238|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4393|    238|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4394|       |
 4395|    238|	zip = (struct zip *)calloc(1, sizeof(*zip));
 4396|    238|	if (zip == NULL) {
  ------------------
  |  Branch (4396:6): [True: 0, False: 238]
  ------------------
 4397|      0|		archive_set_error(&a->archive, ENOMEM,
 4398|      0|		    "Can't allocate zip data");
 4399|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4400|      0|	}
 4401|       |
 4402|       |#ifdef HAVE_COPYFILE_H
 4403|       |	/* Set this by default on Mac OS. */
 4404|       |	zip->process_mac_extensions = 1;
 4405|       |#endif
 4406|       |
 4407|       |	/*
 4408|       |	 * Until enough data has been read, we cannot tell about
 4409|       |	 * any encrypted entries yet.
 4410|       |	 */
 4411|    238|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|    238|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4412|    238|	zip->crc32func = real_crc32;
 4413|       |
 4414|    238|	r = __archive_read_register_format(a,
 4415|    238|	    zip,
 4416|    238|	    "zip",
 4417|    238|	    archive_read_format_zip_seekable_bid,
 4418|    238|	    archive_read_format_zip_options,
 4419|    238|	    archive_read_format_zip_seekable_read_header,
 4420|    238|	    archive_read_format_zip_read_data,
 4421|    238|	    archive_read_format_zip_read_data_skip_seekable,
 4422|    238|	    NULL,
 4423|    238|	    archive_read_format_zip_cleanup,
 4424|    238|	    archive_read_support_format_zip_capabilities_seekable,
 4425|    238|	    archive_read_format_zip_has_encrypted_entries);
 4426|       |
 4427|    238|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4427:6): [True: 0, False: 238]
  ------------------
 4428|      0|		free(zip);
 4429|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4430|    238|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3373|    236|{
 3374|    236|	const char *p;
 3375|       |
 3376|    236|	(void)best_bid; /* UNUSED */
 3377|       |
 3378|    236|	if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3378:6): [True: 5, False: 231]
  ------------------
 3379|      5|		return (-1);
 3380|       |
 3381|       |	/*
 3382|       |	 * Bid of 29 here comes from:
 3383|       |	 *  + 16 bits for "PK",
 3384|       |	 *  + next 16-bit field has 6 options so contributes
 3385|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3386|       |	 *
 3387|       |	 * So we've effectively verified ~29 total bits of check data.
 3388|       |	 */
 3389|    231|	if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3389:6): [True: 95, False: 136]
  |  Branch (3389:21): [True: 95, False: 0]
  ------------------
 3390|     95|		if ((p[2] == '\001' && p[3] == '\002')
  ------------------
  |  Branch (3390:8): [True: 0, False: 95]
  |  Branch (3390:26): [True: 0, False: 0]
  ------------------
 3391|     95|		    || (p[2] == '\003' && p[3] == '\004')
  ------------------
  |  Branch (3391:11): [True: 94, False: 1]
  |  Branch (3391:29): [True: 94, False: 0]
  ------------------
 3392|     95|		    || (p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3392:11): [True: 0, False: 1]
  |  Branch (3392:29): [True: 0, False: 0]
  ------------------
 3393|     95|		    || (p[2] == '\006' && p[3] == '\006')
  ------------------
  |  Branch (3393:11): [True: 0, False: 1]
  |  Branch (3393:29): [True: 0, False: 0]
  ------------------
 3394|     95|		    || (p[2] == '\007' && p[3] == '\010')
  ------------------
  |  Branch (3394:11): [True: 0, False: 1]
  |  Branch (3394:29): [True: 0, False: 0]
  ------------------
 3395|     95|		    || (p[2] == '0' && p[3] == '0'))
  ------------------
  |  Branch (3395:11): [True: 1, False: 0]
  |  Branch (3395:26): [True: 1, False: 0]
  ------------------
 3396|     95|			return (29);
 3397|     95|	}
 3398|       |
 3399|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3400|       |	 * PK signature.  In particular, that would make it possible
 3401|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3402|       |	 * a network socket. */
 3403|       |
 3404|    136|	return (0);
 3405|    231|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3300|    476|{
 3301|    476|	struct zip *zip;
 3302|    476|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  196|    476|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3303|       |
 3304|    476|	zip = (struct zip *)(a->format->data);
 3305|    476|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3305:6): [True: 0, False: 476]
  ------------------
 3306|       |		/* Handle filenames as libarchive 2.x */
 3307|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3307:34): [True: 0, False: 0]
  ------------------
 3308|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3309|    476|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3309:13): [True: 0, False: 476]
  ------------------
 3310|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3310:7): [True: 0, False: 0]
  |  Branch (3310:22): [True: 0, False: 0]
  ------------------
 3311|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3312|      0|			    "zip: hdrcharset option needs a character-set name"
 3313|      0|			);
 3314|      0|		else {
 3315|      0|			zip->sconv = archive_string_conversion_from_charset(
 3316|      0|			    &a->archive, val, 0);
 3317|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3317:8): [True: 0, False: 0]
  ------------------
 3318|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3318:9): [True: 0, False: 0]
  ------------------
 3319|      0|					zip->sconv_utf8 = zip->sconv;
 3320|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3321|      0|			} else
 3322|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3323|      0|		}
 3324|      0|		return (ret);
 3325|    476|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3325:13): [True: 476, False: 0]
  ------------------
 3326|       |		/* Mostly useful for testing. */
 3327|    476|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3327:7): [True: 0, False: 476]
  |  Branch (3327:22): [True: 0, False: 476]
  ------------------
 3328|      0|			zip->crc32func = real_crc32;
 3329|      0|			zip->ignore_crc32 = 0;
 3330|    476|		} else {
 3331|    476|			zip->crc32func = fake_crc32;
 3332|    476|			zip->ignore_crc32 = 1;
 3333|    476|		}
 3334|    476|		return (ARCHIVE_OK);
  ------------------
  |  |  192|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3335|    476|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3335:13): [True: 0, False: 0]
  ------------------
 3336|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3336:34): [True: 0, False: 0]
  |  Branch (3336:49): [True: 0, False: 0]
  ------------------
 3337|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3338|      0|	}
 3339|       |
 3340|       |	/* Note: The "warn" return is just to inform the options
 3341|       |	 * supervisor that we didn't handle it.  It will generate
 3342|       |	 * a suitable error if no one used this option. */
 3343|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3344|    476|}
archive_read_support_format_zip.c:fake_crc32:
  413|  42.7k|{
  414|  42.7k|	(void)crc; /* UNUSED */
  415|  42.7k|	(void)buff; /* UNUSED */
  416|  42.7k|	(void)len; /* UNUSED */
  417|  42.7k|	return 0;
  418|  42.7k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3410|  27.6k|{
 3411|  27.6k|	struct zip *zip;
 3412|       |
 3413|  27.6k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  333|  27.6k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3414|  27.6k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3414:6): [True: 94, False: 27.5k]
  ------------------
 3415|     94|		a->archive.archive_format_name = "ZIP";
 3416|       |
 3417|  27.6k|	zip = (struct zip *)(a->format->data);
 3418|       |
 3419|       |	/*
 3420|       |	 * It should be sufficient to call archive_read_next_header() for
 3421|       |	 * a reader to determine if an entry is encrypted or not. If the
 3422|       |	 * encryption of an entry is only detectable when calling
 3423|       |	 * archive_read_data(), so be it. We'll do the same check there
 3424|       |	 * as well.
 3425|       |	 */
 3426|  27.6k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3426:6): [True: 94, False: 27.5k]
  ------------------
 3427|  27.6k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  370|  27.6k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3428|     94|		zip->has_encrypted_entries = 0;
 3429|       |
 3430|       |	/* Make sure we have a zip_entry structure to use. */
 3431|  27.6k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3431:6): [True: 94, False: 27.5k]
  ------------------
 3432|     94|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3433|     94|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3433:7): [True: 0, False: 94]
  ------------------
 3434|      0|			archive_set_error(&a->archive, ENOMEM,
 3435|      0|			    "Out  of memory");
 3436|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3437|      0|		}
 3438|     94|	}
 3439|  27.6k|	zip->entry = zip->zip_entries;
 3440|  27.6k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3441|       |
 3442|  27.6k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3442:6): [True: 840, False: 26.8k]
  ------------------
 3443|    840|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  158|    840|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3444|  27.6k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3444:6): [True: 840, False: 26.8k]
  ------------------
 3445|    840|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|    840|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3446|  27.6k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3447|  27.6k|	__archive_read_reset_passphrase(a);
 3448|       |
 3449|       |	/* Search ahead for the next local file header. */
 3450|  27.6k|	__archive_read_consume(a, zip->unconsumed);
 3451|  27.6k|	zip->unconsumed = 0;
 3452|  27.7k|	for (;;) {
 3453|  27.7k|		int64_t skipped = 0;
 3454|  27.7k|		const char *p, *end;
 3455|  27.7k|		ssize_t bytes;
 3456|       |
 3457|  27.7k|		p = __archive_read_ahead(a, 4, &bytes);
 3458|  27.7k|		if (p == NULL)
  ------------------
  |  Branch (3458:7): [True: 50, False: 27.6k]
  ------------------
 3459|     50|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|     50|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3460|  27.6k|		end = p + bytes;
 3461|       |
 3462|  19.1M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3462:10): [True: 19.1M, False: 50]
  ------------------
 3463|  19.1M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3463:8): [True: 64.4k, False: 19.0M]
  |  Branch (3463:23): [True: 33.1k, False: 31.3k]
  ------------------
 3464|  33.1k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3464:9): [True: 27.7k, False: 5.36k]
  |  Branch (3464:27): [True: 27.6k, False: 127]
  ------------------
 3465|       |					/* Regular file entry. */
 3466|  27.6k|					__archive_read_consume(a, skipped);
 3467|  27.6k|					return zip_read_local_file_header(a,
 3468|  27.6k|					    entry, zip);
 3469|  27.6k|				}
 3470|       |
 3471|       |                              /*
 3472|       |                               * TODO: We cannot restore permissions
 3473|       |                               * based only on the local file headers.
 3474|       |                               * Consider scanning the central
 3475|       |                               * directory and returning additional
 3476|       |                               * entries for at least directories.
 3477|       |                               * This would allow us to properly set
 3478|       |                               * directory permissions.
 3479|       |			       *
 3480|       |			       * This won't help us fix symlinks
 3481|       |			       * and may not help with regular file
 3482|       |			       * permissions, either.  <sigh>
 3483|       |                               */
 3484|  5.49k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3484:35): [True: 544, False: 4.95k]
  |  Branch (3484:53): [True: 0, False: 544]
  ------------------
 3485|      0|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  191|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3486|      0|                              }
 3487|       |
 3488|       |                              /* End of central directory?  Must be an
 3489|       |                               * empty archive. */
 3490|  5.49k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3490:36): [True: 1, False: 5.49k]
  |  Branch (3490:54): [True: 1, False: 0]
  ------------------
 3491|  5.49k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (3491:39): [True: 19, False: 5.47k]
  |  Branch (3491:57): [True: 0, False: 19]
  ------------------
 3492|      1|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  191|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3493|  5.49k|			}
 3494|  19.1M|			++p;
 3495|  19.1M|			++skipped;
 3496|  19.1M|		}
 3497|     50|		__archive_read_consume(a, skipped);
 3498|     50|	}
 3499|  27.6k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
  928|  27.6k|{
  929|  27.6k|	const char *p;
  930|  27.6k|	const void *h;
  931|  27.6k|	const wchar_t *wp;
  932|  27.6k|	const char *cp;
  933|  27.6k|	size_t len, filename_length, extra_length;
  934|  27.6k|	struct archive_string_conv *sconv;
  935|  27.6k|	struct zip_entry *zip_entry = zip->entry;
  936|  27.6k|	struct zip_entry zip_entry_central_dir;
  937|  27.6k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  192|  27.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  938|  27.6k|	char version;
  939|       |
  940|       |	/* Save a copy of the original for consistency checks. */
  941|  27.6k|	zip_entry_central_dir = *zip_entry;
  942|       |
  943|  27.6k|	zip->decompress_init = 0;
  944|  27.6k|	zip->end_of_entry = 0;
  945|  27.6k|	zip->entry_uncompressed_bytes_read = 0;
  946|  27.6k|	zip->entry_compressed_bytes_read = 0;
  947|  27.6k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
  948|       |
  949|       |	/* Setup default conversion. */
  950|  27.6k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (950:6): [True: 27.6k, False: 0]
  |  Branch (950:28): [True: 95, False: 27.5k]
  ------------------
  951|     95|		zip->sconv_default =
  952|     95|		    archive_string_default_conversion_for_read(&(a->archive));
  953|     95|		zip->init_default_conversion = 1;
  954|     95|	}
  955|       |
  956|  27.6k|	if ((p = __archive_read_ahead(a, 30, NULL)) == NULL) {
  ------------------
  |  Branch (956:6): [True: 0, False: 27.6k]
  ------------------
  957|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  958|      0|		    "Truncated ZIP file header");
  959|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  960|      0|	}
  961|       |
  962|  27.6k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (962:6): [True: 0, False: 27.6k]
  ------------------
  963|      0|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
  964|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  965|      0|	}
  966|  27.6k|	version = p[4];
  967|  27.6k|	zip_entry->system = p[5];
  968|  27.6k|	zip_entry->zip_flags = archive_le16dec(p + 6);
  969|  27.6k|	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  120|  27.6k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  122|  27.6k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (969:6): [True: 5.56k, False: 22.0k]
  ------------------
  970|  5.56k|		zip->has_encrypted_entries = 1;
  971|  5.56k|		archive_entry_set_is_data_encrypted(entry, 1);
  972|  5.56k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  126|  11.1k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (972:7): [True: 3.69k, False: 1.86k]
  ------------------
  973|  5.56k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  120|  9.25k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (973:4): [True: 2.44k, False: 1.25k]
  ------------------
  974|  5.56k|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  122|  2.44k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (974:4): [True: 0, False: 2.44k]
  ------------------
  975|      0|			archive_entry_set_is_metadata_encrypted(entry, 1);
  976|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  977|      0|		}
  978|  5.56k|	}
  979|  27.6k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  120|  27.6k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  980|  27.6k|	zip_entry->compression = (char)archive_le16dec(p + 8);
  981|  27.6k|	zip_entry->mtime = zip_time(p + 10);
  982|  27.6k|	zip_entry->crc32 = archive_le32dec(p + 14);
  983|  27.6k|	if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  27.6k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (983:6): [True: 7.10k, False: 20.5k]
  ------------------
  984|  7.10k|		zip_entry->decdat = p[11];
  985|  20.5k|	else
  986|  20.5k|		zip_entry->decdat = p[17];
  987|  27.6k|	zip_entry->compressed_size = archive_le32dec(p + 18);
  988|  27.6k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
  989|  27.6k|	filename_length = archive_le16dec(p + 26);
  990|  27.6k|	extra_length = archive_le16dec(p + 28);
  991|       |
  992|  27.6k|	__archive_read_consume(a, 30);
  993|       |
  994|       |	/* Read the filename. */
  995|  27.6k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (995:6): [True: 5, False: 27.6k]
  ------------------
  996|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  997|      5|		    "Truncated ZIP file header");
  998|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  999|      5|	}
 1000|  27.6k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  123|  27.6k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1000:6): [True: 12.0k, False: 15.5k]
  ------------------
 1001|       |		/* The filename is stored to be UTF-8. */
 1002|  12.0k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1002:7): [True: 33, False: 11.9k]
  ------------------
 1003|     33|			zip->sconv_utf8 =
 1004|     33|			    archive_string_conversion_from_charset(
 1005|     33|				&a->archive, "UTF-8", 1);
 1006|     33|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1006:8): [True: 0, False: 33]
  ------------------
 1007|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1008|     33|		}
 1009|  12.0k|		sconv = zip->sconv_utf8;
 1010|  15.5k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (1010:13): [True: 0, False: 15.5k]
  ------------------
 1011|      0|		sconv = zip->sconv;
 1012|  15.5k|	else
 1013|  15.5k|		sconv = zip->sconv_default;
 1014|       |
 1015|  27.6k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  27.6k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1015:6): [True: 5.71k, False: 21.8k]
  ------------------
 1016|  27.6k|	    h, filename_length, sconv) != 0) {
 1017|  5.71k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1017:7): [True: 0, False: 5.71k]
  ------------------
 1018|      0|			archive_set_error(&a->archive, ENOMEM,
 1019|      0|			    "Can't allocate memory for Pathname");
 1020|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1021|      0|		}
 1022|  5.71k|		archive_set_error(&a->archive,
 1023|  5.71k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|  5.71k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1024|  5.71k|		    "Pathname cannot be converted "
 1025|  5.71k|		    "from %s to current locale.",
 1026|  5.71k|		    archive_string_conversion_charset_name(sconv));
 1027|  5.71k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  194|  5.71k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1028|  5.71k|	}
 1029|  27.6k|	__archive_read_consume(a, filename_length);
 1030|       |
 1031|       |	/* Read the extra data. */
 1032|  27.6k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1032:6): [True: 3, False: 27.6k]
  ------------------
 1033|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1034|      3|		    "Truncated ZIP file header");
 1035|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1036|      3|	}
 1037|       |
 1038|  27.6k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  192|  27.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1038:6): [True: 11, False: 27.5k]
  ------------------
 1039|  27.6k|	    zip_entry)) {
 1040|     11|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1041|     11|	}
 1042|  27.5k|	__archive_read_consume(a, extra_length);
 1043|       |
 1044|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1045|       |	 * stats the pipe instead of synthesizing a file entry. */
 1046|  27.5k|	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  184|  27.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  191|  27.5k|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1046:6): [True: 0, False: 27.5k]
  ------------------
 1047|      0|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  184|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1048|      0|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1049|      0|	}
 1050|       |
 1051|       |	/* If the mode is totally empty, set some sane default. */
 1052|  27.5k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1052:6): [True: 27.3k, False: 199]
  ------------------
 1053|  27.3k|		zip_entry->mode |= 0664;
 1054|  27.3k|	}
 1055|       |
 1056|       |	/* Windows archivers sometimes use backslash as the directory
 1057|       |	 * separator. Normalize to slash. */
 1058|  27.5k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1058:6): [True: 21.2k, False: 6.38k]
  ------------------
 1059|  27.5k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1059:6): [True: 14.8k, False: 6.34k]
  ------------------
 1060|  14.8k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1060:7): [True: 14.6k, False: 269]
  |  Branch (1060:35): [True: 0, False: 14.6k]
  ------------------
 1061|      0|			size_t i;
 1062|      0|			struct archive_wstring s;
 1063|      0|			archive_string_init(&s);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1064|      0|			archive_wstrcpy(&s, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1065|      0|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1065:16): [True: 0, False: 0]
  ------------------
 1066|      0|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1066:9): [True: 0, False: 0]
  ------------------
 1067|      0|					s.s[i] = '/';
 1068|      0|			}
 1069|      0|			archive_entry_copy_pathname_w(entry, s.s);
 1070|      0|			archive_wstring_free(&s);
 1071|      0|		}
 1072|  14.8k|	}
 1073|       |
 1074|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1075|       |	 * even if the External File Attributes contains bogus values.  If this
 1076|       |	 * is not a directory and there is no type, assume a regular file. */
 1077|  27.5k|	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  184|  27.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  190|  27.5k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1077:6): [True: 27.5k, False: 2]
  ------------------
 1078|  27.5k|		int has_slash;
 1079|       |
 1080|  27.5k|		wp = archive_entry_pathname_w(entry);
 1081|  27.5k|		if (wp != NULL) {
  ------------------
  |  Branch (1081:7): [True: 19.8k, False: 7.69k]
  ------------------
 1082|  19.8k|			len = wcslen(wp);
 1083|  19.8k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1083:16): [True: 14.9k, False: 4.94k]
  |  Branch (1083:27): [True: 244, False: 14.7k]
  ------------------
 1084|  19.8k|		} else {
 1085|  7.69k|			cp = archive_entry_pathname(entry);
 1086|  7.69k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1086:10): [True: 1.98k, False: 5.71k]
  ------------------
 1087|  7.69k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1087:16): [True: 1.98k, False: 5.71k]
  |  Branch (1087:27): [True: 0, False: 1.98k]
  ------------------
 1088|  7.69k|		}
 1089|       |		/* Correct file type as needed. */
 1090|  27.5k|		if (has_slash) {
  ------------------
  |  Branch (1090:7): [True: 244, False: 27.3k]
  ------------------
 1091|    244|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  184|    244|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1092|    244|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  190|    244|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1093|    244|			zip_entry->mode |= 0111;
 1094|  27.3k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  184|  27.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1094:14): [True: 27.1k, False: 197]
  ------------------
 1095|  27.1k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  185|  27.1k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1096|  27.1k|		}
 1097|  27.5k|	}
 1098|       |
 1099|       |	/* Make sure directories end in '/' */
 1100|  27.5k|	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  184|  27.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  190|  27.5k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1100:6): [True: 246, False: 27.3k]
  ------------------
 1101|    246|		wp = archive_entry_pathname_w(entry);
 1102|    246|		if (wp != NULL) {
  ------------------
  |  Branch (1102:7): [True: 246, False: 0]
  ------------------
 1103|    246|			len = wcslen(wp);
 1104|    246|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1104:8): [True: 246, False: 0]
  |  Branch (1104:19): [True: 2, False: 244]
  ------------------
 1105|      2|				struct archive_wstring s;
 1106|      2|				archive_string_init(&s);
  ------------------
  |  |   71|      2|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1107|      2|				archive_wstrcat(&s, wp);
 1108|      2|				archive_wstrappend_wchar(&s, L'/');
 1109|      2|				archive_entry_copy_pathname_w(entry, s.s);
 1110|      2|				archive_wstring_free(&s);
 1111|      2|			}
 1112|    246|		} else {
 1113|      0|			cp = archive_entry_pathname(entry);
 1114|      0|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1114:10): [True: 0, False: 0]
  ------------------
 1115|      0|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1115:8): [True: 0, False: 0]
  |  Branch (1115:19): [True: 0, False: 0]
  ------------------
 1116|      0|				struct archive_string s;
 1117|      0|				archive_string_init(&s);
  ------------------
  |  |   71|      0|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1118|      0|				archive_strcat(&s, cp);
 1119|      0|				archive_strappend_char(&s, '/');
 1120|      0|				archive_entry_set_pathname(entry, s.s);
 1121|      0|				archive_string_free(&s);
 1122|      0|			}
 1123|      0|		}
 1124|    246|	}
 1125|       |
 1126|  27.5k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  130|  27.5k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1126:6): [True: 2, False: 27.5k]
  ------------------
 1127|       |		/* If this came from the central dir, its size info
 1128|       |		 * is definitive, so ignore the length-at-end flag. */
 1129|      2|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  121|      2|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1130|       |		/* If local header is missing a value, use the one from
 1131|       |		   the central directory.  If both have it, warn about
 1132|       |		   mismatches. */
 1133|      2|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1133:7): [True: 0, False: 2]
  ------------------
 1134|      0|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1135|      2|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1135:14): [True: 0, False: 2]
  ------------------
 1136|      2|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1136:10): [True: 0, False: 0]
  ------------------
 1137|      0|			archive_set_error(&a->archive,
 1138|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1139|      0|			    "Inconsistent CRC32 values");
 1140|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1141|      0|		}
 1142|      2|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1142:7): [True: 0, False: 2]
  ------------------
 1143|      2|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1143:10): [True: 0, False: 2]
  ------------------
 1144|      0|			zip_entry->compressed_size
 1145|      0|			    = zip_entry_central_dir.compressed_size;
 1146|      2|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1146:14): [True: 1, False: 1]
  ------------------
 1147|      2|		    != zip_entry_central_dir.compressed_size) {
 1148|      1|			archive_set_error(&a->archive,
 1149|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1150|      1|			    "Inconsistent compressed size: "
 1151|      1|			    "%jd in central directory, %jd in local header",
 1152|      1|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1153|      1|			    (intmax_t)zip_entry->compressed_size);
 1154|      1|			ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1155|      1|		}
 1156|      2|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1156:7): [True: 1, False: 1]
  ------------------
 1157|      2|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1157:4): [True: 0, False: 1]
  ------------------
 1158|      1|			zip_entry->uncompressed_size
 1159|      1|			    = zip_entry_central_dir.uncompressed_size;
 1160|      1|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1160:14): [True: 0, False: 1]
  ------------------
 1161|      1|		    != zip_entry_central_dir.uncompressed_size) {
 1162|      0|			archive_set_error(&a->archive,
 1163|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1164|      0|			    "Inconsistent uncompressed size: "
 1165|      0|			    "%jd in central directory, %jd in local header",
 1166|      0|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1167|      0|			    (intmax_t)zip_entry->uncompressed_size);
 1168|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1169|      0|		}
 1170|      2|	}
 1171|       |
 1172|       |	/* Populate some additional entry fields: */
 1173|  27.5k|	archive_entry_set_mode(entry, zip_entry->mode);
 1174|  27.5k|	archive_entry_set_uid(entry, zip_entry->uid);
 1175|  27.5k|	archive_entry_set_gid(entry, zip_entry->gid);
 1176|  27.5k|	archive_entry_set_mtime(entry, zip_entry->mtime, 0);
 1177|  27.5k|	archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1178|  27.5k|	archive_entry_set_atime(entry, zip_entry->atime, 0);
 1179|       |
 1180|  27.5k|	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  184|  27.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  186|  27.5k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1180:6): [True: 0, False: 27.5k]
  ------------------
 1181|      0|		size_t linkname_length;
 1182|       |
 1183|      0|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1183:7): [True: 0, False: 0]
  ------------------
 1184|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1185|      0|			    "Zip file with oversized link entry");
 1186|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1187|      0|		}
 1188|       |
 1189|      0|		linkname_length = (size_t)zip_entry->compressed_size;
 1190|       |
 1191|      0|		archive_entry_set_size(entry, 0);
 1192|       |
 1193|       |		// take into account link compression if any
 1194|      0|		size_t linkname_full_length = linkname_length;
 1195|      0|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1195:7): [True: 0, False: 0]
  ------------------
 1196|      0|		{
 1197|       |			// symlink target string appeared to be compressed
 1198|      0|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1199|      0|			const void *uncompressed_buffer = NULL;
 1200|       |
 1201|      0|			switch (zip->entry->compression)
 1202|      0|			{
 1203|      0|#if HAVE_ZLIB_H
 1204|      0|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1204:5): [True: 0, False: 0]
  ------------------
 1205|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1206|      0|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1207|      0|						&linkname_full_length, NULL);
 1208|      0|					break;
 1209|      0|#endif
 1210|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1211|      0|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1211:5): [True: 0, False: 0]
  ------------------
 1212|       |					/*(see zip file format specification, section 4.4.5)*/
 1213|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1214|      0|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1215|      0|						&linkname_full_length, NULL);
 1216|      0|					break;
 1217|      0|#endif
 1218|      0|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1218:5): [True: 0, False: 0]
  ------------------
 1219|      0|					break;
 1220|      0|			}
 1221|      0|			if (status == ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1221:8): [True: 0, False: 0]
  ------------------
 1222|      0|			{
 1223|      0|				p = uncompressed_buffer;
 1224|      0|			}
 1225|      0|			else
 1226|      0|			{
 1227|      0|				archive_set_error(&a->archive,
 1228|      0|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1229|      0|					"Unsupported ZIP compression method "
 1230|      0|					"during decompression of link entry (%d: %s)",
 1231|      0|					zip->entry->compression,
 1232|      0|					compression_name(zip->entry->compression));
 1233|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1234|      0|			}
 1235|      0|		}
 1236|      0|		else
 1237|      0|		{
 1238|      0|			p = __archive_read_ahead(a, linkname_length, NULL);
 1239|      0|		}
 1240|       |
 1241|      0|		if (p == NULL) {
  ------------------
  |  Branch (1241:7): [True: 0, False: 0]
  ------------------
 1242|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1243|      0|			    "Truncated Zip file");
 1244|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1245|      0|		}
 1246|       |
 1247|      0|		sconv = zip->sconv;
 1248|      0|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  123|      0|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1248:7): [True: 0, False: 0]
  |  Branch (1248:24): [True: 0, False: 0]
  ------------------
 1249|      0|			sconv = zip->sconv_utf8;
 1250|      0|		if (sconv == NULL)
  ------------------
  |  Branch (1250:7): [True: 0, False: 0]
  ------------------
 1251|      0|			sconv = zip->sconv_default;
 1252|      0|		if (archive_entry_copy_symlink_l(entry, p, linkname_full_length,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (1252:7): [True: 0, False: 0]
  ------------------
 1253|      0|		    sconv) != 0) {
 1254|      0|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1254:8): [True: 0, False: 0]
  |  Branch (1254:27): [True: 0, False: 0]
  ------------------
 1255|      0|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  123|      0|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1255:8): [True: 0, False: 0]
  ------------------
 1256|      0|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1257|      0|				linkname_full_length, NULL);
 1258|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1258:8): [True: 0, False: 0]
  ------------------
 1259|      0|				archive_set_error(&a->archive, ENOMEM,
 1260|      0|				    "Can't allocate memory for Symlink");
 1261|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1262|      0|			}
 1263|       |			/*
 1264|       |			 * Since there is no character-set regulation for
 1265|       |			 * symlink name, do not report the conversion error
 1266|       |			 * in an automatic conversion.
 1267|       |			 */
 1268|      0|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1268:8): [True: 0, False: 0]
  ------------------
 1269|      0|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  123|      0|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1269:8): [True: 0, False: 0]
  ------------------
 1270|      0|				archive_set_error(&a->archive,
 1271|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1272|      0|				    "Symlink cannot be converted "
 1273|      0|				    "from %s to current locale.",
 1274|      0|				    archive_string_conversion_charset_name(
 1275|      0|					sconv));
 1276|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  194|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1277|      0|			}
 1278|      0|		}
 1279|      0|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1280|       |
 1281|      0|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1281:7): [True: 0, False: 0]
  ------------------
 1282|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1283|      0|			    "Read error skipping symlink target name");
 1284|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1285|      0|		}
 1286|  27.5k|	} else if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  27.5k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1286:13): [True: 20.4k, False: 7.09k]
  ------------------
 1287|  27.5k|	   || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (1287:9): [True: 1.49k, False: 5.60k]
  ------------------
 1288|  21.9k|	       && zip_entry->uncompressed_size != 0xffffffff)) {
  ------------------
  |  Branch (1288:12): [True: 1.49k, False: 0]
  ------------------
 1289|       |		/* Set the size only if it's meaningful. */
 1290|  21.9k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1291|  21.9k|	}
 1292|  27.5k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1293|       |
 1294|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1295|  27.5k|	if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  27.5k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1295:6): [True: 20.4k, False: 7.09k]
  ------------------
 1296|  27.5k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1296:9): [True: 297, False: 20.1k]
  ------------------
 1297|    297|		zip->end_of_entry = 1;
 1298|       |
 1299|       |	/* Set up a more descriptive format name. */
 1300|  27.5k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  27.5k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1301|  27.5k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1302|  27.5k|	    version / 10, version % 10,
 1303|  27.5k|	    compression_name(zip->entry->compression));
 1304|  27.5k|	a->archive.archive_format_name = zip->format_name.s;
 1305|       |
 1306|  27.5k|	return (ret);
 1307|  27.5k|}
archive_read_support_format_zip.c:zip_time:
  471|  27.6k|{
  472|  27.6k|	int msTime, msDate;
  473|  27.6k|	struct tm ts;
  474|       |
  475|  27.6k|	msTime = (0xff & (unsigned)p[0]) + 256 * (0xff & (unsigned)p[1]);
  476|  27.6k|	msDate = (0xff & (unsigned)p[2]) + 256 * (0xff & (unsigned)p[3]);
  477|       |
  478|  27.6k|	memset(&ts, 0, sizeof(ts));
  479|  27.6k|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80; /* Years since 1900. */
  480|  27.6k|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1; /* Month number. */
  481|  27.6k|	ts.tm_mday = msDate & 0x1f; /* Day of month. */
  482|  27.6k|	ts.tm_hour = (msTime >> 11) & 0x1f;
  483|  27.6k|	ts.tm_min = (msTime >> 5) & 0x3f;
  484|  27.6k|	ts.tm_sec = (msTime << 1) & 0x3e;
  485|  27.6k|	ts.tm_isdst = -1;
  486|  27.6k|	return mktime(&ts);
  487|  27.6k|}
archive_read_support_format_zip.c:process_extra:
  497|  27.6k|{
  498|  27.6k|	unsigned offset = 0;
  499|  27.6k|	struct zip *zip = (struct zip *)(a->format->data);
  500|       |
  501|  27.6k|	if (extra_length == 0) {
  ------------------
  |  Branch (501:6): [True: 19.8k, False: 7.71k]
  ------------------
  502|  19.8k|		return ARCHIVE_OK;
  ------------------
  |  |  192|  19.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  503|  19.8k|	}
  504|       |
  505|  7.71k|	if (extra_length < 4) {
  ------------------
  |  Branch (505:6): [True: 239, False: 7.47k]
  ------------------
  506|    239|		size_t i = 0;
  507|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  508|       |		 * are all 0 and ignore them instead of returning an error.
  509|       |		 *
  510|       |		 * This is not technically correct, but some ZIP files look
  511|       |		 * like this and other tools support those files - so let's
  512|       |		 * also  support them.
  513|       |		 */
  514|    717|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (514:10): [True: 478, False: 239]
  ------------------
  515|    478|			if (p[i] != 0) {
  ------------------
  |  Branch (515:8): [True: 0, False: 478]
  ------------------
  516|      0|				archive_set_error(&a->archive,
  517|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  518|      0|				    "Too-small extra data: "
  519|      0|				    "Need at least 4 bytes, "
  520|      0|				    "but only found %d bytes",
  521|      0|				    (int)extra_length);
  522|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  523|      0|			}
  524|    478|		}
  525|       |
  526|    239|		return ARCHIVE_OK;
  ------------------
  |  |  192|    239|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  527|    239|	}
  528|       |
  529|  16.2k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (529:9): [True: 8.83k, False: 7.46k]
  ------------------
  530|  8.83k|		unsigned short headerid = archive_le16dec(p + offset);
  531|  8.83k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  532|       |
  533|  8.83k|		offset += 4;
  534|  8.83k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (534:7): [True: 10, False: 8.82k]
  ------------------
  535|     10|			archive_set_error(&a->archive,
  536|     10|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  197|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  537|     10|			    "Need %d bytes but only found %d bytes",
  538|     10|			    (int)datasize, (int)(extra_length - offset));
  539|     10|			return ARCHIVE_FAILED;
  ------------------
  |  |  196|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  540|     10|		}
  541|       |#ifdef DEBUG
  542|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  543|       |		    headerid, datasize);
  544|       |#endif
  545|  8.82k|		switch (headerid) {
  546|    540|		case 0x0001:
  ------------------
  |  Branch (546:3): [True: 540, False: 8.28k]
  ------------------
  547|       |			/* Zip64 extended information extra field. */
  548|    540|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  129|    540|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  549|    540|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (549:8): [True: 483, False: 57]
  ------------------
  550|    483|				uint64_t t = 0;
  551|    483|				if (datasize < 8
  ------------------
  |  Branch (551:9): [True: 0, False: 483]
  ------------------
  552|    483|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (552:12): [True: 0, False: 483]
  ------------------
  553|    483|				    INT64_MAX) {
  554|      0|					archive_set_error(&a->archive,
  555|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  556|      0|					    "Malformed 64-bit "
  557|      0|					    "uncompressed size");
  558|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  559|      0|				}
  560|    483|				zip_entry->uncompressed_size = t;
  561|    483|				offset += 8;
  562|    483|				datasize -= 8;
  563|    483|			}
  564|    540|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (564:8): [True: 1, False: 539]
  ------------------
  565|      1|				uint64_t t = 0;
  566|      1|				if (datasize < 8
  ------------------
  |  Branch (566:9): [True: 1, False: 0]
  ------------------
  567|      1|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (567:12): [True: 0, False: 0]
  ------------------
  568|      1|				    INT64_MAX) {
  569|      1|					archive_set_error(&a->archive,
  570|      1|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  571|      1|					    "Malformed 64-bit "
  572|      1|					    "compressed size");
  573|      1|					return ARCHIVE_FAILED;
  ------------------
  |  |  196|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  574|      1|				}
  575|      0|				zip_entry->compressed_size = t;
  576|      0|				offset += 8;
  577|      0|				datasize -= 8;
  578|      0|			}
  579|    539|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (579:8): [True: 0, False: 539]
  ------------------
  580|      0|				uint64_t t = 0;
  581|      0|				if (datasize < 8
  ------------------
  |  Branch (581:9): [True: 0, False: 0]
  ------------------
  582|      0|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (582:12): [True: 0, False: 0]
  ------------------
  583|      0|				    INT64_MAX) {
  584|      0|					archive_set_error(&a->archive,
  585|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  586|      0|					    "Malformed 64-bit "
  587|      0|					    "local header offset");
  588|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  589|      0|				}
  590|      0|				zip_entry->local_header_offset = t;
  591|      0|				offset += 8;
  592|      0|				datasize -= 8;
  593|      0|			}
  594|       |			/* archive_le32dec(p + offset) gives disk
  595|       |			 * on which file starts, but we don't handle
  596|       |			 * multi-volume Zip files. */
  597|    539|			break;
  598|       |#ifdef DEBUG
  599|       |		case 0x0017:
  600|       |		{
  601|       |			/* Strong encryption field. */
  602|       |			if (archive_le16dec(p + offset) == 2) {
  603|       |				unsigned algId =
  604|       |					archive_le16dec(p + offset + 2);
  605|       |				unsigned bitLen =
  606|       |					archive_le16dec(p + offset + 4);
  607|       |				int	 flags =
  608|       |					archive_le16dec(p + offset + 6);
  609|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  610|       |				    "flgas=%d\n", algId, bitLen,flags);
  611|       |			}
  612|       |			break;
  613|       |		}
  614|       |#endif
  615|    539|		case 0x5455:
  ------------------
  |  Branch (615:3): [True: 0, False: 8.82k]
  ------------------
  616|      0|		{
  617|       |			/* Extended time field "UT". */
  618|      0|			int flags;
  619|      0|			if (datasize == 0) {
  ------------------
  |  Branch (619:8): [True: 0, False: 0]
  ------------------
  620|      0|				archive_set_error(&a->archive,
  621|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  622|      0|				    "Incomplete extended time field");
  623|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  624|      0|			}
  625|      0|			flags = p[offset];
  626|      0|			offset++;
  627|      0|			datasize--;
  628|       |			/* Flag bits indicate which dates are present. */
  629|      0|			if (flags & 0x01)
  ------------------
  |  Branch (629:8): [True: 0, False: 0]
  ------------------
  630|      0|			{
  631|       |#ifdef DEBUG
  632|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  633|       |				    (long long)zip_entry->mtime,
  634|       |				    archive_le32dec(p + offset));
  635|       |#endif
  636|      0|				if (datasize < 4)
  ------------------
  |  Branch (636:9): [True: 0, False: 0]
  ------------------
  637|      0|					break;
  638|      0|				zip_entry->mtime = archive_le32dec(p + offset);
  639|      0|				offset += 4;
  640|      0|				datasize -= 4;
  641|      0|			}
  642|      0|			if (flags & 0x02)
  ------------------
  |  Branch (642:8): [True: 0, False: 0]
  ------------------
  643|      0|			{
  644|      0|				if (datasize < 4)
  ------------------
  |  Branch (644:9): [True: 0, False: 0]
  ------------------
  645|      0|					break;
  646|      0|				zip_entry->atime = archive_le32dec(p + offset);
  647|      0|				offset += 4;
  648|      0|				datasize -= 4;
  649|      0|			}
  650|      0|			if (flags & 0x04)
  ------------------
  |  Branch (650:8): [True: 0, False: 0]
  ------------------
  651|      0|			{
  652|      0|				if (datasize < 4)
  ------------------
  |  Branch (652:9): [True: 0, False: 0]
  ------------------
  653|      0|					break;
  654|      0|				zip_entry->ctime = archive_le32dec(p + offset);
  655|      0|				offset += 4;
  656|      0|				datasize -= 4;
  657|      0|			}
  658|      0|			break;
  659|      0|		}
  660|    945|		case 0x5855:
  ------------------
  |  Branch (660:3): [True: 945, False: 7.87k]
  ------------------
  661|    945|		{
  662|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  663|    945|			if (datasize >= 8) {
  ------------------
  |  Branch (663:8): [True: 582, False: 363]
  ------------------
  664|    582|				zip_entry->atime = archive_le32dec(p + offset);
  665|    582|				zip_entry->mtime =
  666|    582|				    archive_le32dec(p + offset + 4);
  667|    582|			}
  668|    945|			if (datasize >= 12) {
  ------------------
  |  Branch (668:8): [True: 0, False: 945]
  ------------------
  669|      0|				zip_entry->uid =
  670|      0|				    archive_le16dec(p + offset + 8);
  671|      0|				zip_entry->gid =
  672|      0|				    archive_le16dec(p + offset + 10);
  673|      0|			}
  674|    945|			break;
  675|      0|		}
  676|  2.67k|		case 0x6c78:
  ------------------
  |  Branch (676:3): [True: 2.67k, False: 6.14k]
  ------------------
  677|  2.67k|		{
  678|       |			/* Experimental 'xl' field */
  679|       |			/*
  680|       |			 * Introduced Dec 2013 to provide a way to
  681|       |			 * include external file attributes (and other
  682|       |			 * fields that ordinarily appear only in
  683|       |			 * central directory) in local file header.
  684|       |			 * This provides file type and permission
  685|       |			 * information necessary to support full
  686|       |			 * streaming extraction.  Currently being
  687|       |			 * discussed with other Zip developers
  688|       |			 * ... subject to change.
  689|       |			 *
  690|       |			 * Format:
  691|       |			 *  The field starts with a bitmap that specifies
  692|       |			 *  which additional fields are included.  The
  693|       |			 *  bitmap is variable length and can be extended in
  694|       |			 *  the future.
  695|       |			 *
  696|       |			 *  n bytes - feature bitmap: first byte has low-order
  697|       |			 *    7 bits.  If high-order bit is set, a subsequent
  698|       |			 *    byte holds the next 7 bits, etc.
  699|       |			 *
  700|       |			 *  if bitmap & 1, 2 byte "version made by"
  701|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
  702|       |			 *  if bitmap & 4, 4 byte "external file attributes"
  703|       |			 *  if bitmap & 8, 2 byte comment length + n byte
  704|       |			 *  comment
  705|       |			 */
  706|  2.67k|			int bitmap, bitmap_last;
  707|       |
  708|  2.67k|			if (datasize < 1)
  ------------------
  |  Branch (708:8): [True: 0, False: 2.67k]
  ------------------
  709|      0|				break;
  710|  2.67k|			bitmap_last = bitmap = 0xff & p[offset];
  711|  2.67k|			offset += 1;
  712|  2.67k|			datasize -= 1;
  713|       |
  714|       |			/* We only support first 7 bits of bitmap; skip rest. */
  715|  4.40k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (715:11): [True: 1.73k, False: 2.67k]
  ------------------
  716|  4.40k|			    && datasize >= 1) {
  ------------------
  |  Branch (716:11): [True: 1.73k, False: 0]
  ------------------
  717|  1.73k|				bitmap_last = p[offset];
  718|  1.73k|				offset += 1;
  719|  1.73k|				datasize -= 1;
  720|  1.73k|			}
  721|       |
  722|  2.67k|			if (bitmap & 1) {
  ------------------
  |  Branch (722:8): [True: 346, False: 2.32k]
  ------------------
  723|       |				/* 2 byte "version made by" */
  724|    346|				if (datasize < 2)
  ------------------
  |  Branch (724:9): [True: 0, False: 346]
  ------------------
  725|      0|					break;
  726|    346|				zip_entry->system
  727|    346|				    = archive_le16dec(p + offset) >> 8;
  728|    346|				offset += 2;
  729|    346|				datasize -= 2;
  730|    346|			}
  731|  2.67k|			if (bitmap & 2) {
  ------------------
  |  Branch (731:8): [True: 0, False: 2.67k]
  ------------------
  732|       |				/* 2 byte "internal file attributes" */
  733|      0|				uint32_t internal_attributes;
  734|      0|				if (datasize < 2)
  ------------------
  |  Branch (734:9): [True: 0, False: 0]
  ------------------
  735|      0|					break;
  736|      0|				internal_attributes
  737|      0|				    = archive_le16dec(p + offset);
  738|       |				/* Not used by libarchive at present. */
  739|      0|				(void)internal_attributes; /* UNUSED */
  740|      0|				offset += 2;
  741|      0|				datasize -= 2;
  742|      0|			}
  743|  2.67k|			if (bitmap & 4) {
  ------------------
  |  Branch (743:8): [True: 1.93k, False: 744]
  ------------------
  744|       |				/* 4 byte "external file attributes" */
  745|  1.93k|				uint32_t external_attributes;
  746|  1.93k|				if (datasize < 4)
  ------------------
  |  Branch (746:9): [True: 0, False: 1.93k]
  ------------------
  747|      0|					break;
  748|  1.93k|				external_attributes
  749|  1.93k|				    = archive_le32dec(p + offset);
  750|  1.93k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (750:9): [True: 0, False: 1.93k]
  ------------------
  751|      0|					zip_entry->mode
  752|      0|					    = external_attributes >> 16;
  753|  1.93k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (753:16): [True: 197, False: 1.73k]
  ------------------
  754|       |					// Interpret MSDOS directory bit
  755|    197|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (755:10): [True: 0, False: 197]
  ------------------
  756|    197|					    0x10)) {
  757|      0|						zip_entry->mode =
  758|      0|						    AE_IFDIR | 0775;
  ------------------
  |  |  190|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  759|    197|					} else {
  760|    197|						zip_entry->mode =
  761|    197|						    AE_IFREG | 0664;
  ------------------
  |  |  185|    197|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  762|    197|					}
  763|    197|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (763:10): [True: 0, False: 197]
  ------------------
  764|    197|					    0x01)) {
  765|       |						/* Read-only bit;
  766|       |						 * strip write permissions */
  767|      0|						zip_entry->mode &= 0555;
  768|      0|					}
  769|  1.73k|				} else {
  770|  1.73k|					zip_entry->mode = 0;
  771|  1.73k|				}
  772|  1.93k|				offset += 4;
  773|  1.93k|				datasize -= 4;
  774|  1.93k|			}
  775|  2.67k|			if (bitmap & 8) {
  ------------------
  |  Branch (775:8): [True: 1.58k, False: 1.09k]
  ------------------
  776|       |				/* 2 byte comment length + comment */
  777|  1.58k|				uint32_t comment_length;
  778|  1.58k|				if (datasize < 2)
  ------------------
  |  Branch (778:9): [True: 0, False: 1.58k]
  ------------------
  779|      0|					break;
  780|  1.58k|				comment_length
  781|  1.58k|				    = archive_le16dec(p + offset);
  782|  1.58k|				offset += 2;
  783|  1.58k|				datasize -= 2;
  784|       |
  785|  1.58k|				if (datasize < comment_length)
  ------------------
  |  Branch (785:9): [True: 1.58k, False: 0]
  ------------------
  786|  1.58k|					break;
  787|       |				/* Comment is not supported by libarchive */
  788|      0|				offset += comment_length;
  789|      0|				datasize -= comment_length;
  790|      0|			}
  791|  1.09k|			break;
  792|  2.67k|		}
  793|  1.09k|		case 0x7075:
  ------------------
  |  Branch (793:3): [True: 0, False: 8.82k]
  ------------------
  794|      0|		{
  795|       |			/* Info-ZIP Unicode Path Extra Field. */
  796|      0|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (796:8): [True: 0, False: 0]
  |  Branch (796:24): [True: 0, False: 0]
  ------------------
  797|      0|				break;
  798|      0|			offset += 5;
  799|      0|			datasize -= 5;
  800|       |
  801|       |			/* The path name in this field is always encoded
  802|       |			 * in UTF-8. */
  803|      0|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (803:8): [True: 0, False: 0]
  ------------------
  804|      0|				zip->sconv_utf8 =
  805|      0|					archive_string_conversion_from_charset(
  806|      0|					&a->archive, "UTF-8", 1);
  807|       |				/* If the converter from UTF-8 is not
  808|       |				 * available, then the path name from the main
  809|       |				 * field will more likely be correct. */
  810|      0|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (810:9): [True: 0, False: 0]
  ------------------
  811|      0|					break;
  812|      0|			}
  813|       |
  814|       |			/* Make sure the CRC32 of the filename matches. */
  815|      0|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (815:8): [True: 0, False: 0]
  ------------------
  816|      0|				const char *cp = archive_entry_pathname(entry);
  817|      0|				if (cp) {
  ------------------
  |  Branch (817:9): [True: 0, False: 0]
  ------------------
  818|      0|					unsigned long file_crc =
  819|      0|					    zip->crc32func(0, cp, strlen(cp));
  820|      0|					unsigned long utf_crc =
  821|      0|					    archive_le32dec(p + offset - 4);
  822|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (822:10): [True: 0, False: 0]
  ------------------
  823|       |#ifdef DEBUG
  824|       |						fprintf(stderr,
  825|       |						    "CRC filename mismatch; "
  826|       |						    "CDE is %lx, but UTF8 "
  827|       |						    "is outdated with %lx\n",
  828|       |						    file_crc, utf_crc);
  829|       |#endif
  830|      0|						break;
  831|      0|					}
  832|      0|				}
  833|      0|			}
  834|       |
  835|      0|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|      0|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (835:8): [True: 0, False: 0]
  ------------------
  836|      0|			    p + offset, datasize, zip->sconv_utf8) != 0) {
  837|       |				/* Ignore the error, and fallback to the path
  838|       |				 * name from the main field. */
  839|       |#ifdef DEBUG
  840|       |				fprintf(stderr, "Failed to read the ZIP "
  841|       |				    "0x7075 extra field path.\n");
  842|       |#endif
  843|      0|			}
  844|      0|			break;
  845|      0|		}
  846|      0|		case 0x7855:
  ------------------
  |  Branch (846:3): [True: 0, False: 8.82k]
  ------------------
  847|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
  848|       |#ifdef DEBUG
  849|       |			fprintf(stderr, "uid %d gid %d\n",
  850|       |			    archive_le16dec(p + offset),
  851|       |			    archive_le16dec(p + offset + 2));
  852|       |#endif
  853|      0|			if (datasize >= 2)
  ------------------
  |  Branch (853:8): [True: 0, False: 0]
  ------------------
  854|      0|				zip_entry->uid = archive_le16dec(p + offset);
  855|      0|			if (datasize >= 4)
  ------------------
  |  Branch (855:8): [True: 0, False: 0]
  ------------------
  856|      0|				zip_entry->gid =
  857|      0|				    archive_le16dec(p + offset + 2);
  858|      0|			break;
  859|      0|		case 0x7875:
  ------------------
  |  Branch (859:3): [True: 0, False: 8.82k]
  ------------------
  860|      0|		{
  861|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
  862|      0|			int uidsize = 0, gidsize = 0;
  863|       |
  864|       |			/* TODO: support arbitrary uidsize/gidsize. */
  865|      0|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (865:8): [True: 0, False: 0]
  |  Branch (865:25): [True: 0, False: 0]
  ------------------
  866|      0|				if (datasize >= 4) {
  ------------------
  |  Branch (866:9): [True: 0, False: 0]
  ------------------
  867|       |					/* get a uid size. */
  868|      0|					uidsize = 0xff & (int)p[offset+1];
  869|      0|					if (uidsize == 2)
  ------------------
  |  Branch (869:10): [True: 0, False: 0]
  ------------------
  870|      0|						zip_entry->uid =
  871|      0|						    archive_le16dec(
  872|      0|						        p + offset + 2);
  873|      0|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (873:15): [True: 0, False: 0]
  |  Branch (873:31): [True: 0, False: 0]
  ------------------
  874|      0|						zip_entry->uid =
  875|      0|						    archive_le32dec(
  876|      0|						        p + offset + 2);
  877|      0|				}
  878|      0|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (878:9): [True: 0, False: 0]
  ------------------
  879|       |					/* get a gid size. */
  880|      0|					gidsize = 0xff &
  881|      0|					    (int)p[offset+2+uidsize];
  882|      0|					if (gidsize == 2)
  ------------------
  |  Branch (882:10): [True: 0, False: 0]
  ------------------
  883|      0|						zip_entry->gid =
  884|      0|						    archive_le16dec(
  885|      0|						        p+offset+2+uidsize+1);
  886|      0|					else if (gidsize == 4 &&
  ------------------
  |  Branch (886:15): [True: 0, False: 0]
  ------------------
  887|      0|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (887:10): [True: 0, False: 0]
  ------------------
  888|      0|						zip_entry->gid =
  889|      0|						    archive_le32dec(
  890|      0|						        p+offset+2+uidsize+1);
  891|      0|				}
  892|      0|			}
  893|      0|			break;
  894|      0|		}
  895|    843|		case 0x9901:
  ------------------
  |  Branch (895:3): [True: 843, False: 7.97k]
  ------------------
  896|       |			/* WinZip AES extra data field. */
  897|    843|			if (datasize < 6) {
  ------------------
  |  Branch (897:8): [True: 0, False: 843]
  ------------------
  898|      0|				archive_set_error(&a->archive,
  899|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  900|      0|				    "Incomplete AES field");
  901|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  902|      0|			}
  903|    843|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (903:8): [True: 843, False: 0]
  |  Branch (903:32): [True: 843, False: 0]
  ------------------
  904|       |				/* Vendor version. */
  905|    843|				zip_entry->aes_extra.vendor =
  906|    843|				    archive_le16dec(p + offset);
  907|       |				/* AES encryption strength. */
  908|    843|				zip_entry->aes_extra.strength = p[offset + 4];
  909|       |				/* Actual compression method. */
  910|    843|				zip_entry->aes_extra.compression =
  911|    843|				    p[offset + 5];
  912|    843|			}
  913|    843|			break;
  914|  3.81k|		default:
  ------------------
  |  Branch (914:3): [True: 3.81k, False: 5.00k]
  ------------------
  915|  3.81k|			break;
  916|  8.82k|		}
  917|  8.82k|		offset += datasize;
  918|  8.82k|	}
  919|  7.46k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  7.46k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  920|  7.47k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 2563|  3.34k|{
 2564|  3.34k|	struct zip *zip;
 2565|  3.34k|	ssize_t bytes_avail, to_consume = 0;
 2566|  3.34k|	const void *compressed_buff, *sp;
 2567|  3.34k|	int r;
 2568|       |
 2569|  3.34k|	(void)offset; /* UNUSED */
 2570|       |
 2571|  3.34k|	zip = (struct zip *)(a->format->data);
 2572|       |
 2573|       |	/* If the buffer hasn't been allocated, allocate it now. */
 2574|  3.34k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2574:6): [True: 10, False: 3.33k]
  ------------------
 2575|     10|		zip->uncompressed_buffer_size = 256 * 1024;
 2576|     10|		zip->uncompressed_buffer
 2577|     10|		    = (unsigned char *)malloc(zip->uncompressed_buffer_size);
 2578|     10|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2578:7): [True: 0, False: 10]
  ------------------
 2579|      0|			archive_set_error(&a->archive, ENOMEM,
 2580|      0|			    "No memory for ZIP decompression");
 2581|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2582|      0|		}
 2583|     10|	}
 2584|       |
 2585|  3.34k|	r = zip_deflate_init(a, zip);
 2586|  3.34k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  3.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2586:6): [True: 0, False: 3.34k]
  ------------------
 2587|      0|		return (r);
 2588|       |
 2589|       |	/*
 2590|       |	 * Note: '1' here is a performance optimization.
 2591|       |	 * Recall that the decompression layer returns a count of
 2592|       |	 * available bytes; asking for more than that forces the
 2593|       |	 * decompressor to combine reads by copying data.
 2594|       |	 */
 2595|  3.34k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2596|  3.34k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  3.34k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2596:6): [True: 836, False: 2.50k]
  ------------------
 2597|  3.34k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2597:9): [True: 31, False: 805]
  ------------------
 2598|     31|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2599|     31|	}
 2600|  3.34k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2600:6): [True: 0, False: 3.34k]
  ------------------
 2601|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2602|      0|		    "Truncated ZIP file body");
 2603|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2604|      0|	}
 2605|       |
 2606|  3.34k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2606:6): [True: 628, False: 2.71k]
  |  Branch (2606:25): [True: 232, False: 2.48k]
  ------------------
 2607|    860|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (2607:7): [True: 860, False: 0]
  ------------------
 2608|    860|			size_t buff_remaining =
 2609|    860|			    (zip->decrypted_buffer +
 2610|    860|			    zip->decrypted_buffer_size)
 2611|    860|			    - (zip->decrypted_ptr +
 2612|    860|			    zip->decrypted_bytes_remaining);
 2613|       |
 2614|    860|			if (buff_remaining > (size_t)bytes_avail)
  ------------------
  |  Branch (2614:8): [True: 637, False: 223]
  ------------------
 2615|    637|				buff_remaining = (size_t)bytes_avail;
 2616|       |
 2617|    860|			if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END) &&
  ------------------
  |  |  121|    860|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2617:8): [True: 801, False: 59]
  ------------------
 2618|    860|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2618:10): [True: 801, False: 0]
  ------------------
 2619|    801|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (2619:9): [True: 0, False: 801]
  ------------------
 2620|    801|				    + buff_remaining)
 2621|    801|				      > zip->entry_bytes_remaining) {
 2622|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (2622:10): [True: 0, False: 0]
  ------------------
 2623|      0|					    (int64_t)zip->decrypted_bytes_remaining)
 2624|      0|						buff_remaining = 0;
 2625|      0|					else
 2626|      0|						buff_remaining =
 2627|      0|						    (size_t)zip->entry_bytes_remaining
 2628|      0|						    - zip->decrypted_bytes_remaining;
 2629|      0|				}
 2630|    801|			}
 2631|    860|			if (buff_remaining > 0) {
  ------------------
  |  Branch (2631:8): [True: 860, False: 0]
  ------------------
 2632|    860|				if (zip->tctx_valid) {
  ------------------
  |  Branch (2632:9): [True: 628, False: 232]
  ------------------
 2633|    628|					trad_enc_decrypt_update(&zip->tctx,
 2634|    628|					    compressed_buff, buff_remaining,
 2635|    628|					    zip->decrypted_ptr
 2636|    628|					      + zip->decrypted_bytes_remaining,
 2637|    628|					    buff_remaining);
 2638|    628|				} else {
 2639|    232|					size_t dsize = buff_remaining;
 2640|    232|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  156|    232|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 2641|    232|					    &zip->cctx,
 2642|    232|					    compressed_buff, buff_remaining,
 2643|    232|					    zip->decrypted_ptr
 2644|    232|					      + zip->decrypted_bytes_remaining,
 2645|    232|					    &dsize);
 2646|    232|				}
 2647|    860|				zip->decrypted_bytes_remaining +=
 2648|    860|				    buff_remaining;
 2649|    860|			}
 2650|    860|		}
 2651|    860|		bytes_avail = zip->decrypted_bytes_remaining;
 2652|    860|		compressed_buff = (const char *)zip->decrypted_ptr;
 2653|    860|	}
 2654|       |
 2655|       |	/*
 2656|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 2657|       |	 * but isn't (the library never alters data through the
 2658|       |	 * next_in pointer, only reads it).  The result: this ugly
 2659|       |	 * cast to remove 'const'.
 2660|       |	 */
 2661|  3.34k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 2662|  3.34k|	zip->stream.avail_in = (uInt)bytes_avail;
 2663|  3.34k|	zip->stream.total_in = 0;
 2664|  3.34k|	zip->stream.next_out = zip->uncompressed_buffer;
 2665|  3.34k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 2666|  3.34k|	zip->stream.total_out = 0;
 2667|       |
 2668|  3.34k|	r = inflate(&zip->stream, 0);
 2669|  3.34k|	switch (r) {
 2670|     13|	case Z_OK:
  ------------------
  |  Branch (2670:2): [True: 13, False: 3.32k]
  ------------------
 2671|     13|		break;
 2672|  3.32k|	case Z_STREAM_END:
  ------------------
  |  Branch (2672:2): [True: 3.32k, False: 16]
  ------------------
 2673|  3.32k|		zip->end_of_entry = 1;
 2674|  3.32k|		break;
 2675|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (2675:2): [True: 0, False: 3.34k]
  ------------------
 2676|      0|		archive_set_error(&a->archive, ENOMEM,
 2677|      0|		    "Out of memory for ZIP decompression");
 2678|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2679|      3|	default:
  ------------------
  |  Branch (2679:2): [True: 3, False: 3.33k]
  ------------------
 2680|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2681|      3|		    "ZIP decompression failed (%d)", r);
 2682|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2683|  3.34k|	}
 2684|       |
 2685|       |	/* Consume as much as the compressor actually used. */
 2686|  3.33k|	to_consume = zip->stream.total_in;
 2687|  3.33k|	__archive_read_consume(a, to_consume);
 2688|  3.33k|	zip->entry_bytes_remaining -= to_consume;
 2689|  3.33k|	zip->entry_compressed_bytes_read += to_consume;
 2690|  3.33k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 2691|       |
 2692|  3.33k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2692:6): [True: 628, False: 2.70k]
  |  Branch (2692:25): [True: 232, False: 2.47k]
  ------------------
 2693|    860|		zip->decrypted_bytes_remaining -= to_consume;
 2694|    860|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (2694:7): [True: 0, False: 860]
  ------------------
 2695|      0|			zip->decrypted_ptr = zip->decrypted_buffer;
 2696|    860|		else
 2697|    860|			zip->decrypted_ptr += to_consume;
 2698|    860|	}
 2699|  3.33k|	if (zip->hctx_valid)
  ------------------
  |  Branch (2699:6): [True: 232, False: 3.10k]
  ------------------
 2700|    232|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |  101|    232|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2701|       |
 2702|  3.33k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (2702:6): [True: 3.32k, False: 13]
  ------------------
 2703|  3.32k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2703:7): [True: 232, False: 3.09k]
  ------------------
 2704|    232|			r = check_authentication_code(a, NULL);
 2705|    232|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  192|    232|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2705:8): [True: 111, False: 121]
  ------------------
 2706|    111|				return (r);
 2707|    111|			}
 2708|    232|		}
 2709|  3.32k|	}
 2710|       |
 2711|  3.22k|	*size = zip->stream.total_out;
 2712|  3.22k|	*buff = zip->uncompressed_buffer;
 2713|       |
 2714|  3.22k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2715|  3.33k|}
archive_read_support_format_zip.c:zip_deflate_init:
 2537|  3.34k|{
 2538|  3.34k|	int r;
 2539|       |
 2540|       |	/* If we haven't yet read any data, initialize the decompressor. */
 2541|  3.34k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2541:6): [True: 3.32k, False: 13]
  ------------------
 2542|  3.32k|		if (zip->stream_valid)
  ------------------
  |  Branch (2542:7): [True: 3.30k, False: 19]
  ------------------
 2543|  3.30k|			r = inflateReset(&zip->stream);
 2544|     19|		else
 2545|     19|			r = inflateInit2(&zip->stream,
 2546|  3.32k|			    -15 /* Don't check for zlib header */);
 2547|  3.32k|		if (r != Z_OK) {
  ------------------
  |  Branch (2547:7): [True: 0, False: 3.32k]
  ------------------
 2548|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2549|      0|			    "Can't initialize ZIP decompression.");
 2550|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2551|      0|		}
 2552|       |		/* Stream structure has been set up. */
 2553|  3.32k|		zip->stream_valid = 1;
 2554|       |		/* We've initialized decompression for this stream. */
 2555|  3.32k|		zip->decompress_init = 1;
 2556|  3.32k|	}
 2557|  3.34k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2558|  3.34k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  324|  3.97k|{
  325|  3.97k|	unsigned i, max;
  326|       |
  327|  3.97k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (327:19): [True: 0, False: 3.97k]
  ------------------
  328|       |
  329|   120M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (329:14): [True: 120M, False: 3.97k]
  ------------------
  330|   120M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  331|   120M|		out[i] = t;
  332|   120M|		trad_enc_update_keys(ctx, t);
  333|   120M|	}
  334|  3.97k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  316|   120M|{
  317|   120M|	unsigned temp = ctx->keys[2] | 2;
  318|   120M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  319|   120M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  303|   120M|{
  304|   120M|	uint8_t t;
  305|   120M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  306|       |
  307|   120M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  305|   120M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  308|   120M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  309|   120M|	t = (ctx->keys[1] >> 24) & 0xff;
  310|   120M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  305|   120M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  311|   120M|#undef CRC32
  312|   120M|}
archive_read_support_format_zip.c:check_authentication_code:
 1311|    840|{
 1312|    840|	struct zip *zip = (struct zip *)(a->format->data);
 1313|       |
 1314|       |	/* Check authentication code. */
 1315|    840|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1315:6): [True: 840, False: 0]
  ------------------
 1316|    840|		const void *p;
 1317|    840|		uint8_t hmac[20];
 1318|    840|		size_t hmac_len = 20;
 1319|    840|		int cmp;
 1320|       |
 1321|    840|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |  103|    840|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1322|    840|		if (_p == NULL) {
  ------------------
  |  Branch (1322:7): [True: 840, False: 0]
  ------------------
 1323|       |			/* Read authentication code. */
 1324|    840|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  139|    840|#define AUTH_CODE_SIZE	10
  ------------------
 1325|    840|			if (p == NULL) {
  ------------------
  |  Branch (1325:8): [True: 0, False: 840]
  ------------------
 1326|      0|				archive_set_error(&a->archive,
 1327|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1328|      0|				    "Truncated ZIP file data");
 1329|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1330|      0|			}
 1331|    840|		} else {
 1332|      0|			p = _p;
 1333|      0|		}
 1334|    840|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  139|    840|#define AUTH_CODE_SIZE	10
  ------------------
 1335|    840|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  139|    840|#define AUTH_CODE_SIZE	10
  ------------------
 1336|    840|		if (cmp != 0) {
  ------------------
  |  Branch (1336:7): [True: 407, False: 433]
  ------------------
 1337|    407|			archive_set_error(&a->archive,
 1338|    407|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|    407|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1339|    407|			    "ZIP bad Authentication code");
 1340|    407|			return (ARCHIVE_WARN);
  ------------------
  |  |  194|    407|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1341|    407|		}
 1342|    840|	}
 1343|    433|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    433|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1344|    840|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 1985|    253|{
 1986|    253|	struct zip* zip = (struct zip *)(a->format->data);
 1987|    253|	int ret;
 1988|    253|	lzma_ret lz_ret;
 1989|    253|	const void* compressed_buf;
 1990|    253|	ssize_t bytes_avail, in_bytes, to_consume;
 1991|       |
 1992|    253|	(void) offset; /* UNUSED */
 1993|       |
 1994|       |	/* Initialize decompressor if not yet initialized. */
 1995|    253|	if (!zip->decompress_init) {
  ------------------
  |  Branch (1995:6): [True: 218, False: 35]
  ------------------
 1996|    218|		ret = zipx_lzma_alone_init(a, zip);
 1997|    218|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  192|    218|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1997:7): [True: 0, False: 218]
  ------------------
 1998|      0|			return (ret);
 1999|    218|	}
 2000|       |
 2001|       |	/* Fetch more compressed data. The same note as in deflate handler
 2002|       |	 * applies here as well:
 2003|       |	 *
 2004|       |	 * Note: '1' here is a performance optimization. Recall that the
 2005|       |	 * decompression layer returns a count of available bytes; asking for
 2006|       |	 * more than that forces the decompressor to combine reads by copying
 2007|       |	 * data.
 2008|       |	 */
 2009|    253|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 2010|    253|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2010:6): [True: 0, False: 253]
  ------------------
 2011|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2012|      0|		    "Truncated lzma file body");
 2013|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2014|      0|	}
 2015|       |
 2016|       |	/* Set decompressor parameters. */
 2017|    253|	in_bytes = (ssize_t)zipmin(zip->entry_bytes_remaining, bytes_avail);
  ------------------
  |  |  255|    253|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (255:22): [True: 217, False: 36]
  |  |  ------------------
  ------------------
 2018|       |
 2019|    253|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2020|    253|	zip->zipx_lzma_stream.avail_in = in_bytes;
 2021|    253|	zip->zipx_lzma_stream.total_in = 0;
 2022|    253|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2023|    253|	zip->zipx_lzma_stream.avail_out =
 2024|       |		/* These lzma_alone streams lack end of stream marker, so let's
 2025|       |		 * make sure the unpacker won't try to unpack more than it's
 2026|       |		 * supposed to. */
 2027|    253|		(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  255|    253|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (255:22): [True: 253, False: 0]
  |  |  ------------------
  ------------------
 2028|    253|		    zip->entry->uncompressed_size -
 2029|    253|		    zip->entry_uncompressed_bytes_read);
 2030|    253|	zip->zipx_lzma_stream.total_out = 0;
 2031|       |
 2032|       |	/* Perform the decompression. */
 2033|    253|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2034|    253|	switch(lz_ret) {
 2035|      0|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2035:3): [True: 0, False: 253]
  ------------------
 2036|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2037|      0|			    "lzma data error (error %d)", (int) lz_ret);
 2038|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2039|       |
 2040|       |		/* This case is optional in lzma alone format. It can happen,
 2041|       |		 * but most of the files don't have it. (GitHub #1257) */
 2042|      0|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2042:3): [True: 0, False: 253]
  ------------------
 2043|      0|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2043:7): [True: 0, False: 0]
  ------------------
 2044|      0|			    zip->entry_bytes_remaining)
 2045|      0|			{
 2046|      0|				archive_set_error(&a->archive,
 2047|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2048|      0|				    "lzma alone premature end of stream");
 2049|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2050|      0|			}
 2051|       |
 2052|      0|			zip->end_of_entry = 1;
 2053|      0|			break;
 2054|       |
 2055|    252|		case LZMA_OK:
  ------------------
  |  Branch (2055:3): [True: 252, False: 1]
  ------------------
 2056|    252|			break;
 2057|       |
 2058|      1|		default:
  ------------------
  |  Branch (2058:3): [True: 1, False: 252]
  ------------------
 2059|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2060|      1|			    "lzma unknown error %d", (int) lz_ret);
 2061|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2062|    253|	}
 2063|       |
 2064|    252|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2065|       |
 2066|       |	/* Update pointers. */
 2067|    252|	__archive_read_consume(a, to_consume);
 2068|    252|	zip->entry_bytes_remaining -= to_consume;
 2069|    252|	zip->entry_compressed_bytes_read += to_consume;
 2070|    252|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2071|       |
 2072|    252|	if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2072:5): [True: 217, False: 35]
  ------------------
 2073|    217|		zip->end_of_entry = 1;
 2074|    217|	}
 2075|       |
 2076|       |	/* Free lzma decoder handle because we'll no longer need it. */
 2077|       |	/* This cannot be folded into LZMA_STREAM_END handling above
 2078|       |	 * because the stream end marker is not required in this format. */
 2079|    252|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2079:5): [True: 217, False: 35]
  ------------------
 2080|    217|		lzma_end(&zip->zipx_lzma_stream);
 2081|    217|		zip->zipx_lzma_valid = 0;
 2082|    217|	}
 2083|       |
 2084|       |	/* Return values. */
 2085|    252|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2086|    252|	*buff = zip->uncompressed_buffer;
 2087|       |
 2088|       |	/* If we're here, then we're good! */
 2089|    252|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    252|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2090|    253|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 1768|    218|{
 1769|    218|	lzma_ret r;
 1770|    218|	const uint8_t* p;
 1771|       |
 1772|    218|#pragma pack(push)
 1773|    218|#pragma pack(1)
 1774|    218|	struct _alone_header {
 1775|    218|	    uint8_t bytes[5];
 1776|    218|	    uint64_t uncompressed_size;
 1777|    218|	} alone_header;
 1778|    218|#pragma pack(pop)
 1779|       |
 1780|    218|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1780:5): [True: 0, False: 218]
  ------------------
 1781|      0|		lzma_end(&zip->zipx_lzma_stream);
 1782|      0|		zip->zipx_lzma_valid = 0;
 1783|      0|	}
 1784|       |
 1785|       |	/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma
 1786|       |	 * that is a part of XZ Utils. The stream format stored inside ZIPX
 1787|       |	 * file is a modified "lzma alone" file format, that was used by the
 1788|       |	 * `lzma` utility which was later deprecated in favour of `xz` utility.
 1789|       | 	 * Since those formats are nearly the same, we can use a standard
 1790|       |	 * "lzma alone" decoder from XZ Utils. */
 1791|       |
 1792|    218|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1793|    218|	r = lzma_alone_decoder(&zip->zipx_lzma_stream, UINT64_MAX);
 1794|    218|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1794:6): [True: 0, False: 218]
  ------------------
 1795|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1796|      0|		    "lzma initialization failed(%d)", r);
 1797|       |
 1798|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1799|      0|	}
 1800|       |
 1801|       |	/* Flag the cleanup function that we want our lzma-related structures
 1802|       |	 * to be freed later. */
 1803|    218|	zip->zipx_lzma_valid = 1;
 1804|       |
 1805|       |	/* The "lzma alone" file format and the stream format inside ZIPx are
 1806|       |	 * almost the same. Here's an example of a structure of "lzma alone"
 1807|       |	 * format:
 1808|       |	 *
 1809|       |	 * $ cat /bin/ls | lzma | xxd | head -n 1
 1810|       |	 * 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
 1811|       |	 *
 1812|       |	 *    5 bytes        8 bytes        n bytes
 1813|       |	 * <lzma_params><uncompressed_size><data...>
 1814|       |	 *
 1815|       |	 * lzma_params is a 5-byte blob that has to be decoded to extract
 1816|       |	 * parameters of this LZMA stream. The uncompressed_size field is an
 1817|       |	 * uint64_t value that contains information about the size of the
 1818|       |	 * uncompressed file, or UINT64_MAX if this value is unknown.
 1819|       |	 * The <data...> part is the actual lzma-compressed data stream.
 1820|       |	 *
 1821|       |	 * Now here's the structure of the stream inside the ZIPX file:
 1822|       |	 *
 1823|       |	 * $ cat stream_inside_zipx | xxd | head -n 1
 1824|       |	 * 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
 1825|       |	 *
 1826|       |	 *  2byte   2byte    5 bytes     n bytes
 1827|       |	 * <magic1><magic2><lzma_params><data...>
 1828|       |	 *
 1829|       |	 * This means that the ZIPX file contains an additional magic1 and
 1830|       |	 * magic2 headers, the lzma_params field contains the same parameter
 1831|       |	 * set as in the "lzma alone" format, and the <data...> field is the
 1832|       |	 * same as in the "lzma alone" format as well. Note that also the zipx
 1833|       |	 * format is missing the uncompressed_size field.
 1834|       |	 *
 1835|       |	 * So, in order to use the "lzma alone" decoder for the zipx lzma
 1836|       |	 * stream, we simply need to shuffle around some fields, prepare a new
 1837|       |	 * lzma alone header, feed it into lzma alone decoder so it will
 1838|       |	 * initialize itself properly, and then we can start feeding normal
 1839|       |	 * zipx lzma stream into the decoder.
 1840|       |	 */
 1841|       |
 1842|       |	/* Read magic1,magic2,lzma_params from the ZIPX stream. */
 1843|    218|	if(zip->entry_bytes_remaining < 9 || (p = __archive_read_ahead(a, 9, NULL)) == NULL) {
  ------------------
  |  Branch (1843:5): [True: 0, False: 218]
  |  Branch (1843:39): [True: 0, False: 218]
  ------------------
 1844|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1845|      0|		    "Truncated lzma data");
 1846|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1847|      0|	}
 1848|       |
 1849|    218|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (1849:5): [True: 0, False: 218]
  |  Branch (1849:21): [True: 0, False: 218]
  ------------------
 1850|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1851|      0|		    "Invalid lzma data");
 1852|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1853|      0|	}
 1854|       |
 1855|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 1856|       |	 * a proper place into the lzma alone header. */
 1857|    218|	memcpy(&alone_header.bytes[0], p + 4, 5);
 1858|       |
 1859|       |	/* Initialize the 'uncompressed size' field to unknown; we'll manually
 1860|       |	 * monitor how many bytes there are still to be uncompressed. */
 1861|    218|	alone_header.uncompressed_size = UINT64_MAX;
 1862|       |
 1863|    218|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (1863:5): [True: 1, False: 217]
  ------------------
 1864|      1|		zip->uncompressed_buffer_size = 256 * 1024;
 1865|      1|		zip->uncompressed_buffer =
 1866|      1|			(uint8_t*) malloc(zip->uncompressed_buffer_size);
 1867|       |
 1868|      1|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1868:7): [True: 0, False: 1]
  ------------------
 1869|      0|			archive_set_error(&a->archive, ENOMEM,
 1870|      0|			    "No memory for lzma decompression");
 1871|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1872|      0|		}
 1873|      1|	}
 1874|       |
 1875|    218|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 1876|    218|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 1877|    218|	zip->zipx_lzma_stream.total_in = 0;
 1878|    218|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 1879|    218|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 1880|    218|	zip->zipx_lzma_stream.total_out = 0;
 1881|       |
 1882|       |	/* Feed only the header into the lzma alone decoder. This will
 1883|       |	 * effectively initialize the decoder, and will not produce any
 1884|       |	 * output bytes yet. */
 1885|    218|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 1886|    218|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 218]
  ------------------
 1887|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1888|      0|		    "lzma stream initialization error");
 1889|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1890|      0|	}
 1891|       |
 1892|       |	/* We've already consumed some bytes, so take this into account. */
 1893|    218|	__archive_read_consume(a, 9);
 1894|    218|	zip->entry_bytes_remaining -= 9;
 1895|    218|	zip->entry_compressed_bytes_read += 9;
 1896|       |
 1897|    218|	zip->decompress_init = 1;
 1898|    218|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    218|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1899|    218|}
archive_read_support_format_zip.c:compression_name:
  455|  29.1k|{
  456|  29.1k|	static const int num_compression_methods =
  457|  29.1k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  458|  29.1k|	int i=0;
  459|       |
  460|   594k|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (460:8): [True: 594k, False: 0]
  |  Branch (460:28): [True: 589k, False: 4.63k]
  ------------------
  461|   589k|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (461:7): [True: 24.4k, False: 564k]
  ------------------
  462|  24.4k|			return compression_methods[i].name;
  463|   564k|		i++;
  464|   564k|	}
  465|  4.63k|	return "??";
  466|  29.1k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3099|  32.6k|{
 3100|  32.6k|	int r;
 3101|  32.6k|	struct zip *zip = (struct zip *)(a->format->data);
 3102|       |
 3103|  32.6k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3103:6): [True: 0, False: 32.6k]
  ------------------
 3104|  32.6k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  370|  32.6k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3105|      0|		zip->has_encrypted_entries = 0;
 3106|      0|	}
 3107|       |
 3108|  32.6k|	*offset = zip->entry_uncompressed_bytes_read;
 3109|  32.6k|	*size = 0;
 3110|  32.6k|	*buff = NULL;
 3111|       |
 3112|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3113|  32.6k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3113:6): [True: 1.86k, False: 30.7k]
  ------------------
 3114|  1.86k|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|  1.86k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3115|       |
 3116|       |	/* Return EOF immediately if this is a non-regular file. */
 3117|  30.7k|	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  185|  30.7k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
              	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  184|  30.7k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (3117:6): [True: 239, False: 30.5k]
  ------------------
 3118|    239|		return (ARCHIVE_EOF);
  ------------------
  |  |  191|    239|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3119|       |
 3120|  30.5k|	__archive_read_consume(a, zip->unconsumed);
 3121|  30.5k|	zip->unconsumed = 0;
 3122|       |
 3123|  30.5k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3123:6): [True: 4.03k, False: 26.4k]
  ------------------
 3124|  4.03k|		zip->has_encrypted_entries = 1;
 3125|  4.03k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  122|  4.03k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3125:7): [True: 95, False: 3.94k]
  ------------------
 3126|     95|			r = read_decryption_header(a);
 3127|  3.94k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  137|  3.94k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3127:12): [True: 842, False: 3.09k]
  ------------------
 3128|    842|			r = init_WinZip_AES_decryption(a);
 3129|  3.09k|		else
 3130|  3.09k|			r = init_traditional_PKWARE_decryption(a);
 3131|  4.03k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  4.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3131:7): [True: 2.56k, False: 1.47k]
  ------------------
 3132|  2.56k|			return (r);
 3133|  1.47k|		zip->init_decryption = 0;
 3134|  1.47k|	}
 3135|       |
 3136|  27.9k|	switch(zip->entry->compression) {
 3137|  6.85k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3137:2): [True: 6.85k, False: 21.1k]
  ------------------
 3138|  6.85k|		r =  zip_read_data_none(a, buff, size, offset);
 3139|  6.85k|		break;
 3140|      0|#ifdef HAVE_BZLIB_H
 3141|      0|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3141:2): [True: 0, False: 27.9k]
  ------------------
 3142|      0|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3143|      0|		break;
 3144|      0|#endif
 3145|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3146|    253|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3146:2): [True: 253, False: 27.7k]
  ------------------
 3147|    253|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3148|    253|		break;
 3149|      0|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3149:2): [True: 0, False: 27.9k]
  ------------------
 3150|      0|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3151|      0|		break;
 3152|      0|#endif
 3153|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3154|       |	case 93: /* ZIPx Zstd compression. */
 3155|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3156|       |		break;
 3157|       |#endif
 3158|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3159|  16.0k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3159:2): [True: 16.0k, False: 11.9k]
  ------------------
 3160|  16.0k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3161|  16.0k|		break;
 3162|       |
 3163|      0|#ifdef HAVE_ZLIB_H
 3164|  3.34k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3164:2): [True: 3.34k, False: 24.6k]
  ------------------
 3165|  3.34k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3166|  3.34k|		break;
 3167|      0|#endif
 3168|  1.51k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3168:2): [True: 1.51k, False: 26.4k]
  ------------------
 3169|       |		/* Return a warning. */
 3170|  1.51k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|  1.51k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3171|  1.51k|		    "Unsupported ZIP compression method (%d: %s)",
 3172|  1.51k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3173|       |		/* We can't decompress this entry, but we will
 3174|       |		 * be able to skip() it and try the next entry. */
 3175|  1.51k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|  1.51k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3176|      0|		break;
 3177|  27.9k|	}
 3178|  26.4k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  26.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3178:6): [True: 5.37k, False: 21.0k]
  ------------------
 3179|  5.37k|		return (r);
 3180|  21.0k|	if (*size > 0) {
  ------------------
  |  Branch (3180:6): [True: 15.1k, False: 5.91k]
  ------------------
 3181|  15.1k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3182|  15.1k|						     (unsigned)*size);
 3183|  15.1k|	}
 3184|       |	/* If we hit the end, swallow any end-of-data marker and
 3185|       |	 * verify the final check values. */
 3186|  21.0k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3186:6): [True: 17.6k, False: 3.47k]
  ------------------
 3187|  17.6k|		consume_end_of_file_marker(a, zip);
 3188|       |
 3189|       |		/* Check computed CRC against header */
 3190|  17.6k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3190:8): [True: 17.1k, False: 433]
  ------------------
 3191|  17.6k|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  106|    433|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3191:9): [True: 55, False: 378]
  ------------------
 3192|  17.6k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3192:6): [True: 14.9k, False: 2.32k]
  ------------------
 3193|  17.6k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3193:10): [True: 0, False: 14.9k]
  ------------------
 3194|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3195|      0|			    "ZIP bad CRC: 0x%lx should be 0x%lx",
 3196|      0|			    (unsigned long)zip->computed_crc32,
 3197|      0|			    (unsigned long)zip->entry->crc32);
 3198|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3199|      0|		}
 3200|       |		/* Check file size against header. */
 3201|  17.6k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3201:7): [True: 12.8k, False: 4.74k]
  ------------------
 3202|  17.6k|		    zip->entry_compressed_bytes_read) {
 3203|  12.8k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|  12.8k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3204|  12.8k|			    "ZIP compressed data is wrong size "
 3205|  12.8k|			    "(read %jd, expected %jd)",
 3206|  12.8k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3207|  12.8k|			    (intmax_t)zip->entry->compressed_size);
 3208|  12.8k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|  12.8k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3209|  12.8k|		}
 3210|       |		/* Size field only stores the lower 32 bits of the actual
 3211|       |		 * size. */
 3212|  4.74k|		if ((zip->entry->uncompressed_size & UINT32_MAX)
  ------------------
  |  Branch (3212:7): [True: 3.19k, False: 1.55k]
  ------------------
 3213|  4.74k|		    != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
 3214|  3.19k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|  3.19k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3215|  3.19k|			    "ZIP uncompressed data is wrong size "
 3216|  3.19k|			    "(read %jd, expected %jd)\n",
 3217|  3.19k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3218|  3.19k|			    (intmax_t)zip->entry->uncompressed_size);
 3219|  3.19k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|  3.19k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3220|  3.19k|		}
 3221|  4.74k|	}
 3222|       |
 3223|  5.02k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  5.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3224|  21.0k|}
archive_read_support_format_zip.c:read_decryption_header:
 2720|    125|{
 2721|    125|	struct zip *zip = (struct zip *)(a->format->data);
 2722|    125|	const char *p;
 2723|    125|	unsigned int remaining_size;
 2724|    125|	unsigned int ts;
 2725|       |
 2726|       |	/*
 2727|       |	 * Read an initialization vector data field.
 2728|       |	 */
 2729|    125|	p = __archive_read_ahead(a, 2, NULL);
 2730|    125|	if (p == NULL)
  ------------------
  |  Branch (2730:6): [True: 0, False: 125]
  ------------------
 2731|      0|		goto truncated;
 2732|    125|	ts = zip->iv_size;
 2733|    125|	zip->iv_size = archive_le16dec(p);
 2734|    125|	__archive_read_consume(a, 2);
 2735|    125|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (2735:6): [True: 34, False: 91]
  ------------------
 2736|     34|		free(zip->iv);
 2737|     34|		zip->iv = NULL;
 2738|     34|	}
 2739|    125|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 2740|    125|	if (p == NULL)
  ------------------
  |  Branch (2740:6): [True: 0, False: 125]
  ------------------
 2741|      0|		goto truncated;
 2742|    125|	if (zip->iv == NULL) {
  ------------------
  |  Branch (2742:6): [True: 36, False: 89]
  ------------------
 2743|     36|		zip->iv = malloc(zip->iv_size);
 2744|     36|		if (zip->iv == NULL)
  ------------------
  |  Branch (2744:7): [True: 0, False: 36]
  ------------------
 2745|      0|			goto nomem;
 2746|     36|	}
 2747|    125|	memcpy(zip->iv, p, zip->iv_size);
 2748|    125|	__archive_read_consume(a, zip->iv_size);
 2749|       |
 2750|       |	/*
 2751|       |	 * Read a size of remaining decryption header field.
 2752|       |	 */
 2753|    125|	p = __archive_read_ahead(a, 14, NULL);
 2754|    125|	if (p == NULL)
  ------------------
  |  Branch (2754:6): [True: 0, False: 125]
  ------------------
 2755|      0|		goto truncated;
 2756|    125|	remaining_size = archive_le32dec(p);
 2757|    125|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (2757:6): [True: 0, False: 125]
  |  Branch (2757:29): [True: 2, False: 123]
  ------------------
 2758|      2|		goto corrupted;
 2759|       |
 2760|       |	/* Check if format version is supported. */
 2761|    123|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (2761:6): [True: 69, False: 54]
  ------------------
 2762|     69|		archive_set_error(&a->archive,
 2763|     69|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|     69|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2764|     69|		    "Unsupported encryption format version: %u",
 2765|     69|		    archive_le16dec(p+4));
 2766|     69|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|     69|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2767|     69|	}
 2768|       |
 2769|       |	/*
 2770|       |	 * Read an encryption algorithm field.
 2771|       |	 */
 2772|     54|	zip->alg_id = archive_le16dec(p+6);
 2773|     54|	switch (zip->alg_id) {
 2774|      0|	case 0x6601:/* DES */
  ------------------
  |  Branch (2774:2): [True: 0, False: 54]
  ------------------
 2775|      0|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (2775:2): [True: 0, False: 54]
  ------------------
 2776|      3|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (2776:2): [True: 3, False: 51]
  ------------------
 2777|      3|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (2777:2): [True: 0, False: 54]
  ------------------
 2778|      3|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (2778:2): [True: 0, False: 54]
  ------------------
 2779|      8|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (2779:2): [True: 5, False: 49]
  ------------------
 2780|      8|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (2780:2): [True: 0, False: 54]
  ------------------
 2781|      8|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (2781:2): [True: 0, False: 54]
  ------------------
 2782|      8|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (2782:2): [True: 0, False: 54]
  ------------------
 2783|      8|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (2783:2): [True: 0, False: 54]
  ------------------
 2784|      8|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (2784:2): [True: 0, False: 54]
  ------------------
 2785|       |		/* Supported encryption algorithm. */
 2786|      8|		break;
 2787|     46|	default:
  ------------------
  |  Branch (2787:2): [True: 46, False: 8]
  ------------------
 2788|     46|		archive_set_error(&a->archive,
 2789|     46|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|     46|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2790|     46|		    "Unknown encryption algorithm: %u", zip->alg_id);
 2791|     46|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|     46|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2792|     54|	}
 2793|       |
 2794|       |	/*
 2795|       |	 * Read a bit length field.
 2796|       |	 */
 2797|      8|	zip->bit_len = archive_le16dec(p+8);
 2798|       |
 2799|       |	/*
 2800|       |	 * Read a flags field.
 2801|       |	 */
 2802|      8|	zip->flags = archive_le16dec(p+10);
 2803|      8|	switch (zip->flags & 0xf000) {
 2804|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (2804:2): [True: 0, False: 8]
  ------------------
 2805|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (2805:2): [True: 0, False: 8]
  ------------------
 2806|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (2806:2): [True: 0, False: 8]
  ------------------
 2807|      0|		break;
 2808|      8|	default:
  ------------------
  |  Branch (2808:2): [True: 8, False: 0]
  ------------------
 2809|      8|		archive_set_error(&a->archive,
 2810|      8|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2811|      8|		    "Unknown encryption flag: %u", zip->flags);
 2812|      8|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2813|      8|	}
 2814|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (2814:6): [True: 0, False: 0]
  ------------------
 2815|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (2815:6): [True: 0, False: 0]
  ------------------
 2816|      0|		archive_set_error(&a->archive,
 2817|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2818|      0|		    "Unknown encryption flag: %u", zip->flags);
 2819|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2820|      0|	}
 2821|       |
 2822|       |	/*
 2823|       |	 * Read an encrypted random data field.
 2824|       |	 */
 2825|      0|	ts = zip->erd_size;
 2826|      0|	zip->erd_size = archive_le16dec(p+12);
 2827|      0|	__archive_read_consume(a, 14);
 2828|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (2828:6): [True: 0, False: 0]
  ------------------
 2829|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (2829:6): [True: 0, False: 0]
  ------------------
 2830|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (2830:6): [True: 0, False: 0]
  ------------------
 2831|      0|		goto corrupted;
 2832|       |
 2833|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (2833:6): [True: 0, False: 0]
  ------------------
 2834|      0|		free(zip->erd);
 2835|      0|		zip->erd = NULL;
 2836|      0|	}
 2837|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 2838|      0|	if (p == NULL)
  ------------------
  |  Branch (2838:6): [True: 0, False: 0]
  ------------------
 2839|      0|		goto truncated;
 2840|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (2840:6): [True: 0, False: 0]
  ------------------
 2841|      0|		zip->erd = malloc(zip->erd_size);
 2842|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (2842:7): [True: 0, False: 0]
  ------------------
 2843|      0|			goto nomem;
 2844|      0|	}
 2845|      0|	memcpy(zip->erd, p, zip->erd_size);
 2846|      0|	__archive_read_consume(a, zip->erd_size);
 2847|       |
 2848|       |	/*
 2849|       |	 * Read a reserved data field.
 2850|       |	 */
 2851|      0|	p = __archive_read_ahead(a, 4, NULL);
 2852|      0|	if (p == NULL)
  ------------------
  |  Branch (2852:6): [True: 0, False: 0]
  ------------------
 2853|      0|		goto truncated;
 2854|       |	/* Reserved data size should be zero. */
 2855|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (2855:6): [True: 0, False: 0]
  ------------------
 2856|      0|		goto corrupted;
 2857|      0|	__archive_read_consume(a, 4);
 2858|       |
 2859|       |	/*
 2860|       |	 * Read a password validation data field.
 2861|       |	 */
 2862|      0|	p = __archive_read_ahead(a, 2, NULL);
 2863|      0|	if (p == NULL)
  ------------------
  |  Branch (2863:6): [True: 0, False: 0]
  ------------------
 2864|      0|		goto truncated;
 2865|      0|	ts = zip->v_size;
 2866|      0|	zip->v_size = archive_le16dec(p);
 2867|      0|	__archive_read_consume(a, 2);
 2868|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (2868:6): [True: 0, False: 0]
  ------------------
 2869|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (2869:6): [True: 0, False: 0]
  ------------------
 2870|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (2870:6): [True: 0, False: 0]
  ------------------
 2871|      0|		goto corrupted;
 2872|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (2872:6): [True: 0, False: 0]
  ------------------
 2873|      0|		free(zip->v_data);
 2874|      0|		zip->v_data = NULL;
 2875|      0|	}
 2876|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 2877|      0|	if (p == NULL)
  ------------------
  |  Branch (2877:6): [True: 0, False: 0]
  ------------------
 2878|      0|		goto truncated;
 2879|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (2879:6): [True: 0, False: 0]
  ------------------
 2880|      0|		zip->v_data = malloc(zip->v_size);
 2881|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (2881:7): [True: 0, False: 0]
  ------------------
 2882|      0|			goto nomem;
 2883|      0|	}
 2884|      0|	memcpy(zip->v_data, p, zip->v_size);
 2885|      0|	__archive_read_consume(a, zip->v_size);
 2886|       |
 2887|      0|	p = __archive_read_ahead(a, 4, NULL);
 2888|      0|	if (p == NULL)
  ------------------
  |  Branch (2888:6): [True: 0, False: 0]
  ------------------
 2889|      0|		goto truncated;
 2890|      0|	zip->v_crc32 = archive_le32dec(p);
 2891|      0|	__archive_read_consume(a, 4);
 2892|       |
 2893|       |	/*return (ARCHIVE_OK);
 2894|       |	 * This is not fully implemented yet.*/
 2895|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2896|      0|	    "Encrypted file is unsupported");
 2897|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2898|      0|truncated:
 2899|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2900|      0|	    "Truncated ZIP file data");
 2901|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2902|      2|corrupted:
 2903|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2904|      2|	    "Corrupted ZIP file data");
 2905|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2906|      0|nomem:
 2907|      0|	archive_set_error(&a->archive, ENOMEM,
 2908|      0|	    "No memory for ZIP decryption");
 2909|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2910|      0|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 3005|    842|{
 3006|    842|	struct zip *zip = (struct zip *)(a->format->data);
 3007|    842|	const void *p;
 3008|    842|	const uint8_t *pv;
 3009|    842|	size_t key_len, salt_len;
 3010|    842|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 3011|    842|	int retry;
 3012|    842|	int r;
 3013|       |
 3014|    842|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (3014:6): [True: 0, False: 842]
  |  Branch (3014:25): [True: 0, False: 842]
  ------------------
 3015|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3016|       |
 3017|    842|	switch (zip->entry->aes_extra.strength) {
 3018|      0|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3018:2): [True: 0, False: 842]
  ------------------
 3019|    842|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3019:2): [True: 842, False: 0]
  ------------------
 3020|      0|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3020:2): [True: 0, False: 842]
  ------------------
 3021|      0|	default: goto corrupted;
  ------------------
  |  Branch (3021:2): [True: 0, False: 842]
  ------------------
 3022|    842|	}
 3023|    842|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3024|    842|	if (p == NULL)
  ------------------
  |  Branch (3024:6): [True: 0, False: 842]
  ------------------
 3025|      0|		goto truncated;
 3026|       |
 3027|    843|	for (retry = 0;; retry++) {
 3028|    843|		const char *passphrase;
 3029|       |
 3030|    843|		passphrase = __archive_read_next_passphrase(a);
 3031|    843|		if (passphrase == NULL) {
  ------------------
  |  Branch (3031:7): [True: 1, False: 842]
  ------------------
 3032|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3033|      1|			    (retry > 0)?
  ------------------
  |  Branch (3033:8): [True: 1, False: 0]
  ------------------
 3034|      1|				"Incorrect passphrase":
 3035|      1|				"Passphrase required for this entry");
 3036|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3037|      1|		}
 3038|    842|		memset(derived_key, 0, sizeof(derived_key));
 3039|    842|		r = archive_pbkdf2_sha1(passphrase, strlen(passphrase),
  ------------------
  |  |  151|    842|  __archive_cryptor.pbkdf2sha1(pw, pw_len, salt, salt_len, rounds, dk, dk_len)
  ------------------
 3040|    842|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3041|    842|		if (r != 0) {
  ------------------
  |  Branch (3041:7): [True: 0, False: 842]
  ------------------
 3042|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3043|      0|			    "Decryption is unsupported due to lack of "
 3044|      0|			    "crypto library");
 3045|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3046|      0|		}
 3047|       |
 3048|       |		/* Check password verification value. */
 3049|    842|		pv = ((const uint8_t *)p) + salt_len;
 3050|    842|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3050:7): [True: 841, False: 1]
  ------------------
 3051|    842|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3051:7): [True: 841, False: 0]
  ------------------
 3052|    841|			break;/* The passphrase is OK. */
 3053|      1|		if (retry > 10000) {
  ------------------
  |  Branch (3053:7): [True: 0, False: 1]
  ------------------
 3054|       |			/* Avoid infinity loop. */
 3055|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3056|      0|			    "Too many incorrect passphrases");
 3057|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3058|      0|		}
 3059|      1|	}
 3060|       |
 3061|    841|	r = archive_decrypto_aes_ctr_init(&zip->cctx, derived_key, key_len);
  ------------------
  |  |  154|    841|  __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
  ------------------
 3062|    841|	if (r != 0) {
  ------------------
  |  Branch (3062:6): [True: 0, False: 841]
  ------------------
 3063|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3064|      0|		    "Decryption is unsupported due to lack of crypto library");
 3065|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3066|      0|	}
 3067|    841|	r = archive_hmac_sha1_init(&zip->hctx, derived_key + key_len, key_len);
  ------------------
  |  |   99|    841|	__archive_hmac.__hmac_sha1_init(ctx, key, key_len)
  ------------------
 3068|    841|	if (r != 0) {
  ------------------
  |  Branch (3068:6): [True: 0, False: 841]
  ------------------
 3069|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  158|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3070|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3071|      0|		    "Failed to initialize HMAC-SHA1");
 3072|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3073|      0|	}
 3074|    841|	zip->cctx_valid = zip->hctx_valid = 1;
 3075|    841|	__archive_read_consume(a, salt_len + 2);
 3076|    841|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  139|    841|#define AUTH_CODE_SIZE	10
  ------------------
 3077|    841|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|    841|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3077:6): [True: 782, False: 59]
  ------------------
 3078|    841|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3078:9): [True: 0, False: 782]
  ------------------
 3079|      0|		goto corrupted;
 3080|    841|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  139|    841|#define AUTH_CODE_SIZE	10
  ------------------
 3081|    841|	zip->decrypted_bytes_remaining = 0;
 3082|       |
 3083|    841|	zip->entry->compression = zip->entry->aes_extra.compression;
 3084|    841|	return (zip_alloc_decryption_buffer(a));
 3085|       |
 3086|      0|truncated:
 3087|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3088|      0|	    "Truncated ZIP file data");
 3089|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3090|      0|corrupted:
 3091|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3092|      0|	    "Corrupted ZIP file data");
 3093|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3094|    841|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 2914|  1.70k|{
 2915|  1.70k|	struct zip *zip = (struct zip *)(a->format->data);
 2916|  1.70k|	size_t bs = 256 * 1024;
 2917|       |
 2918|  1.70k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (2918:6): [True: 23, False: 1.68k]
  ------------------
 2919|     23|		zip->decrypted_buffer_size = bs;
 2920|     23|		zip->decrypted_buffer = malloc(bs);
 2921|     23|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (2921:7): [True: 0, False: 23]
  ------------------
 2922|      0|			archive_set_error(&a->archive, ENOMEM,
 2923|      0|			    "No memory for ZIP decryption");
 2924|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2925|      0|		}
 2926|     23|	}
 2927|  1.70k|	zip->decrypted_ptr = zip->decrypted_buffer;
 2928|  1.70k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  1.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2929|  1.70k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 2933|  5.53k|{
 2934|  5.53k|	struct zip *zip = (struct zip *)(a->format->data);
 2935|  5.53k|	const void *p;
 2936|  5.53k|	int retry;
 2937|  5.53k|	int r;
 2938|       |
 2939|  5.53k|	if (zip->tctx_valid)
  ------------------
  |  Branch (2939:6): [True: 0, False: 5.53k]
  ------------------
 2940|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2941|       |
 2942|       |	/*
 2943|       |	   Read the 12 bytes encryption header stored at
 2944|       |	   the start of the data area.
 2945|       |	 */
 2946|  5.53k|#define ENC_HEADER_SIZE	12
 2947|  5.53k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  5.53k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2947:6): [True: 629, False: 4.90k]
  ------------------
 2948|  5.53k|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 2946|    629|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (2948:9): [True: 0, False: 629]
  ------------------
 2949|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2950|      0|		    "Truncated Zip encrypted body: only %jd bytes available",
 2951|      0|		    (intmax_t)zip->entry_bytes_remaining);
 2952|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2953|      0|	}
 2954|       |
 2955|  5.53k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 2946|  5.53k|#define ENC_HEADER_SIZE	12
  ------------------
 2956|  5.53k|	if (p == NULL) {
  ------------------
  |  Branch (2956:6): [True: 0, False: 5.53k]
  ------------------
 2957|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2958|      0|		    "Truncated ZIP file data");
 2959|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2960|      0|	}
 2961|       |
 2962|  8.00k|	for (retry = 0;; retry++) {
 2963|  8.00k|		const char *passphrase;
 2964|  8.00k|		uint8_t crcchk;
 2965|       |
 2966|  8.00k|		passphrase = __archive_read_next_passphrase(a);
 2967|  8.00k|		if (passphrase == NULL) {
  ------------------
  |  Branch (2967:7): [True: 4.66k, False: 3.33k]
  ------------------
 2968|  4.66k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|  4.66k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2969|  4.66k|			    (retry > 0)?
  ------------------
  |  Branch (2969:8): [True: 2.46k, False: 2.20k]
  ------------------
 2970|  2.46k|				"Incorrect passphrase":
 2971|  4.66k|				"Passphrase required for this entry");
 2972|  4.66k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|  4.66k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2973|  4.66k|		}
 2974|       |
 2975|       |		/*
 2976|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 2977|       |		 */
 2978|  3.33k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 2979|  3.33k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 2946|  3.33k|#define ENC_HEADER_SIZE	12
  ------------------
 2980|  3.33k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (2980:7): [True: 3.33k, False: 0]
  |  Branch (2980:17): [True: 868, False: 2.46k]
  ------------------
 2981|    868|			break;/* The passphrase is OK. */
 2982|  2.46k|		if (retry > 10000) {
  ------------------
  |  Branch (2982:7): [True: 0, False: 2.46k]
  ------------------
 2983|       |			/* Avoid infinity loop. */
 2984|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2985|      0|			    "Too many incorrect passphrases");
 2986|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  196|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2987|      0|		}
 2988|  2.46k|	}
 2989|       |
 2990|    868|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 2946|    868|#define ENC_HEADER_SIZE	12
  ------------------
 2991|    868|	zip->tctx_valid = 1;
 2992|    868|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
  ------------------
  |  |  121|    868|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2992:6): [True: 628, False: 240]
  ------------------
 2993|    628|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 2946|    628|#define ENC_HEADER_SIZE	12
  ------------------
 2994|    628|	}
 2995|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 2996|    868|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 2946|    868|#define ENC_HEADER_SIZE	12
  ------------------
 2997|    868|	zip->decrypted_bytes_remaining = 0;
 2998|       |
 2999|    868|	return (zip_alloc_decryption_buffer(a));
 3000|  5.53k|#undef ENC_HEADER_SIZE
 3001|  5.53k|}
archive_read_support_format_zip.c:trad_enc_init:
  339|  3.33k|{
  340|  3.33k|	uint8_t header[12];
  341|       |
  342|  3.33k|	if (key_len < 12) {
  ------------------
  |  Branch (342:6): [True: 0, False: 3.33k]
  ------------------
  343|      0|		*crcchk = 0xff;
  344|      0|		return -1;
  345|      0|	}
  346|       |
  347|  3.33k|	ctx->keys[0] = 305419896L;
  348|  3.33k|	ctx->keys[1] = 591751049L;
  349|  3.33k|	ctx->keys[2] = 878082192L;
  350|       |
  351|  23.3k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (351:8): [True: 20.0k, False: 3.33k]
  ------------------
  352|  20.0k|		trad_enc_update_keys(ctx, *pw++);
  353|       |
  354|  3.33k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  355|       |	/* Return the last byte for CRC check. */
  356|  3.33k|	*crcchk = header[11];
  357|  3.33k|	return 0;
  358|  3.33k|}
archive_read_support_format_zip.c:zip_read_data_none:
 1615|  6.85k|{
 1616|  6.85k|	struct zip *zip;
 1617|  6.85k|	const char *buff;
 1618|  6.85k|	ssize_t bytes_avail;
 1619|  6.85k|	ssize_t trailing_extra;
 1620|  6.85k|	int r;
 1621|       |
 1622|  6.85k|	(void)offset; /* UNUSED */
 1623|       |
 1624|  6.85k|	zip = (struct zip *)(a->format->data);
 1625|  6.85k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  139|  1.21k|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (1625:19): [True: 1.21k, False: 5.63k]
  ------------------
 1626|       |
 1627|  6.85k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
  ------------------
  |  |  121|  6.85k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1627:6): [True: 50, False: 6.80k]
  ------------------
 1628|     50|		const char *p;
 1629|     50|		ssize_t grabbing_bytes = 24 + trailing_extra;
 1630|       |
 1631|       |		/* Grab at least 24 bytes. */
 1632|     50|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 1633|     50|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (1633:7): [True: 2, False: 48]
  ------------------
 1634|       |			/* Zip archives have end-of-archive markers
 1635|       |			   that are longer than this, so a failure to get at
 1636|       |			   least 24 bytes really does indicate a truncated
 1637|       |			   file. */
 1638|      2|			archive_set_error(&a->archive,
 1639|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1640|      2|			    "Truncated ZIP file data");
 1641|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1642|      2|		}
 1643|       |		/* Check for a complete PK\007\010 signature, followed
 1644|       |		 * by the correct 4-byte CRC. */
 1645|     48|		p = buff + trailing_extra;
 1646|     48|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (1646:7): [True: 23, False: 25]
  |  Branch (1646:22): [True: 21, False: 2]
  ------------------
 1647|     48|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (1647:10): [True: 21, False: 0]
  |  Branch (1647:28): [True: 21, False: 0]
  ------------------
 1648|     48|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (1648:11): [True: 12, False: 9]
  ------------------
 1649|     21|			|| zip->ignore_crc32
  ------------------
  |  Branch (1649:7): [True: 9, False: 0]
  ------------------
 1650|     21|			|| (zip->hctx_valid
  ------------------
  |  Branch (1650:8): [True: 0, False: 0]
  ------------------
 1651|     21|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  106|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1651:8): [True: 0, False: 0]
  ------------------
 1652|     21|			zip->end_of_entry = 1;
 1653|     21|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1653:8): [True: 0, False: 21]
  ------------------
 1654|      0|				r = check_authentication_code(a, buff);
 1655|      0|				if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1655:9): [True: 0, False: 0]
  ------------------
 1656|      0|					return (r);
 1657|      0|			}
 1658|     21|			return (ARCHIVE_OK);
  ------------------
  |  |  192|     21|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1659|     21|		}
 1660|       |		/* If not at EOF, ensure we consume at least one byte. */
 1661|     27|		++p;
 1662|       |
 1663|       |		/* Scan forward until we see where a PK\007\010 signature
 1664|       |		 * might be. */
 1665|       |		/* Return bytes up until that point.  On the next call,
 1666|       |		 * the code above will verify the data descriptor. */
 1667|   561k|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (1667:10): [True: 561k, False: 5]
  ------------------
 1668|   561k|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (1668:8): [True: 1.28k, False: 559k]
  ------------------
 1669|   559k|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (1669:13): [True: 1.15k, False: 558k]
  ------------------
 1670|   558k|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (1670:13): [True: 1.28k, False: 557k]
  ------------------
 1671|   557k|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (1671:13): [True: 1.40k, False: 556k]
  |  Branch (1671:31): [True: 55, False: 1.35k]
  ------------------
 1672|   557k|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (1672:11): [True: 27, False: 28]
  |  Branch (1672:26): [True: 22, False: 5]
  ------------------
 1673|     22|				break;
 1674|   557k|			} else { p += 4; }
 1675|   561k|		}
 1676|     27|		p -= trailing_extra;
 1677|     27|		bytes_avail = p - buff;
 1678|  6.80k|	} else {
 1679|  6.80k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1679:7): [True: 3.40k, False: 3.40k]
  ------------------
 1680|  3.40k|			zip->end_of_entry = 1;
 1681|  3.40k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1681:8): [True: 608, False: 2.79k]
  ------------------
 1682|    608|				r = check_authentication_code(a, NULL);
 1683|    608|				if (r != ARCHIVE_OK)
  ------------------
  |  |  192|    608|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1683:9): [True: 296, False: 312]
  ------------------
 1684|    296|					return (r);
 1685|    608|			}
 1686|  3.10k|			return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1687|  3.40k|		}
 1688|       |		/* Grab a bunch of bytes. */
 1689|  3.40k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 1690|  3.40k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1690:7): [True: 1, False: 3.40k]
  ------------------
 1691|      1|			archive_set_error(&a->archive,
 1692|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1693|      1|			    "Truncated ZIP file data");
 1694|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1695|      1|		}
 1696|  3.40k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (1696:7): [True: 3.40k, False: 2]
  ------------------
 1697|  3.40k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 1698|  3.40k|	}
 1699|  3.42k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1699:6): [True: 7, False: 3.42k]
  |  Branch (1699:25): [True: 610, False: 2.81k]
  ------------------
 1700|    617|		size_t dec_size = bytes_avail;
 1701|       |
 1702|    617|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (1702:7): [True: 5, False: 612]
  ------------------
 1703|      5|			dec_size = zip->decrypted_buffer_size;
 1704|    617|		if (zip->tctx_valid) {
  ------------------
  |  Branch (1704:7): [True: 7, False: 610]
  ------------------
 1705|      7|			trad_enc_decrypt_update(&zip->tctx,
 1706|      7|			    (const uint8_t *)buff, dec_size,
 1707|      7|			    zip->decrypted_buffer, dec_size);
 1708|    610|		} else {
 1709|    610|			size_t dsize = dec_size;
 1710|    610|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|    610|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 1711|    610|			    (const uint8_t *)buff, dec_size);
 1712|    610|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  156|    610|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 1713|    610|			    (const uint8_t *)buff, dec_size,
 1714|    610|			    zip->decrypted_buffer, &dsize);
 1715|    610|		}
 1716|    617|		bytes_avail = dec_size;
 1717|    617|		buff = (const char *)zip->decrypted_buffer;
 1718|    617|	}
 1719|  3.42k|	zip->entry_bytes_remaining -= bytes_avail;
 1720|  3.42k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 1721|  3.42k|	zip->entry_compressed_bytes_read += bytes_avail;
 1722|  3.42k|	zip->unconsumed += bytes_avail;
 1723|  3.42k|	*size = bytes_avail;
 1724|  3.42k|	*_buff = buff;
 1725|  3.42k|	return (ARCHIVE_OK);
  ------------------
  |  |  192|  3.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1726|  6.85k|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2194|  16.0k|{
 2195|  16.0k|	struct zip* zip = (struct zip *)(a->format->data);
 2196|  16.0k|	int ret;
 2197|  16.0k|	size_t consumed_bytes = 0;
 2198|  16.0k|	ssize_t bytes_avail = 0;
 2199|       |
 2200|  16.0k|	(void) offset; /* UNUSED */
 2201|       |
 2202|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2203|       |	 * context first. */
 2204|  16.0k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2204:5): [True: 16.0k, False: 0]
  ------------------
 2205|  16.0k|		ret = zipx_ppmd8_init(a, zip);
 2206|  16.0k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  192|  16.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2206:6): [True: 4.95k, False: 11.0k]
  ------------------
 2207|  4.95k|			return ret;
 2208|  16.0k|	}
 2209|       |
 2210|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2211|       |	 * should prefetch more bytes. */
 2212|  11.0k|	(void) __archive_read_ahead(a, 1, &bytes_avail);
 2213|  11.0k|	if(bytes_avail < 0) {
  ------------------
  |  Branch (2213:5): [True: 0, False: 11.0k]
  ------------------
 2214|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2215|      0|		    "Truncated PPMd8 file body");
 2216|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2217|      0|	}
 2218|       |
 2219|       |	/* This counter will be updated inside ppmd_read(), which at one
 2220|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2221|  11.0k|	zip->zipx_ppmd_read_compressed = 0;
 2222|       |
 2223|       |	/* Decompression loop. */
 2224|  40.4M|	do {
 2225|  40.4M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2226|  40.4M|		    &zip->ppmd8);
 2227|  40.4M|		if(sym < 0) {
  ------------------
  |  Branch (2227:6): [True: 11.0k, False: 40.4M]
  ------------------
 2228|  11.0k|			zip->end_of_entry = 1;
 2229|  11.0k|			break;
 2230|  11.0k|		}
 2231|       |
 2232|       |		/* This field is set by ppmd_read() when there was no more data
 2233|       |		 * to be read. */
 2234|  40.4M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2234:6): [True: 7, False: 40.4M]
  ------------------
 2235|      7|			archive_set_error(&a->archive,
 2236|      7|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2237|      7|			    "Truncated PPMd8 file body");
 2238|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2239|      7|		}
 2240|       |
 2241|  40.4M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2242|  40.4M|		++consumed_bytes;
 2243|  40.4M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2243:10): [True: 40.4M, False: 0]
  ------------------
 2244|       |
 2245|       |	/* Update pointers so we can continue decompression in another call. */
 2246|  11.0k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2247|  11.0k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2248|  11.0k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2249|       |
 2250|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2251|  11.0k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2251:5): [True: 11.0k, False: 0]
  ------------------
 2252|  11.0k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2253|  11.0k|		zip->ppmd8_valid = 0;
 2254|  11.0k|	}
 2255|       |
 2256|       |	/* Update pointers for libarchive. */
 2257|  11.0k|	*buff = zip->uncompressed_buffer;
 2258|  11.0k|	*size = consumed_bytes;
 2259|       |
 2260|  11.0k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  11.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2261|  11.0k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2095|  16.0k|{
 2096|  16.0k|	const void* p;
 2097|  16.0k|	uint32_t val;
 2098|  16.0k|	uint32_t order;
 2099|  16.0k|	uint32_t mem;
 2100|  16.0k|	uint32_t restore_method;
 2101|       |
 2102|       |	/* Remove previous decompression context if it exists. */
 2103|  16.0k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2103:5): [True: 0, False: 16.0k]
  ------------------
 2104|      0|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2105|      0|		zip->ppmd8_valid = 0;
 2106|      0|	}
 2107|       |
 2108|       |	/* Create a new decompression context. */
 2109|  16.0k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2110|  16.0k|	zip->ppmd8_stream_failed = 0;
 2111|       |
 2112|       |	/* Setup function pointers required by Ppmd8 decompressor. The
 2113|       |	 * 'ppmd_read' function will feed new bytes to the decompressor,
 2114|       |	 * and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
 2115|  16.0k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2116|  16.0k|	zip->zipx_ppmd_stream.a = a;
 2117|  16.0k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2118|       |
 2119|       |	/* Reset number of read bytes to 0. */
 2120|  16.0k|	zip->zipx_ppmd_read_compressed = 0;
 2121|       |
 2122|       |	/* Read Ppmd8 header (2 bytes). */
 2123|  16.0k|	p = __archive_read_ahead(a, 2, NULL);
 2124|  16.0k|	if(!p) {
  ------------------
  |  Branch (2124:5): [True: 0, False: 16.0k]
  ------------------
 2125|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2126|      0|		    "Truncated file data in PPMd8 stream");
 2127|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2128|      0|	}
 2129|  16.0k|	__archive_read_consume(a, 2);
 2130|       |
 2131|       |	/* Decode the stream's compression parameters. */
 2132|  16.0k|	val = archive_le16dec(p);
 2133|  16.0k|	order = (val & 15) + 1;
 2134|  16.0k|	mem = ((val >> 4) & 0xff) + 1;
 2135|  16.0k|	restore_method = (val >> 12);
 2136|       |
 2137|  16.0k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2137:5): [True: 2.21k, False: 13.7k]
  |  Branch (2137:18): [True: 2.73k, False: 11.0k]
  ------------------
 2138|  4.95k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|  4.95k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2139|  4.95k|		    "Invalid parameter set in PPMd8 stream (order=%" PRId32 ", "
 2140|  4.95k|		    "restore=%" PRId32 ")", order, restore_method);
 2141|  4.95k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  196|  4.95k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2142|  4.95k|	}
 2143|       |
 2144|       |	/* Allocate the memory needed to properly decompress the file. */
 2145|  11.0k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2145:5): [True: 0, False: 11.0k]
  ------------------
 2146|      0|		archive_set_error(&a->archive, ENOMEM,
 2147|      0|		    "Unable to allocate memory for PPMd8 stream: %" PRId32 " bytes",
 2148|      0|		    mem << 20);
 2149|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2150|      0|	}
 2151|       |
 2152|       |	/* Signal the cleanup function to release Ppmd8 context in the
 2153|       |	 * cleanup phase. */
 2154|  11.0k|	zip->ppmd8_valid = 1;
 2155|       |
 2156|       |	/* Perform further Ppmd8 initialization. */
 2157|  11.0k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2157:5): [True: 0, False: 11.0k]
  ------------------
 2158|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  205|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2159|      0|		    "PPMd8 stream range decoder initialization error");
 2160|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2161|      0|	}
 2162|       |
 2163|  11.0k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2164|  11.0k|	    restore_method);
 2165|       |
 2166|       |	/* Allocate the buffer that will hold uncompressed data. */
 2167|  11.0k|	free(zip->uncompressed_buffer);
 2168|       |
 2169|  11.0k|	zip->uncompressed_buffer_size = 256 * 1024;
 2170|  11.0k|	zip->uncompressed_buffer =
 2171|  11.0k|	    (uint8_t*) malloc(zip->uncompressed_buffer_size);
 2172|       |
 2173|  11.0k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2173:5): [True: 0, False: 11.0k]
  ------------------
 2174|      0|		archive_set_error(&a->archive, ENOMEM,
 2175|      0|		    "No memory for PPMd8 decompression");
 2176|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2177|      0|	}
 2178|       |
 2179|       |	/* Ppmd8 initialization is done. */
 2180|  11.0k|	zip->decompress_init = 1;
 2181|       |
 2182|       |	/* We've already read 2 bytes in the output stream. Additionally,
 2183|       |	 * Ppmd8 initialization code could read some data as well. So we
 2184|       |	 * are advancing the stream by 2 bytes plus whatever number of
 2185|       |	 * bytes Ppmd8 init function used. */
 2186|  11.0k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 2187|       |
 2188|  11.0k|	return ARCHIVE_OK;
  ------------------
  |  |  192|  11.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2189|  11.0k|}
archive_read_support_format_zip.c:ppmd_read:
  273|  11.3M|ppmd_read(void* p) {
  274|       |	/* Get the handle to current decompression context. */
  275|  11.3M|	struct archive_read *a = ((IByteIn*)p)->a;
  276|  11.3M|	struct zip *zip = (struct zip*) a->format->data;
  277|  11.3M|	ssize_t bytes_avail = 0;
  278|       |
  279|       |	/* Fetch next byte. */
  280|  11.3M|	const uint8_t* data = __archive_read_ahead(a, 1, &bytes_avail);
  281|  11.3M|	if(bytes_avail < 1) {
  ------------------
  |  Branch (281:5): [True: 7, False: 11.3M]
  ------------------
  282|      7|		zip->ppmd8_stream_failed = 1;
  283|      7|		return 0;
  284|      7|	}
  285|       |
  286|  11.3M|	__archive_read_consume(a, 1);
  287|       |
  288|       |	/* Increment the counter. */
  289|  11.3M|	++zip->zipx_ppmd_read_compressed;
  290|       |
  291|       |	/* Return the next compressed byte. */
  292|  11.3M|	return data[0];
  293|  11.3M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1416|  17.6k|{
 1417|  17.6k|	const char *marker;
 1418|  17.6k|	const char *p;
 1419|  17.6k|	uint64_t compressed32, uncompressed32;
 1420|  17.6k|	uint64_t compressed64, uncompressed64;
 1421|  17.6k|	uint64_t compressed_actual, uncompressed_actual;
 1422|  17.6k|	uint32_t crc32_actual;
 1423|  17.6k|	const uint32_t PK78 = 0x08074B50ULL;
 1424|  17.6k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1425|       |
 1426|       |	/* If there shouldn't be a marker, don't consume it. */
 1427|  17.6k|	if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
  ------------------
  |  |  121|  17.6k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1427:6): [True: 14.7k, False: 2.83k]
  ------------------
 1428|  14.7k|		return;
 1429|  14.7k|	}
 1430|       |
 1431|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1432|       |	 * end-of-file record can never appear at the end of the
 1433|       |	 * archive, we know 24 bytes will be available unless
 1434|       |	 * the archive is severely truncated. */
 1435|  2.83k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1435:6): [True: 0, False: 2.83k]
  ------------------
 1436|      0|		return;
 1437|      0|	}
 1438|  2.83k|	p = marker;
 1439|       |
 1440|       |	/* The end-of-file record comprises:
 1441|       |	 * = Optional PK\007\010 marker
 1442|       |	 * = 4-byte CRC32
 1443|       |	 * = Compressed size
 1444|       |	 * = Uncompressed size
 1445|       |	 *
 1446|       |	 * The last two fields are either both 32 bits or both 64
 1447|       |	 * bits.  We check all possible layouts and accept any one
 1448|       |	 * that gives us a complete match, else we make a best-effort
 1449|       |	 * attempt to parse out the pieces.
 1450|       |	 */
 1451|       |
 1452|       |	/* CRC32 checking can be tricky:
 1453|       |	 * * Test suites sometimes ignore the CRC32
 1454|       |	 * * AES AE-2 always writes zero for the CRC32
 1455|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1456|       |	 */
 1457|  2.83k|	crc32_ignored = zip->ignore_crc32;
 1458|  2.83k|	crc32_may_be_zero = 0;
 1459|  2.83k|	crc32_actual = zip->computed_crc32;
 1460|  2.83k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1460:6): [True: 55, False: 2.77k]
  ------------------
 1461|     55|	  switch (zip->entry->aes_extra.vendor) {
 1462|      0|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  106|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1462:4): [True: 0, False: 55]
  ------------------
 1463|      0|	    crc32_actual = 0;
 1464|      0|	    break;
 1465|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  105|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1465:4): [True: 0, False: 55]
  ------------------
 1466|     55|	  default:
  ------------------
  |  Branch (1466:4): [True: 55, False: 0]
  ------------------
 1467|     55|	    crc32_may_be_zero = 1;
 1468|     55|	    break;
 1469|     55|	  }
 1470|     55|	}
 1471|       |
 1472|       |	/* Values computed from the actual data in the archive. */
 1473|  2.83k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1474|  2.83k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1475|       |
 1476|       |
 1477|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1478|  2.83k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1478:6): [True: 2.14k, False: 691]
  ------------------
 1479|  2.83k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1479:10): [True: 2.03k, False: 108]
  ------------------
 1480|  2.14k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1480:7): [True: 0, False: 108]
  |  Branch (1480:28): [True: 0, False: 0]
  ------------------
 1481|  2.14k|		|| crc32_ignored)
  ------------------
  |  Branch (1481:6): [True: 108, False: 0]
  ------------------
 1482|  2.83k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1482:9): [True: 1.44k, False: 698]
  ------------------
 1483|  2.83k|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1483:9): [True: 639, False: 803]
  ------------------
 1484|    639|		if (!crc32_ignored) {
  ------------------
  |  Branch (1484:7): [True: 0, False: 639]
  ------------------
 1485|      0|			zip->entry->crc32 = crc32_actual;
 1486|      0|		}
 1487|    639|		zip->entry->compressed_size = compressed_actual;
 1488|    639|		zip->entry->uncompressed_size = uncompressed_actual;
 1489|    639|		zip->unconsumed += 24;
 1490|    639|		return;
 1491|    639|	}
 1492|       |
 1493|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1494|  2.19k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1494:7): [True: 199, False: 1.99k]
  ------------------
 1495|  2.19k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1495:11): [True: 55, False: 1.93k]
  |  Branch (1495:32): [True: 0, False: 55]
  ------------------
 1496|  2.19k|	     || crc32_ignored)
  ------------------
  |  Branch (1496:10): [True: 1.99k, False: 0]
  ------------------
 1497|  2.19k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1497:9): [True: 99, False: 2.09k]
  ------------------
 1498|  2.19k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1498:9): [True: 91, False: 8]
  ------------------
 1499|     91|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1499:14): [True: 0, False: 91]
  ------------------
 1500|      0|			zip->entry->crc32 = crc32_actual;
 1501|      0|		}
 1502|     91|		zip->entry->compressed_size = compressed_actual;
 1503|     91|		zip->entry->uncompressed_size = uncompressed_actual;
 1504|     91|		zip->unconsumed += 20;
 1505|     91|		return;
 1506|     91|	}
 1507|       |
 1508|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1509|  2.10k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1509:6): [True: 1.41k, False: 691]
  ------------------
 1510|  2.10k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1510:10): [True: 1.39k, False: 17]
  ------------------
 1511|  1.41k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1511:7): [True: 0, False: 17]
  |  Branch (1511:28): [True: 0, False: 0]
  ------------------
 1512|  1.41k|		|| crc32_ignored)
  ------------------
  |  Branch (1512:6): [True: 17, False: 0]
  ------------------
 1513|  2.10k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1513:9): [True: 891, False: 519]
  ------------------
 1514|  2.10k|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1514:9): [True: 803, False: 88]
  ------------------
 1515|    803|		if (!crc32_ignored) {
  ------------------
  |  Branch (1515:7): [True: 0, False: 803]
  ------------------
 1516|      0|			zip->entry->crc32 = crc32_actual;
 1517|      0|		}
 1518|    803|		zip->entry->compressed_size = compressed_actual;
 1519|    803|		zip->entry->uncompressed_size = uncompressed_actual;
 1520|    803|		zip->unconsumed += 16;
 1521|    803|		return;
 1522|    803|	}
 1523|       |
 1524|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1525|  1.29k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1525:7): [True: 199, False: 1.09k]
  ------------------
 1526|  1.29k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1526:11): [True: 55, False: 1.04k]
  |  Branch (1526:32): [True: 0, False: 55]
  ------------------
 1527|  1.29k|	     || crc32_ignored)
  ------------------
  |  Branch (1527:10): [True: 1.09k, False: 0]
  ------------------
 1528|  1.29k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1528:9): [True: 8, False: 1.29k]
  ------------------
 1529|  1.29k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 8]
  ------------------
 1530|      0|		if (!crc32_ignored) {
  ------------------
  |  Branch (1530:7): [True: 0, False: 0]
  ------------------
 1531|      0|			zip->entry->crc32 = crc32_actual;
 1532|      0|		}
 1533|      0|		zip->entry->compressed_size = compressed_actual;
 1534|      0|		zip->entry->uncompressed_size = uncompressed_actual;
 1535|      0|		zip->unconsumed += 12;
 1536|      0|		return;
 1537|      0|	}
 1538|       |
 1539|       |	/* If none of the above patterns gives us a full exact match,
 1540|       |	 * then there's something definitely amiss.  The fallback code
 1541|       |	 * below will parse out some plausible values for error
 1542|       |	 * reporting purposes.  Note that this won't actually
 1543|       |	 * consume anything:
 1544|       |	 *
 1545|       |	 * = If there really is a marker here, the logic to resync to
 1546|       |	 *   the next entry will suffice to skip it.
 1547|       |	 *
 1548|       |	 * = There might not really be a marker: Corruption or bugs
 1549|       |	 *   may have set the length-at-end bit without a marker ever
 1550|       |	 *   having actually been written. In this case, we
 1551|       |	 *   explicitly should not consume any bytes, since that would
 1552|       |	 *   prevent us from correctly reading the next entry.
 1553|       |	 */
 1554|  1.29k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1554:6): [True: 607, False: 691]
  ------------------
 1555|    607|		p += 4; /* Ignore PK78 if it appears to be present */
 1556|    607|	}
 1557|  1.29k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1558|  1.29k|	p += 4;
 1559|       |
 1560|       |	/* Consider both 32- and 64-bit interpretations */
 1561|  1.29k|	compressed32 = archive_le32dec(p);
 1562|  1.29k|	uncompressed32 = archive_le32dec(p + 4);
 1563|  1.29k|	compressed64 = archive_le64dec(p);
 1564|  1.29k|	uncompressed64 = archive_le64dec(p + 8);
 1565|       |
 1566|       |	/* The earlier patterns may have failed because of CRC32
 1567|       |	 * mismatch, so it's still possible that both sizes match.
 1568|       |	 * Try to match as many as we can...
 1569|       |	 */
 1570|  1.29k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1570:6): [True: 96, False: 1.20k]
  ------------------
 1571|  1.29k|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1571:9): [True: 0, False: 96]
  ------------------
 1572|       |		/* Both 32-bit fields match */
 1573|      0|		zip->entry->compressed_size = compressed32;
 1574|      0|		zip->entry->uncompressed_size = uncompressed32;
 1575|  1.29k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1575:13): [True: 8, False: 1.29k]
  ------------------
 1576|  1.29k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1576:9): [True: 330, False: 960]
  ------------------
 1577|       |		/* One or both 64-bit fields match */
 1578|    338|		zip->entry->compressed_size = compressed64;
 1579|    338|		zip->entry->uncompressed_size = uncompressed64;
 1580|    960|	} else {
 1581|       |		/* Zero or one 32-bit fields match */
 1582|    960|		zip->entry->compressed_size = compressed32;
 1583|    960|		zip->entry->uncompressed_size = uncompressed32;
 1584|    960|	}
 1585|  1.29k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 3503|  27.5k|{
 3504|  27.5k|	struct zip *zip;
 3505|  27.5k|	int64_t bytes_skipped;
 3506|       |
 3507|  27.5k|	zip = (struct zip *)(a->format->data);
 3508|  27.5k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 3509|  27.5k|	zip->unconsumed = 0;
 3510|  27.5k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (3510:6): [True: 0, False: 27.5k]
  ------------------
 3511|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3512|       |
 3513|       |	/* If we've already read to end of data, we're done. */
 3514|  27.5k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3514:6): [True: 18.3k, False: 9.27k]
  ------------------
 3515|  18.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  18.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3516|       |
 3517|       |	/* So we know we're streaming... */
 3518|  9.27k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|  9.27k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3518:6): [True: 5.01k, False: 4.25k]
  ------------------
 3519|  9.27k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (3519:9): [True: 669, False: 3.58k]
  ------------------
 3520|       |		/* We know the compressed length, so we can just skip. */
 3521|  5.68k|		bytes_skipped = __archive_read_consume(a,
 3522|  5.68k|					zip->entry_bytes_remaining);
 3523|  5.68k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (3523:7): [True: 8, False: 5.67k]
  ------------------
 3524|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3525|  5.67k|		return (ARCHIVE_OK);
  ------------------
  |  |  192|  5.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3526|  5.68k|	}
 3527|       |
 3528|  3.58k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3528:6): [True: 2.46k, False: 1.12k]
  ------------------
 3529|  2.46k|		int r;
 3530|       |
 3531|  2.46k|		zip->has_encrypted_entries = 1;
 3532|  2.46k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  122|  2.46k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3532:7): [True: 30, False: 2.43k]
  ------------------
 3533|     30|			r = read_decryption_header(a);
 3534|  2.43k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  137|  2.43k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3534:12): [True: 0, False: 2.43k]
  ------------------
 3535|      0|			r = init_WinZip_AES_decryption(a);
 3536|  2.43k|		else
 3537|  2.43k|			r = init_traditional_PKWARE_decryption(a);
 3538|  2.46k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|  2.46k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3538:7): [True: 2.23k, False: 237]
  ------------------
 3539|  2.23k|			return (r);
 3540|    237|		zip->init_decryption = 0;
 3541|    237|	}
 3542|       |
 3543|       |	/* We're streaming and we don't know the length. */
 3544|       |	/* If the body is compressed and we know the format, we can
 3545|       |	 * find an exact end-of-entry by decompressing it. */
 3546|  1.35k|	switch (zip->entry->compression) {
 3547|      0|#ifdef HAVE_ZLIB_H
 3548|      0|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3548:2): [True: 0, False: 1.35k]
  ------------------
 3549|      0|		while (!zip->end_of_entry) {
  ------------------
  |  Branch (3549:10): [True: 0, False: 0]
  ------------------
 3550|      0|			int64_t offset = 0;
 3551|      0|			const void *buff = NULL;
 3552|      0|			size_t size = 0;
 3553|      0|			int r;
 3554|      0|			r =  zip_read_data_deflate(a, &buff, &size, &offset);
 3555|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3555:8): [True: 0, False: 0]
  ------------------
 3556|      0|				return (r);
 3557|      0|		}
 3558|      0|		return ARCHIVE_OK;
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3559|      0|#endif
 3560|  1.35k|	default: /* Uncompressed or unknown. */
  ------------------
  |  Branch (3560:2): [True: 1.35k, False: 0]
  ------------------
 3561|       |		/* Scan for a PK\007\010 signature. */
 3562|  1.35k|		for (;;) {
 3563|  1.35k|			const char *p, *buff;
 3564|  1.35k|			ssize_t bytes_avail;
 3565|  1.35k|			buff = __archive_read_ahead(a, 16, &bytes_avail);
 3566|  1.35k|			if (bytes_avail < 16) {
  ------------------
  |  Branch (3566:8): [True: 0, False: 1.35k]
  ------------------
 3567|      0|				archive_set_error(&a->archive,
 3568|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3569|      0|				    "Truncated ZIP file data");
 3570|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3571|      0|			}
 3572|  1.35k|			p = buff;
 3573|   137k|			while (p <= buff + bytes_avail - 16) {
  ------------------
  |  Branch (3573:11): [True: 137k, False: 0]
  ------------------
 3574|   137k|				if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (3574:9): [True: 2.17k, False: 135k]
  ------------------
 3575|   135k|				else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (3575:14): [True: 1.84k, False: 133k]
  ------------------
 3576|   133k|				else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (3576:14): [True: 874, False: 132k]
  ------------------
 3577|   132k|				else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (3577:14): [True: 2.34k, False: 130k]
  |  Branch (3577:32): [True: 1.95k, False: 381]
  ------------------
 3578|   132k|				    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (3578:12): [True: 1.95k, False: 0]
  |  Branch (3578:27): [True: 1.35k, False: 601]
  ------------------
 3579|  1.35k|					if (zip->entry->flags & LA_USED_ZIP64)
  ------------------
  |  |  129|  1.35k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  |  Branch (3579:10): [True: 54, False: 1.30k]
  ------------------
 3580|     54|						__archive_read_consume(a,
 3581|     54|						    p - buff + 24);
 3582|  1.30k|					else
 3583|  1.30k|						__archive_read_consume(a,
 3584|  1.30k|						    p - buff + 16);
 3585|  1.35k|					return ARCHIVE_OK;
  ------------------
  |  |  192|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3586|   131k|				} else { p += 4; }
 3587|   137k|			}
 3588|      0|			__archive_read_consume(a, p - buff);
 3589|      0|		}
 3590|  1.35k|	}
 3591|  1.35k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3228|    476|{
 3229|    476|	struct zip *zip;
 3230|    476|	struct zip_entry *zip_entry, *next_zip_entry;
 3231|       |
 3232|    476|	zip = (struct zip *)(a->format->data);
 3233|       |
 3234|    476|#ifdef HAVE_ZLIB_H
 3235|    476|	if (zip->stream_valid)
  ------------------
  |  Branch (3235:6): [True: 19, False: 457]
  ------------------
 3236|     19|		inflateEnd(&zip->stream);
 3237|    476|#endif
 3238|       |
 3239|    476|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3240|    476|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3240:9): [True: 1, False: 475]
  ------------------
 3241|      1|		lzma_end(&zip->zipx_lzma_stream);
 3242|      1|	}
 3243|    476|#endif
 3244|       |
 3245|    476|#ifdef HAVE_BZLIB_H
 3246|    476|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3246:6): [True: 0, False: 476]
  ------------------
 3247|      0|		BZ2_bzDecompressEnd(&zip->bzstream);
 3248|      0|	}
 3249|    476|#endif
 3250|       |
 3251|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3252|       |	if (zip->zstdstream_valid) {
 3253|       |		ZSTD_freeDStream(zip->zstdstream);
 3254|       |	}
 3255|       |#endif
 3256|       |
 3257|    476|	free(zip->uncompressed_buffer);
 3258|       |
 3259|    476|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3259:6): [True: 7, False: 469]
  ------------------
 3260|      7|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3261|       |
 3262|    476|	if (zip->zip_entries) {
  ------------------
  |  Branch (3262:6): [True: 95, False: 381]
  ------------------
 3263|     95|		zip_entry = zip->zip_entries;
 3264|    191|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3264:10): [True: 96, False: 95]
  ------------------
 3265|     96|			next_zip_entry = zip_entry->next;
 3266|     96|			archive_string_free(&zip_entry->rsrcname);
 3267|     96|			free(zip_entry);
 3268|     96|			zip_entry = next_zip_entry;
 3269|     96|		}
 3270|     95|	}
 3271|    476|	free(zip->decrypted_buffer);
 3272|    476|	if (zip->cctx_valid)
  ------------------
  |  Branch (3272:6): [True: 1, False: 475]
  ------------------
 3273|      1|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  158|      1|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3274|    476|	if (zip->hctx_valid)
  ------------------
  |  Branch (3274:6): [True: 1, False: 475]
  ------------------
 3275|      1|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      1|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3276|    476|	free(zip->iv);
 3277|    476|	free(zip->erd);
 3278|    476|	free(zip->v_data);
 3279|    476|	archive_string_free(&zip->format_name);
 3280|    476|	free(zip);
 3281|    476|	(a->format->data) = NULL;
 3282|    476|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3283|    476|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3365|    188|{
 3366|    188|	(void)a; /* UNUSED */
 3367|    188|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  357|    188|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3368|    188|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  358|    188|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3369|    188|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3287|     96|{
 3288|     96|	if (_a && _a->format) {
  ------------------
  |  Branch (3288:6): [True: 96, False: 0]
  |  Branch (3288:12): [True: 96, False: 0]
  ------------------
 3289|     96|		struct zip * zip = (struct zip *)_a->format->data;
 3290|     96|		if (zip) {
  ------------------
  |  Branch (3290:7): [True: 96, False: 0]
  ------------------
 3291|     96|			return zip->has_encrypted_entries;
 3292|     96|		}
 3293|     96|	}
 3294|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  370|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3295|     96|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 3748|    236|{
 3749|    236|	struct zip *zip = (struct zip *)a->format->data;
 3750|    236|	int64_t file_size, current_offset;
 3751|    236|	const char *p;
 3752|    236|	int i, tail;
 3753|       |
 3754|       |	/* If someone has already bid more than 32, then avoid
 3755|       |	   trashing the look-ahead buffers with a seek. */
 3756|    236|	if (best_bid > 32)
  ------------------
  |  Branch (3756:6): [True: 44, False: 192]
  ------------------
 3757|     44|		return (-1);
 3758|       |
 3759|    192|	file_size = __archive_read_seek(a, 0, SEEK_END);
 3760|    192|	if (file_size <= 0)
  ------------------
  |  Branch (3760:6): [True: 13, False: 179]
  ------------------
 3761|     13|		return 0;
 3762|       |
 3763|       |	/* Search last 16k of file for end-of-central-directory
 3764|       |	 * record (which starts with PK\005\006) */
 3765|    179|	tail = (int)zipmin(1024 * 16, file_size);
  ------------------
  |  |  255|    179|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (255:22): [True: 179, False: 0]
  |  |  ------------------
  ------------------
 3766|    179|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 3767|    179|	if (current_offset < 0)
  ------------------
  |  Branch (3767:6): [True: 0, False: 179]
  ------------------
 3768|      0|		return 0;
 3769|    179|	if ((p = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (3769:6): [True: 0, False: 179]
  ------------------
 3770|      0|		return 0;
 3771|       |	/* Boyer-Moore search backwards from the end, since we want
 3772|       |	 * to match the last EOCD in the file (there can be more than
 3773|       |	 * one if there is an uncompressed Zip archive as a member
 3774|       |	 * within this Zip archive). */
 3775|   719k|	for (i = tail - 22; i > 0;) {
  ------------------
  |  Branch (3775:22): [True: 719k, False: 172]
  ------------------
 3776|   719k|		switch (p[i]) {
 3777|  4.06k|		case 'P':
  ------------------
  |  Branch (3777:3): [True: 4.06k, False: 714k]
  ------------------
 3778|  4.06k|			if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3778:8): [True: 7, False: 4.06k]
  ------------------
 3779|      7|				int ret = read_eocd(zip, p + i,
 3780|      7|				    current_offset + i);
 3781|       |				/* Zip64 EOCD locator precedes
 3782|       |				 * regular EOCD if present. */
 3783|      7|				if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (3783:9): [True: 7, False: 0]
  |  Branch (3783:20): [True: 1, False: 6]
  ------------------
 3784|      1|					int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
 3785|      1|					if (ret_zip64 > ret)
  ------------------
  |  Branch (3785:10): [True: 0, False: 1]
  ------------------
 3786|      0|						ret = ret_zip64;
 3787|      1|				}
 3788|      7|				return (ret);
 3789|      7|			}
 3790|  4.06k|			i -= 4;
 3791|  4.06k|			break;
 3792|  2.94k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (3792:3): [True: 2.94k, False: 716k]
  ------------------
 3793|  14.5k|		case 005: i -= 2; break;
  ------------------
  |  Branch (3793:3): [True: 14.5k, False: 704k]
  ------------------
 3794|    877|		case 006: i -= 3; break;
  ------------------
  |  Branch (3794:3): [True: 877, False: 718k]
  ------------------
 3795|   696k|		default: i -= 4; break;
  ------------------
  |  Branch (3795:3): [True: 696k, False: 22.4k]
  ------------------
 3796|   719k|		}
 3797|   719k|	}
 3798|    172|	return 0;
 3799|    179|}
archive_read_support_format_zip.c:read_eocd:
 3663|      7|{
 3664|      7|	uint16_t disk_num;
 3665|      7|	uint32_t cd_size, cd_offset;
 3666|       |	
 3667|      7|	disk_num = archive_le16dec(p + 4);
 3668|      7|	cd_size = archive_le32dec(p + 12);
 3669|      7|	cd_offset = archive_le32dec(p + 16);
 3670|       |
 3671|       |	/* Sanity-check the EOCD we've found. */
 3672|       |
 3673|       |	/* This must be the first volume. */
 3674|      7|	if (disk_num != 0)
  ------------------
  |  Branch (3674:6): [True: 5, False: 2]
  ------------------
 3675|      5|		return 0;
 3676|       |	/* Central directory must be on this volume. */
 3677|      2|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (3677:6): [True: 0, False: 2]
  ------------------
 3678|      0|		return 0;
 3679|       |	/* All central directory entries must be on this volume. */
 3680|      2|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (3680:6): [True: 0, False: 2]
  ------------------
 3681|      0|		return 0;
 3682|       |	/* Central directory can't extend beyond start of EOCD record. */
 3683|      2|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (3683:6): [True: 0, False: 2]
  ------------------
 3684|      0|		return 0;
 3685|       |
 3686|       |	/* Save the central directory location for later use. */
 3687|      2|	zip->central_directory_offset = cd_offset;
 3688|      2|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 3689|       |
 3690|       |	/* This is just a tiny bit higher than the maximum
 3691|       |	   returned by the streaming Zip bidder.  This ensures
 3692|       |	   that the more accurate seeking Zip parser wins
 3693|       |	   whenever seek is available. */
 3694|      2|	return 32;
 3695|      2|}
archive_read_support_format_zip.c:read_zip64_eocd:
 3703|      1|{
 3704|      1|	int64_t eocd64_offset;
 3705|      1|	int64_t eocd64_size;
 3706|       |
 3707|       |	/* Sanity-check the locator record. */
 3708|       |
 3709|       |	/* Central dir must be on first volume. */
 3710|      1|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (3710:6): [True: 0, False: 1]
  ------------------
 3711|      0|		return 0;
 3712|       |	/* Must be only a single volume. */
 3713|      1|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (3713:6): [True: 0, False: 1]
  ------------------
 3714|      0|		return 0;
 3715|       |
 3716|       |	/* Find the Zip64 EOCD record. */
 3717|      1|	eocd64_offset = archive_le64dec(p + 8);
 3718|      1|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (3718:6): [True: 0, False: 1]
  ------------------
 3719|      0|		return 0;
 3720|      1|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (3720:6): [True: 0, False: 1]
  ------------------
 3721|      0|		return 0;
 3722|       |	/* Make sure we can read all of it. */
 3723|      1|	eocd64_size = archive_le64dec(p + 4) + 12;
 3724|      1|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (3724:6): [True: 0, False: 1]
  |  Branch (3724:26): [True: 1, False: 0]
  ------------------
 3725|      1|		return 0;
 3726|      0|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (3726:6): [True: 0, False: 0]
  ------------------
 3727|      0|		return 0;
 3728|       |
 3729|       |	/* Sanity-check the EOCD64 */
 3730|      0|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (3730:6): [True: 0, False: 0]
  ------------------
 3731|      0|		return 0;
 3732|      0|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (3732:6): [True: 0, False: 0]
  ------------------
 3733|      0|		return 0;
 3734|       |	/* CD can't be split. */
 3735|      0|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (3735:6): [True: 0, False: 0]
  ------------------
 3736|      0|		return 0;
 3737|       |
 3738|       |	/* Save the central directory offset for later use. */
 3739|      0|	zip->central_directory_offset = archive_le64dec(p + 48);
 3740|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 3741|      0|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 3742|       |
 3743|      0|	return 32;
 3744|      0|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4297|      4|{
 4298|      4|	struct zip *zip = (struct zip *)a->format->data;
 4299|      4|	struct zip_entry *rsrc;
 4300|      4|	int64_t offset;
 4301|      4|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  192|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4302|       |
 4303|       |	/*
 4304|       |	 * It should be sufficient to call archive_read_next_header() for
 4305|       |	 * a reader to determine if an entry is encrypted or not. If the
 4306|       |	 * encryption of an entry is only detectable when calling
 4307|       |	 * archive_read_data(), so be it. We'll do the same check there
 4308|       |	 * as well.
 4309|       |	 */
 4310|      4|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4310:6): [True: 2, False: 2]
  ------------------
 4311|      4|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  370|      4|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4312|      2|		zip->has_encrypted_entries = 0;
 4313|       |
 4314|      4|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  333|      4|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4315|      4|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4315:6): [True: 2, False: 2]
  ------------------
 4316|      2|		a->archive.archive_format_name = "ZIP";
 4317|       |
 4318|      4|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4318:6): [True: 2, False: 2]
  ------------------
 4319|      2|		r = slurp_central_directory(a, entry, zip);
 4320|      2|		if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4320:7): [True: 0, False: 2]
  ------------------
 4321|      0|			return r;
 4322|       |		/* Get first entry whose local header offset is lower than
 4323|       |		 * other entries in the archive file. */
 4324|      2|		zip->entry =
 4325|      2|		    (struct zip_entry *)ARCHIVE_RB_TREE_MIN(&zip->tree);
  ------------------
  |  |   49|      2|    __archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|      2|#define	ARCHIVE_RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
 4326|      2|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4326:13): [True: 2, False: 0]
  ------------------
 4327|       |		/* Get next entry in local header offset order. */
 4328|      2|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4329|      2|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|      2|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4330|      2|	}
 4331|       |
 4332|      4|	if (zip->entry == NULL)
  ------------------
  |  Branch (4332:6): [True: 2, False: 2]
  ------------------
 4333|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  191|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4334|       |
 4335|      2|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4335:6): [True: 0, False: 2]
  ------------------
 4336|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4337|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4338|      2|	else
 4339|      2|		rsrc = NULL;
 4340|       |
 4341|      2|	if (zip->cctx_valid)
  ------------------
  |  Branch (4341:6): [True: 0, False: 2]
  ------------------
 4342|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  158|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4343|      2|	if (zip->hctx_valid)
  ------------------
  |  Branch (4343:6): [True: 0, False: 2]
  ------------------
 4344|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4345|      2|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4346|      2|	__archive_read_reset_passphrase(a);
 4347|       |
 4348|       |	/* File entries are sorted by the header offset, we should mostly
 4349|       |	 * use __archive_read_consume to advance a read point to avoid
 4350|       |	 * redundant data reading.  */
 4351|      2|	offset = archive_filter_bytes(&a->archive, 0);
 4352|      2|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4352:6): [True: 0, False: 2]
  ------------------
 4353|      0|		__archive_read_consume(a,
 4354|      0|		    zip->entry->local_header_offset - offset);
 4355|      2|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4355:11): [True: 1, False: 1]
  ------------------
 4356|      1|		__archive_read_seek(a, zip->entry->local_header_offset,
 4357|      1|		    SEEK_SET);
 4358|      1|	}
 4359|      2|	zip->unconsumed = 0;
 4360|      2|	r = zip_read_local_file_header(a, entry, zip);
 4361|      2|	if (r != ARCHIVE_OK)
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4361:6): [True: 1, False: 1]
  ------------------
 4362|      1|		return r;
 4363|      1|	if (rsrc) {
  ------------------
  |  Branch (4363:6): [True: 0, False: 1]
  ------------------
 4364|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4365|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4365:7): [True: 0, False: 0]
  ------------------
 4366|      0|			ret = ret2;
 4367|      0|	}
 4368|      1|	return (ret);
 4369|      2|}
archive_read_support_format_zip.c:slurp_central_directory:
 3896|      2|{
 3897|      2|	ssize_t i;
 3898|      2|	unsigned found;
 3899|      2|	int64_t correction;
 3900|      2|	ssize_t bytes_avail;
 3901|      2|	const char *p;
 3902|       |
 3903|       |	/*
 3904|       |	 * Find the start of the central directory.  The end-of-CD
 3905|       |	 * record has our starting point, but there are lots of
 3906|       |	 * Zip archives which have had other data prepended to the
 3907|       |	 * file, which makes the recorded offsets all too small.
 3908|       |	 * So we search forward from the specified offset until we
 3909|       |	 * find the real start of the central directory.  Then we
 3910|       |	 * know the correction we need to apply to account for leading
 3911|       |	 * padding.
 3912|       |	 */
 3913|      2|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (3913:6): [True: 0, False: 2]
  ------------------
 3914|      2|		< 0)
 3915|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3916|       |
 3917|      2|	found = 0;
 3918|      4|	while (!found) {
  ------------------
  |  Branch (3918:9): [True: 2, False: 2]
  ------------------
 3919|      2|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL)
  ------------------
  |  Branch (3919:7): [True: 0, False: 2]
  ------------------
 3920|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3921|     27|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (3921:26): [True: 25, False: 2]
  |  Branch (3921:36): [True: 25, False: 0]
  ------------------
 3922|     25|			switch (p[i + 3]) {
 3923|      1|			case 'P': i += 3; break;
  ------------------
  |  Branch (3923:4): [True: 1, False: 24]
  ------------------
 3924|      0|			case 'K': i += 2; break;
  ------------------
  |  Branch (3924:4): [True: 0, False: 25]
  ------------------
 3925|      0|			case 001: i += 1; break;
  ------------------
  |  Branch (3925:4): [True: 0, False: 25]
  ------------------
 3926|      1|			case 002:
  ------------------
  |  Branch (3926:4): [True: 1, False: 24]
  ------------------
 3927|      1|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (3927:9): [True: 1, False: 0]
  ------------------
 3928|      1|					p += i;
 3929|      1|					found = 1;
 3930|      1|				} else
 3931|      0|					i += 4;
 3932|      1|				break;
 3933|      0|			case 005: i += 1; break;
  ------------------
  |  Branch (3933:4): [True: 0, False: 25]
  ------------------
 3934|      1|			case 006:
  ------------------
  |  Branch (3934:4): [True: 1, False: 24]
  ------------------
 3935|      1|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3935:9): [True: 1, False: 0]
  ------------------
 3936|      1|					p += i;
 3937|      1|					found = 1;
 3938|      1|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (3938:16): [True: 0, False: 0]
  ------------------
 3939|      0|					p += i;
 3940|      0|					found = 1;
 3941|      0|				} else
 3942|      0|					i += 1;
 3943|      1|				break;
 3944|     22|			default: i += 4; break;
  ------------------
  |  Branch (3944:4): [True: 22, False: 3]
  ------------------
 3945|     25|			}
 3946|     25|		}
 3947|      2|		__archive_read_consume(a, i);
 3948|      2|	}
 3949|      2|	correction = archive_filter_bytes(&a->archive, 0)
 3950|      2|			- zip->central_directory_offset;
 3951|       |
 3952|      2|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 3953|      2|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 3954|       |
 3955|      2|	zip->central_directory_entries_total = 0;
 3956|      4|	while (1) {
  ------------------
  |  Branch (3956:9): [Folded - Ignored]
  ------------------
 3957|      4|		struct zip_entry *zip_entry;
 3958|      4|		size_t filename_length, extra_length, comment_length;
 3959|      4|		uint32_t external_attributes;
 3960|      4|		const char *name, *r;
 3961|       |
 3962|      4|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3962:7): [True: 0, False: 4]
  ------------------
 3963|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3964|      4|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (3964:7): [True: 0, False: 4]
  ------------------
 3965|      4|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3965:10): [True: 2, False: 2]
  ------------------
 3966|      2|			break;
 3967|      2|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (3967:14): [True: 0, False: 2]
  ------------------
 3968|      0|			archive_set_error(&a->archive,
 3969|      0|			    -1, "Invalid central directory signature");
 3970|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3971|      0|		}
 3972|      2|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (3972:7): [True: 0, False: 2]
  ------------------
 3973|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3974|       |
 3975|      2|		zip_entry = calloc(1, sizeof(struct zip_entry));
 3976|      2|		if (zip_entry == NULL) {
  ------------------
  |  Branch (3976:7): [True: 0, False: 2]
  ------------------
 3977|      0|			archive_set_error(&a->archive, ENOMEM,
 3978|      0|				"Can't allocate zip entry");
 3979|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3980|      0|		}
 3981|      2|		zip_entry->next = zip->zip_entries;
 3982|      2|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  130|      2|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 3983|      2|		zip->zip_entries = zip_entry;
 3984|      2|		zip->central_directory_entries_total++;
 3985|       |
 3986|       |		/* version = p[4]; */
 3987|      2|		zip_entry->system = p[5];
 3988|       |		/* version_required = archive_le16dec(p + 6); */
 3989|      2|		zip_entry->zip_flags = archive_le16dec(p + 8);
 3990|      2|		if (zip_entry->zip_flags
  ------------------
  |  Branch (3990:7): [True: 0, False: 2]
  ------------------
 3991|      2|		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  120|      2|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  122|      2|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
 3992|      0|			zip->has_encrypted_entries = 1;
 3993|      0|		}
 3994|      2|		zip_entry->compression = (char)archive_le16dec(p + 10);
 3995|      2|		zip_entry->mtime = zip_time(p + 12);
 3996|      2|		zip_entry->crc32 = archive_le32dec(p + 16);
 3997|      2|		if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  121|      2|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3997:7): [True: 0, False: 2]
  ------------------
 3998|      0|			zip_entry->decdat = p[13];
 3999|      2|		else
 4000|      2|			zip_entry->decdat = p[19];
 4001|      2|		zip_entry->compressed_size = archive_le32dec(p + 20);
 4002|      2|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 4003|      2|		filename_length = archive_le16dec(p + 28);
 4004|      2|		extra_length = archive_le16dec(p + 30);
 4005|      2|		comment_length = archive_le16dec(p + 32);
 4006|       |		/* disk_start = archive_le16dec(p + 34);
 4007|       |		 *   Better be zero.
 4008|       |		 * internal_attributes = archive_le16dec(p + 36);
 4009|       |		 *   text bit */
 4010|      2|		external_attributes = archive_le32dec(p + 38);
 4011|      2|		zip_entry->local_header_offset =
 4012|      2|		    archive_le32dec(p + 42) + correction;
 4013|       |
 4014|       |		/* If we can't guess the mode, leave it zero here;
 4015|       |		   when we read the local file header we might get
 4016|       |		   more information. */
 4017|      2|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4017:7): [True: 0, False: 2]
  ------------------
 4018|      0|			zip_entry->mode = external_attributes >> 16;
 4019|      2|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4019:14): [True: 2, False: 0]
  ------------------
 4020|       |			// Interpret MSDOS directory bit
 4021|      2|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4021:8): [True: 2, False: 0]
  ------------------
 4022|      2|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  190|      2|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4023|      2|			} else {
 4024|      0|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  185|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4025|      0|			}
 4026|      2|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4026:8): [True: 0, False: 2]
  ------------------
 4027|       |				// Read-only bit; strip write permissions
 4028|      0|				zip_entry->mode &= 0555;
 4029|      0|			}
 4030|      2|		} else {
 4031|      0|			zip_entry->mode = 0;
 4032|      0|		}
 4033|       |
 4034|       |		/* We're done with the regular data; get the filename and
 4035|       |		 * extra data. */
 4036|      2|		__archive_read_consume(a, 46);
 4037|      2|		p = __archive_read_ahead(a, filename_length + extra_length,
 4038|      2|			NULL);
 4039|      2|		if (p == NULL) {
  ------------------
  |  Branch (4039:7): [True: 0, False: 2]
  ------------------
 4040|      0|			archive_set_error(&a->archive,
 4041|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  197|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4042|      0|			    "Truncated ZIP file header");
 4043|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4044|      0|		}
 4045|      2|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4045:7): [True: 0, False: 2]
  ------------------
 4046|      2|		    extra_length, zip_entry)) {
 4047|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  198|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4048|      0|		}
 4049|       |
 4050|       |		/*
 4051|       |		 * Mac resource fork files are stored under the
 4052|       |		 * "__MACOSX/" directory, so we should check if
 4053|       |		 * it is.
 4054|       |		 */
 4055|      2|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4055:7): [True: 2, False: 0]
  ------------------
 4056|       |			/* Treat every entry as a regular entry. */
 4057|      2|			__archive_rb_tree_insert_node(&zip->tree,
 4058|      2|			    &zip_entry->node);
 4059|      2|		} else {
 4060|      0|			name = p;
 4061|      0|			r = rsrc_basename(name, filename_length);
 4062|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4062:8): [True: 0, False: 0]
  ------------------
 4063|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4063:8): [True: 0, False: 0]
  ------------------
 4064|       |				/* If this file is not a resource fork nor
 4065|       |				 * a directory. We should treat it as a non
 4066|       |				 * resource fork file to expose it. */
 4067|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4067:9): [True: 0, False: 0]
  ------------------
 4068|      0|				    (r - name < 3 || r[0] != '.' ||
  ------------------
  |  Branch (4068:10): [True: 0, False: 0]
  |  Branch (4068:26): [True: 0, False: 0]
  ------------------
 4069|      0|				     r[1] != '_')) {
  ------------------
  |  Branch (4069:10): [True: 0, False: 0]
  ------------------
 4070|      0|					__archive_rb_tree_insert_node(
 4071|      0|					    &zip->tree, &zip_entry->node);
 4072|       |					/* Expose its parent directories. */
 4073|      0|					expose_parent_dirs(zip, name,
 4074|      0|					    filename_length);
 4075|      0|				} else {
 4076|       |					/* This file is a resource fork file or
 4077|       |					 * a directory. */
 4078|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4079|      0|					     name, filename_length);
 4080|      0|					__archive_rb_tree_insert_node(
 4081|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4082|      0|				}
 4083|      0|			} else {
 4084|       |				/* Generate resource fork name to find its
 4085|       |				 * resource file at zip->tree_rsrc. */
 4086|       |
 4087|       |				/* If this is an entry ending with slash,
 4088|       |				 * make the resource for name slash-less
 4089|       |				 * as the actual resource fork doesn't end with '/'.
 4090|       |				 */
 4091|      0|				size_t tmp_length = filename_length;
 4092|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4092:9): [True: 0, False: 0]
  |  Branch (4092:27): [True: 0, False: 0]
  ------------------
 4093|      0|					tmp_length--;
 4094|      0|					r = rsrc_basename(name, tmp_length);
 4095|      0|				}
 4096|       |
 4097|      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 - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4098|      0|				    "__MACOSX/");
 4099|      0|				archive_strncat(&(zip_entry->rsrcname),
 4100|      0|				    name, r - name);
 4101|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4102|      0|				archive_strncat(&(zip_entry->rsrcname),
 4103|      0|				    name + (r - name),
 4104|      0|				    tmp_length - (r - name));
 4105|       |				/* Register an entry to RB tree to sort it by
 4106|       |				 * file offset. */
 4107|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4108|      0|				    &zip_entry->node);
 4109|      0|			}
 4110|      0|		}
 4111|       |
 4112|       |		/* Skip the comment too ... */
 4113|      2|		__archive_read_consume(a,
 4114|      2|		    filename_length + extra_length + comment_length);
 4115|      2|	}
 4116|       |
 4117|      2|	return ARCHIVE_OK;
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4118|      2|}
archive_read_support_format_zip.c:cmp_node:
 3806|      1|{
 3807|      1|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 3808|      1|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 3809|       |
 3810|      1|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (3810:6): [True: 0, False: 1]
  ------------------
 3811|      0|		return -1;
 3812|      1|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (3812:6): [True: 1, False: 0]
  ------------------
 3813|      1|		return 1;
 3814|      0|	return 0;
 3815|      1|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4377|      2|{
 4378|      2|	struct zip *zip;
 4379|      2|	zip = (struct zip *)(a->format->data);
 4380|       |
 4381|      2|	zip->unconsumed = 0;
 4382|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  192|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4383|      2|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 3646|      4|{
 3647|      4|	(void)a; /* UNUSED */
 3648|      4|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  357|      4|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3649|      4|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  358|      4|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3650|      4|}

archive_array_append:
  228|     40|{
  229|     40|	return archive_string_append(as, p, s);
  230|     40|}
archive_string_concat:
  234|     66|{
  235|     66|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (235:6): [True: 0, False: 66]
  ------------------
  236|      0|		__archive_errx(1, "Out of memory");
  237|     66|}
archive_wstring_concat:
  242|      4|{
  243|      4|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (243:6): [True: 0, False: 4]
  ------------------
  244|      0|		__archive_errx(1, "Out of memory");
  245|      4|}
archive_string_free:
  249|  6.40M|{
  250|  6.40M|	as->length = 0;
  251|  6.40M|	as->buffer_length = 0;
  252|  6.40M|	free(as->s);
  253|  6.40M|	as->s = NULL;
  254|  6.40M|}
archive_wstring_free:
  258|  2.11M|{
  259|  2.11M|	as->length = 0;
  260|  2.11M|	as->buffer_length = 0;
  261|  2.11M|	free(as->s);
  262|  2.11M|	as->s = NULL;
  263|  2.11M|}
archive_wstring_ensure:
  267|  36.6k|{
  268|  36.6k|	return (struct archive_wstring *)
  269|  36.6k|		archive_string_ensure((struct archive_string *)as,
  270|  36.6k|					s * sizeof(wchar_t));
  271|  36.6k|}
archive_string_ensure:
  276|  12.3M|{
  277|  12.3M|	char *p;
  278|  12.3M|	size_t new_length;
  279|       |
  280|       |	/* If buffer is already big enough, don't reallocate. */
  281|  12.3M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (281:6): [True: 12.2M, False: 137k]
  |  Branch (281:15): [True: 12.2M, False: 9.94k]
  ------------------
  282|  12.2M|		return (as);
  283|       |
  284|       |	/*
  285|       |	 * Growing the buffer at least exponentially ensures that
  286|       |	 * append operations are always linear in the number of
  287|       |	 * characters appended.  Using a smaller growth rate for
  288|       |	 * larger buffers reduces memory waste somewhat at the cost of
  289|       |	 * a larger constant factor.
  290|       |	 */
  291|   147k|	if (as->buffer_length < 32)
  ------------------
  |  Branch (291:6): [True: 137k, False: 9.94k]
  ------------------
  292|       |		/* Start with a minimum 32-character buffer. */
  293|   137k|		new_length = 32;
  294|  9.94k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (294:11): [True: 9.94k, False: 4]
  ------------------
  295|       |		/* Buffers under 8k are doubled for speed. */
  296|  9.94k|		new_length = as->buffer_length + as->buffer_length;
  297|      4|	else {
  298|       |		/* Buffers 8k and over grow by at least 25% each time. */
  299|      4|		new_length = as->buffer_length + as->buffer_length / 4;
  300|       |		/* Be safe: If size wraps, fail. */
  301|      4|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (301:7): [True: 0, False: 4]
  ------------------
  302|       |			/* On failure, wipe the string and return NULL. */
  303|      0|			archive_string_free(as);
  304|      0|			errno = ENOMEM;/* Make sure errno has ENOMEM. */
  305|      0|			return (NULL);
  306|      0|		}
  307|      4|	}
  308|       |	/*
  309|       |	 * The computation above is a lower limit to how much we'll
  310|       |	 * grow the buffer.  In any case, we have to grow it enough to
  311|       |	 * hold the request.
  312|       |	 */
  313|   147k|	if (new_length < s)
  ------------------
  |  Branch (313:6): [True: 37.8k, False: 109k]
  ------------------
  314|  37.8k|		new_length = s;
  315|       |	/* Now we can reallocate the buffer. */
  316|   147k|	p = (char *)realloc(as->s, new_length);
  317|   147k|	if (p == NULL) {
  ------------------
  |  Branch (317:6): [True: 0, False: 147k]
  ------------------
  318|       |		/* On failure, wipe the string and return NULL. */
  319|      0|		archive_string_free(as);
  320|      0|		errno = ENOMEM;/* Make sure errno has ENOMEM. */
  321|      0|		return (NULL);
  322|      0|	}
  323|       |
  324|   147k|	as->s = p;
  325|   147k|	as->buffer_length = new_length;
  326|   147k|	return (as);
  327|   147k|}
archive_strncat:
  338|   204k|{
  339|   204k|	size_t s;
  340|   204k|	const char *p, *pp;
  341|       |
  342|   204k|	p = (const char *)_p;
  343|       |
  344|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  345|   204k|	s = 0;
  346|   204k|	pp = p;
  347|  3.16M|	while (s < n && *pp) {
  ------------------
  |  Branch (347:9): [True: 3.14M, False: 20.9k]
  |  Branch (347:18): [True: 2.96M, False: 183k]
  ------------------
  348|  2.96M|		pp++;
  349|  2.96M|		s++;
  350|  2.96M|	}
  351|   204k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (351:6): [True: 0, False: 204k]
  ------------------
  352|      0|		__archive_errx(1, "Out of memory");
  353|   204k|	return (as);
  354|   204k|}
archive_wstrncat:
  358|      6|{
  359|      6|	size_t s;
  360|      6|	const wchar_t *pp;
  361|       |
  362|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  363|      6|	s = 0;
  364|      6|	pp = p;
  365|     46|	while (s < n && *pp) {
  ------------------
  |  Branch (365:9): [True: 42, False: 4]
  |  Branch (365:18): [True: 40, False: 2]
  ------------------
  366|     40|		pp++;
  367|     40|		s++;
  368|     40|	}
  369|      6|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (369:6): [True: 0, False: 6]
  ------------------
  370|      0|		__archive_errx(1, "Out of memory");
  371|      6|	return (as);
  372|      6|}
archive_strcat:
  376|   183k|{
  377|       |	/* strcat is just strncat without an effective limit. 
  378|       |	 * Assert that we'll never get called with a source
  379|       |	 * string over 16MB.
  380|       |	 * TODO: Review all uses of strcat in the source
  381|       |	 * and try to replace them with strncat().
  382|       |	 */
  383|   183k|	return archive_strncat(as, p, 0x1000000);
  384|   183k|}
archive_wstrcat:
  388|      2|{
  389|       |	/* Ditto. */
  390|      2|	return archive_wstrncat(as, p, 0x1000000);
  391|      2|}
archive_strappend_char:
  395|  11.5M|{
  396|  11.5M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (396:6): [True: 0, False: 11.5M]
  ------------------
  397|      0|		__archive_errx(1, "Out of memory");
  398|  11.5M|	return (as);
  399|  11.5M|}
archive_wstrappend_wchar:
  403|      2|{
  404|      2|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (404:6): [True: 0, False: 2]
  ------------------
  405|      0|		__archive_errx(1, "Out of memory");
  406|      2|	return (as);
  407|      2|}
archive_wstring_append_from_mbs:
  591|  36.3k|{
  592|  36.3k|	size_t r;
  593|  36.3k|	int ret_val = 0;
  594|       |	/*
  595|       |	 * No single byte will be more than one wide character,
  596|       |	 * so this length estimate will always be big enough.
  597|       |	 */
  598|       |	// size_t wcs_length = len;
  599|  36.3k|	size_t mbs_length = len;
  600|  36.3k|	const char *mbs = p;
  601|  36.3k|	wchar_t *wcs;
  602|  36.3k|#if HAVE_MBRTOWC
  603|  36.3k|	mbstate_t shift_state;
  604|       |
  605|  36.3k|	memset(&shift_state, 0, sizeof(shift_state));
  606|  36.3k|#endif
  607|       |	/*
  608|       |	 * As we decided to have wcs_length == mbs_length == len
  609|       |	 * we can use len here instead of wcs_length
  610|       |	 */
  611|  36.3k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (611:6): [True: 0, False: 36.3k]
  ------------------
  612|      0|		return (-1);
  613|  36.3k|	wcs = dest->s + dest->length;
  614|       |	/*
  615|       |	 * We cannot use mbsrtowcs/mbstowcs here because those may convert
  616|       |	 * extra MBS when strlen(p) > len and one wide character consists of
  617|       |	 * multi bytes.
  618|       |	 */
  619|   255k|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (619:9): [True: 224k, False: 31.2k]
  |  Branch (619:17): [True: 224k, False: 0]
  ------------------
  620|       |		/*
  621|       |		 * The buffer we allocated is always big enough.
  622|       |		 * Keep this code path in a comment if we decide to choose
  623|       |		 * smaller wcs_length in the future
  624|       |		 */
  625|       |/*
  626|       |		if (wcs_length == 0) {
  627|       |			dest->length = wcs - dest->s;
  628|       |			dest->s[dest->length] = L'\0';
  629|       |			wcs_length = mbs_length;
  630|       |			if (NULL == archive_wstring_ensure(dest,
  631|       |			    dest->length + wcs_length + 1))
  632|       |				return (-1);
  633|       |			wcs = dest->s + dest->length;
  634|       |		}
  635|       |*/
  636|   224k|#if HAVE_MBRTOWC
  637|   224k|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  638|       |#else
  639|       |		r = mbtowc(wcs, mbs, mbs_length);
  640|       |#endif
  641|   224k|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (641:7): [True: 5.15k, False: 219k]
  |  Branch (641:26): [True: 0, False: 219k]
  ------------------
  642|  5.15k|			ret_val = -1;
  643|  5.15k|			break;
  644|  5.15k|		}
  645|   219k|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (645:7): [True: 0, False: 219k]
  |  Branch (645:17): [True: 0, False: 219k]
  ------------------
  646|      0|			break;
  647|   219k|		wcs++;
  648|       |		// wcs_length--;
  649|   219k|		mbs += r;
  650|   219k|		mbs_length -= r;
  651|   219k|	}
  652|  36.3k|	dest->length = wcs - dest->s;
  653|  36.3k|	dest->s[dest->length] = L'\0';
  654|  36.3k|	return (ret_val);
  655|  36.3k|}
archive_string_append_from_wcs:
  778|      4|{
  779|       |	/* We cannot use the standard wcstombs() here because it
  780|       |	 * cannot tell us how big the output buffer should be.  So
  781|       |	 * I've built a loop around wcrtomb() or wctomb() that
  782|       |	 * converts a character at a time and resizes the string as
  783|       |	 * needed.  We prefer wcrtomb() when it's available because
  784|       |	 * it's thread-safe. */
  785|      4|	int n, ret_val = 0;
  786|      4|	char *p;
  787|      4|	char *end;
  788|      4|#if HAVE_WCRTOMB
  789|      4|	mbstate_t shift_state;
  790|       |
  791|      4|	memset(&shift_state, 0, sizeof(shift_state));
  792|       |#else
  793|       |	/* Clear the shift state before starting. */
  794|       |	wctomb(NULL, L'\0');
  795|       |#endif
  796|       |	/*
  797|       |	 * Allocate buffer for MBS.
  798|       |	 * We need this allocation here since it is possible that
  799|       |	 * as->s is still NULL.
  800|       |	 */
  801|      4|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (801:6): [True: 0, False: 4]
  ------------------
  802|      0|		return (-1);
  803|       |
  804|      4|	p = as->s + as->length;
  805|      4|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  806|     29|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (806:9): [True: 25, False: 4]
  |  Branch (806:24): [True: 25, False: 0]
  ------------------
  807|     25|		if (p >= end) {
  ------------------
  |  Branch (807:7): [True: 0, False: 25]
  ------------------
  808|      0|			as->length = p - as->s;
  809|      0|			as->s[as->length] = '\0';
  810|       |			/* Re-allocate buffer for MBS. */
  811|      0|			if (archive_string_ensure(as,
  ------------------
  |  Branch (811:8): [True: 0, False: 0]
  ------------------
  812|      0|			    as->length + max(len * 2,
  ------------------
  |  |   78|      0|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  813|      0|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  814|      0|				return (-1);
  815|      0|			p = as->s + as->length;
  816|      0|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  817|      0|		}
  818|     25|#if HAVE_WCRTOMB
  819|     25|		n = wcrtomb(p, *w++, &shift_state);
  820|       |#else
  821|       |		n = wctomb(p, *w++);
  822|       |#endif
  823|     25|		if (n == -1) {
  ------------------
  |  Branch (823:7): [True: 0, False: 25]
  ------------------
  824|      0|			if (errno == EILSEQ) {
  ------------------
  |  Branch (824:8): [True: 0, False: 0]
  ------------------
  825|       |				/* Skip an illegal wide char. */
  826|      0|				*p++ = '?';
  827|      0|				ret_val = -1;
  828|      0|			} else {
  829|      0|				ret_val = -1;
  830|      0|				break;
  831|      0|			}
  832|      0|		} else
  833|     25|			p += n;
  834|     25|		len--;
  835|     25|	}
  836|      4|	as->length = p - as->s;
  837|      4|	as->s[as->length] = '\0';
  838|      4|	return (ret_val);
  839|      4|}
archive_string_conversion_to_charset:
 1729|  28.0k|{
 1730|  28.0k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|  28.0k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1731|       |
 1732|  28.0k|	if (best_effort)
  ------------------
  |  Branch (1732:6): [True: 28.0k, False: 0]
  ------------------
 1733|  28.0k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  28.0k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1734|  28.0k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1735|  28.0k|}
archive_string_conversion_from_charset:
 1740|  15.4k|{
 1741|  15.4k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  15.4k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1742|       |
 1743|  15.4k|	if (best_effort)
  ------------------
  |  Branch (1743:6): [True: 15.4k, False: 0]
  ------------------
 1744|  15.4k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  15.4k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1745|  15.4k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1746|  15.4k|}
archive_string_default_conversion_for_read:
 1802|    130|{
 1803|    130|	(void)a; /* UNUSED */
 1804|    130|	return (NULL);
 1805|    130|}
archive_string_conversion_free:
 1820|    238|{
 1821|    238|	struct archive_string_conv *sc; 
 1822|    238|	struct archive_string_conv *sc_next; 
 1823|       |
 1824|    281|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1824:22): [True: 43, False: 238]
  ------------------
 1825|     43|		sc_next = sc->next;
 1826|     43|		free_sconv_object(sc);
 1827|     43|	}
 1828|    238|	a->sconv = NULL;
 1829|    238|	free(a->current_code);
 1830|    238|	a->current_code = NULL;
 1831|    238|}
archive_string_conversion_charset_name:
 1838|  5.72k|{
 1839|  5.72k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  5.72k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1839:6): [True: 0, False: 5.72k]
  ------------------
 1840|      0|		return (sc->to_charset);
 1841|  5.72k|	else
 1842|  5.72k|		return (sc->from_charset);
 1843|  5.72k|}
archive_strncpy_l:
 1958|  74.3k|{
 1959|  74.3k|	as->length = 0;
 1960|  74.3k|	return (archive_strncat_l(as, _p, n, sc));
 1961|  74.3k|}
archive_strncat_l:
 1966|  74.3k|{
 1967|  74.3k|	const void *s;
 1968|  74.3k|	size_t length = 0;
 1969|  74.3k|	int i, r = 0, r2;
 1970|       |
 1971|  74.3k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (1971:6): [True: 74.3k, False: 0]
  |  Branch (1971:20): [True: 60.6k, False: 13.7k]
  ------------------
 1972|  60.6k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|  42.3k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  42.3k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  42.3k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1972:7): [True: 42.3k, False: 18.3k]
  |  Branch (1972:21): [True: 2, False: 42.3k]
  ------------------
 1973|      2|			length = utf16nbytes(_p, n);
 1974|  60.6k|		else
 1975|  60.6k|			length = mbsnbytes(_p, n);
 1976|  60.6k|	}
 1977|       |
 1978|       |	/* We must allocate memory even if there is no data for conversion
 1979|       |	 * or copy. This simulates archive_string_append behavior. */
 1980|  74.3k|	if (length == 0) {
  ------------------
  |  Branch (1980:6): [True: 16.2k, False: 58.1k]
  ------------------
 1981|  16.2k|		int tn = 1;
 1982|  16.2k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  13.4k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  13.4k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  13.4k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1982:7): [True: 13.4k, False: 2.79k]
  |  Branch (1982:21): [True: 0, False: 13.4k]
  ------------------
 1983|      0|			tn = 2;
 1984|  16.2k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (1984:7): [True: 0, False: 16.2k]
  ------------------
 1985|      0|			return (-1);
 1986|  16.2k|		as->s[as->length] = 0;
 1987|  16.2k|		if (tn == 2)
  ------------------
  |  Branch (1987:7): [True: 0, False: 16.2k]
  ------------------
 1988|      0|			as->s[as->length+1] = 0;
 1989|  16.2k|		return (0);
 1990|  16.2k|	}
 1991|       |
 1992|       |	/*
 1993|       |	 * If sc is NULL, we just make a copy.
 1994|       |	 */
 1995|  58.1k|	if (sc == NULL) {
  ------------------
  |  Branch (1995:6): [True: 16.1k, False: 42.0k]
  ------------------
 1996|  16.1k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (1996:7): [True: 0, False: 16.1k]
  ------------------
 1997|      0|			return (-1);/* No memory */
 1998|  16.1k|		return (0);
 1999|  16.1k|	}
 2000|       |
 2001|  42.0k|	s = _p;
 2002|  42.0k|	i = 0;
 2003|  42.0k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2003:6): [True: 20.4k, False: 21.6k]
  ------------------
 2004|  20.4k|		sc->utftmp.length = 0;
 2005|  20.4k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2006|  20.4k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2006:7): [True: 15.8k, False: 4.53k]
  |  Branch (2006:18): [True: 0, False: 15.8k]
  ------------------
 2007|      0|			return (r2);
 2008|  20.4k|		if (r > r2)
  ------------------
  |  Branch (2008:7): [True: 15.8k, False: 4.53k]
  ------------------
 2009|  15.8k|			r = r2;
 2010|  20.4k|		s = sc->utftmp.s;
 2011|  20.4k|		length = sc->utftmp.length;
 2012|  20.4k|		++i;
 2013|  20.4k|	}
 2014|  42.0k|	r2 = sc->converter[i](as, s, length, sc);
 2015|  42.0k|	if (r > r2)
  ------------------
  |  Branch (2015:6): [True: 2.05k, False: 40.0k]
  ------------------
 2016|  2.05k|		r = r2;
 2017|  42.0k|	return (r);
 2018|  42.0k|}
archive_mstring_clean:
 3846|  2.11M|{
 3847|  2.11M|	archive_wstring_free(&(aes->aes_wcs));
 3848|  2.11M|	archive_string_free(&(aes->aes_mbs));
 3849|  2.11M|	archive_string_free(&(aes->aes_utf8));
 3850|  2.11M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3851|  2.11M|	aes->aes_set = 0;
 3852|  2.11M|}
archive_mstring_get_utf8:
 3866|  44.1k|{
 3867|  44.1k|	struct archive_string_conv *sc;
 3868|  44.1k|	int r;
 3869|       |
 3870|       |	/* If we already have a UTF8 form, return that immediately. */
 3871|  44.1k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  217|  44.1k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3871:6): [True: 10.3k, False: 33.8k]
  ------------------
 3872|  10.3k|		*p = aes->aes_utf8.s;
 3873|  10.3k|		return (0);
 3874|  10.3k|	}
 3875|       |
 3876|  33.8k|	*p = NULL;
 3877|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3878|       |	/*
 3879|       |	 * On Windows, first try converting from WCS because (1) there's no
 3880|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 3881|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 3882|       |	 * convert back to WCS again before finally converting to UTF-8
 3883|       |	 */
 3884|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 3885|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3886|       |		if (sc == NULL)
 3887|       |			return (-1);/* Couldn't allocate memory for sc. */
 3888|       |		archive_string_empty(&(aes->aes_utf8));
 3889|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 3890|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 3891|       |		if (a == NULL)
 3892|       |			free_sconv_object(sc);
 3893|       |		if (r == 0) {
 3894|       |			aes->aes_set |= AES_SET_UTF8;
 3895|       |			*p = aes->aes_utf8.s;
 3896|       |			return (0);/* success. */
 3897|       |		} else
 3898|       |			return (-1);/* failure. */
 3899|       |	}
 3900|       |#endif
 3901|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 3902|  33.8k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  216|  33.8k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3902:6): [True: 5.72k, False: 28.0k]
  ------------------
 3903|  5.72k|		const char *pm; /* unused */
 3904|  5.72k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3905|  5.72k|	}
 3906|  33.8k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  216|  33.8k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3906:6): [True: 28.0k, False: 5.72k]
  ------------------
 3907|  28.0k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3908|  28.0k|		if (sc == NULL)
  ------------------
  |  Branch (3908:7): [True: 0, False: 28.0k]
  ------------------
 3909|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3910|  28.0k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3911|  28.0k|		    aes->aes_mbs.length, sc);
 3912|  28.0k|		if (a == NULL)
  ------------------
  |  Branch (3912:7): [True: 28.0k, False: 0]
  ------------------
 3913|  28.0k|			free_sconv_object(sc);
 3914|  28.0k|		if (r == 0) {
  ------------------
  |  Branch (3914:7): [True: 26.0k, False: 2.05k]
  ------------------
 3915|  26.0k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  217|  26.0k|#define	AES_SET_UTF8 2
  ------------------
 3916|  26.0k|			*p = aes->aes_utf8.s;
 3917|  26.0k|			return (0);/* success. */
 3918|  26.0k|		} else
 3919|  2.05k|			return (-1);/* failure. */
 3920|  28.0k|	}
 3921|  5.72k|	return (0);/* success. */
 3922|  33.8k|}
archive_mstring_get_mbs:
 3927|  70.6k|{
 3928|  70.6k|	struct archive_string_conv *sc;
 3929|  70.6k|	int r, ret = 0;
 3930|       |
 3931|       |	/* If we already have an MBS form, return that immediately. */
 3932|  70.6k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  216|  70.6k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3932:6): [True: 33.0k, False: 37.5k]
  ------------------
 3933|  33.0k|		*p = aes->aes_mbs.s;
 3934|  33.0k|		return (ret);
 3935|  33.0k|	}
 3936|       |
 3937|  37.5k|	*p = NULL;
 3938|       |	/* If there's a WCS form, try converting with the native locale. */
 3939|  37.5k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  218|  37.5k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (3939:6): [True: 4, False: 37.5k]
  ------------------
 3940|      4|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 3941|      4|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 3942|      4|		    aes->aes_wcs.s, aes->aes_wcs.length);
 3943|      4|		*p = aes->aes_mbs.s;
 3944|      4|		if (r == 0) {
  ------------------
  |  Branch (3944:7): [True: 4, False: 0]
  ------------------
 3945|      4|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  216|      4|#define	AES_SET_MBS 1
  ------------------
 3946|      4|			return (ret);
 3947|      4|		} else
 3948|      0|			ret = -1;
 3949|      4|	}
 3950|       |
 3951|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 3952|  37.5k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  217|  37.5k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3952:6): [True: 3.69k, False: 33.8k]
  ------------------
 3953|  3.69k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  3.69k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 3954|  3.69k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 3955|  3.69k|		if (sc == NULL)
  ------------------
  |  Branch (3955:7): [True: 0, False: 3.69k]
  ------------------
 3956|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3957|  3.69k|		r = archive_strncpy_l(&(aes->aes_mbs),
 3958|  3.69k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 3959|  3.69k|		if (a == NULL)
  ------------------
  |  Branch (3959:7): [True: 3.69k, False: 0]
  ------------------
 3960|  3.69k|			free_sconv_object(sc);
 3961|  3.69k|		*p = aes->aes_mbs.s;
 3962|  3.69k|		if (r == 0) {
  ------------------
  |  Branch (3962:7): [True: 0, False: 3.69k]
  ------------------
 3963|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  216|      0|#define	AES_SET_MBS 1
  ------------------
 3964|      0|			ret = 0;/* success; overwrite previous error. */
 3965|      0|		} else
 3966|  3.69k|			ret = -1;/* failure. */
 3967|  3.69k|	}
 3968|  37.5k|	return (ret);
 3969|  37.5k|}
archive_mstring_get_wcs:
 3974|  87.3k|{
 3975|  87.3k|	int r, ret = 0;
 3976|       |
 3977|  87.3k|	(void)a;/* UNUSED */
 3978|       |	/* Return WCS form if we already have it. */
 3979|  87.3k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  218|  87.3k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (3979:6): [True: 37.6k, False: 49.6k]
  ------------------
 3980|  37.6k|		*wp = aes->aes_wcs.s;
 3981|  37.6k|		return (ret);
 3982|  37.6k|	}
 3983|       |
 3984|  49.6k|	*wp = NULL;
 3985|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3986|       |	/*
 3987|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 3988|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 3989|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 3990|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 3991|       |	 * away that intermediate result
 3992|       |	 */
 3993|       |	if (aes->aes_set & AES_SET_UTF8) {
 3994|       |		struct archive_string_conv *sc;
 3995|       |
 3996|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 3997|       |		if (sc != NULL) {
 3998|       |			archive_wstring_empty((&aes->aes_wcs));
 3999|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4000|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4001|       |			if (a == NULL)
 4002|       |				free_sconv_object(sc);
 4003|       |			if (r == 0) {
 4004|       |				aes->aes_set |= AES_SET_WCS;
 4005|       |				*wp = aes->aes_wcs.s;
 4006|       |				return (0);
 4007|       |			}
 4008|       |		}
 4009|       |	}
 4010|       |#endif
 4011|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4012|  49.6k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  216|  49.6k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4012:6): [True: 18.5k, False: 31.1k]
  ------------------
 4013|  18.5k|		const char *p; /* unused */
 4014|  18.5k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4015|  18.5k|	}
 4016|       |	/* Try converting MBS to WCS using native locale. */
 4017|  49.6k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  216|  49.6k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4017:6): [True: 31.1k, False: 18.5k]
  ------------------
 4018|  31.1k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  31.1k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4019|  31.1k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4020|  31.1k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4021|  31.1k|		if (r == 0) {
  ------------------
  |  Branch (4021:7): [True: 26.0k, False: 5.15k]
  ------------------
 4022|  26.0k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  218|  26.0k|#define	AES_SET_WCS 4
  ------------------
 4023|  26.0k|			*wp = aes->aes_wcs.s;
 4024|  26.0k|		} else
 4025|  5.15k|			ret = -1;/* failure. */
 4026|  31.1k|	}
 4027|  49.6k|	return (ret);
 4028|  87.3k|}
archive_mstring_copy_mbs:
 4091|  3.75k|{
 4092|  3.75k|	if (mbs == NULL) {
  ------------------
  |  Branch (4092:6): [True: 2, False: 3.75k]
  ------------------
 4093|      2|		aes->aes_set = 0;
 4094|      2|		return (0);
 4095|      2|	}
 4096|  3.75k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4097|  3.75k|}
archive_mstring_copy_mbs_len:
 4102|  9.01k|{
 4103|  9.01k|	if (mbs == NULL) {
  ------------------
  |  Branch (4103:6): [True: 0, False: 9.01k]
  ------------------
 4104|      0|		aes->aes_set = 0;
 4105|      0|		return (0);
 4106|      0|	}
 4107|  9.01k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  216|  9.01k|#define	AES_SET_MBS 1
  ------------------
 4108|  9.01k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  9.01k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4109|  9.01k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  9.01k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4110|  9.01k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  9.01k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4111|  9.01k|	return (0);
 4112|  9.01k|}
archive_mstring_copy_wcs:
 4116|      4|{
 4117|      4|	return archive_mstring_copy_wcs_len(aes, wcs,
 4118|      4|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4118:5): [True: 0, False: 4]
  ------------------
 4119|      4|}
archive_mstring_copy_wcs_len:
 4138|      4|{
 4139|      4|	if (wcs == NULL) {
  ------------------
  |  Branch (4139:6): [True: 0, False: 4]
  ------------------
 4140|      0|		aes->aes_set = 0;
 4141|      0|		return (0);
 4142|      0|	}
 4143|      4|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  218|      4|#define	AES_SET_WCS 4
  ------------------
 4144|      4|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4145|      4|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4146|      4|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|      4|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4147|      4|	return (0);
 4148|      4|}
archive_mstring_copy_mbs_len_l:
 4153|  30.9k|{
 4154|  30.9k|	int r;
 4155|       |
 4156|  30.9k|	if (mbs == NULL) {
  ------------------
  |  Branch (4156:6): [True: 4, False: 30.9k]
  ------------------
 4157|      4|		aes->aes_set = 0;
 4158|      4|		return (0);
 4159|      4|	}
 4160|  30.9k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  30.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4161|  30.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  30.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4162|  30.9k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  30.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4163|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4164|       |	/*
 4165|       |	 * Internationalization programming on Windows must use Wide
 4166|       |	 * characters because Windows platform cannot make locale UTF-8.
 4167|       |	 */
 4168|       |	if (sc == NULL) {
 4169|       |		if (archive_string_append(&(aes->aes_mbs),
 4170|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4171|       |			aes->aes_set = 0;
 4172|       |			r = -1;
 4173|       |		} else {
 4174|       |			aes->aes_set = AES_SET_MBS;
 4175|       |			r = 0;
 4176|       |		}
 4177|       |#if defined(HAVE_ICONV)
 4178|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4179|       |		/*
 4180|       |		 * This case happens only when MultiByteToWideChar() cannot
 4181|       |		 * handle sc->from_cp, and we have to iconv in order to
 4182|       |		 * translate character-set to wchar_t,UTF-16.
 4183|       |		 */
 4184|       |		iconv_t cd = sc->cd;
 4185|       |		unsigned from_cp;
 4186|       |		int flag;
 4187|       |
 4188|       |		/*
 4189|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4190|       |		 */ 
 4191|       |		sc->cd = sc->cd_w;
 4192|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4193|       |		sc->cd = cd;
 4194|       |		if (r != 0) {
 4195|       |			aes->aes_set = 0;
 4196|       |			return (r);
 4197|       |		}
 4198|       |		aes->aes_set = AES_SET_UTF8;
 4199|       |
 4200|       |		/*
 4201|       |		 * Append the UTF-8 string into wstring.
 4202|       |		 */ 
 4203|       |		flag = sc->flag;
 4204|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4205|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4206|       |		from_cp = sc->from_cp;
 4207|       |		sc->from_cp = CP_UTF8;
 4208|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4209|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4210|       |		sc->flag = flag;
 4211|       |		sc->from_cp = from_cp;
 4212|       |		if (r == 0)
 4213|       |			aes->aes_set |= AES_SET_WCS;
 4214|       |#endif
 4215|       |	} else {
 4216|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4217|       |		    &(aes->aes_wcs), mbs, len, sc);
 4218|       |		if (r == 0)
 4219|       |			aes->aes_set = AES_SET_WCS;
 4220|       |		else
 4221|       |			aes->aes_set = 0;
 4222|       |	}
 4223|       |#else
 4224|  30.9k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4225|  30.9k|	if (r == 0)
  ------------------
  |  Branch (4225:6): [True: 25.2k, False: 5.72k]
  ------------------
 4226|  25.2k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  216|  25.2k|#define	AES_SET_MBS 1
  ------------------
 4227|  5.72k|	else
 4228|  5.72k|		aes->aes_set = 0;
 4229|  30.9k|#endif
 4230|  30.9k|	return (r);
 4231|  30.9k|}
archive_mstring_update_utf8:
 4246|  11.6k|{
 4247|  11.6k|	struct archive_string_conv *sc;
 4248|  11.6k|	int r;
 4249|       |
 4250|  11.6k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4250:6): [True: 0, False: 11.6k]
  ------------------
 4251|      0|		aes->aes_set = 0;
 4252|      0|		return (0); /* Succeeded in clearing everything. */
 4253|      0|	}
 4254|       |
 4255|       |	/* Save the UTF8 string. */
 4256|  11.6k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  11.6k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  23.3k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 11.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4257|       |
 4258|       |	/* Empty the mbs and wcs strings. */
 4259|  11.6k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  11.6k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4260|  11.6k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  11.6k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4261|       |
 4262|  11.6k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  217|  11.6k|#define	AES_SET_UTF8 2
  ------------------
 4263|       |
 4264|  11.6k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4265|  11.6k|	if (sc == NULL)
  ------------------
  |  Branch (4265:6): [True: 0, False: 11.6k]
  ------------------
 4266|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4267|       |
 4268|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4269|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4270|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4271|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4272|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4273|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4274|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4275|       |
 4276|       |	if (a == NULL)
 4277|       |		free_sconv_object(sc);
 4278|       |	if (r != 0)
 4279|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4280|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4281|       |
 4282|       |	/* Try converting WCS to MBS, return false on failure. */
 4283|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4284|       |	    aes->aes_wcs.length))
 4285|       |		return (-1);
 4286|       |#else
 4287|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4288|  11.6k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  11.6k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 11.6k]
  |  |  ------------------
  ------------------
 4289|       |
 4290|  11.6k|	if (a == NULL)
  ------------------
  |  Branch (4290:6): [True: 11.6k, False: 0]
  ------------------
 4291|  11.6k|		free_sconv_object(sc);
 4292|  11.6k|	if (r != 0)
  ------------------
  |  Branch (4292:6): [True: 6.48k, False: 5.21k]
  ------------------
 4293|  6.48k|		return (-1);
 4294|  5.21k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  217|  5.21k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  216|  5.21k|#define	AES_SET_MBS 1
  ------------------
 4295|       |
 4296|       |	/* Try converting MBS to WCS, return false on failure. */
 4297|  5.21k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4297:6): [True: 0, False: 5.21k]
  ------------------
 4298|  5.21k|	    aes->aes_mbs.length))
 4299|      0|		return (-1);
 4300|  5.21k|#endif
 4301|       |
 4302|       |	/* All conversions succeeded. */
 4303|  5.21k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  217|  5.21k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  218|  5.21k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  216|  5.21k|#define	AES_SET_MBS 1
  ------------------
 4304|       |
 4305|  5.21k|	return (0);
 4306|  5.21k|}
archive_string.c:archive_string_append:
  204|  11.7M|{
  205|  11.7M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (205:6): [True: 0, False: 11.7M]
  ------------------
  206|      0|		return (NULL);
  207|  11.7M|	if (s)
  ------------------
  |  Branch (207:6): [True: 11.7M, False: 4.32k]
  ------------------
  208|  11.7M|		memmove(as->s + as->length, p, s);
  209|  11.7M|	as->length += s;
  210|  11.7M|	as->s[as->length] = 0;
  211|  11.7M|	return (as);
  212|  11.7M|}
archive_string.c:archive_wstring_append:
  216|     12|{
  217|     12|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (217:6): [True: 0, False: 12]
  ------------------
  218|      0|		return (NULL);
  219|     12|	if (s)
  ------------------
  |  Branch (219:6): [True: 10, False: 2]
  ------------------
  220|     10|		wmemmove(as->s + as->length, p, s);
  221|     12|	as->length += s;
  222|     12|	as->s[as->length] = 0;
  223|     12|	return (as);
  224|     12|}
archive_string.c:get_sconv_object:
 1647|  43.5k|{
 1648|  43.5k|	struct archive_string_conv *sc;
 1649|  43.5k|	unsigned current_codepage;
 1650|       |
 1651|       |	/* Check if we have made the sconv object. */
 1652|  43.5k|	sc = find_sconv_object(a, fc, tc);
 1653|  43.5k|	if (sc != NULL)
  ------------------
  |  Branch (1653:6): [True: 37, False: 43.5k]
  ------------------
 1654|     37|		return (sc);
 1655|       |
 1656|  43.5k|	if (a == NULL)
  ------------------
  |  Branch (1656:6): [True: 43.4k, False: 43]
  ------------------
 1657|  43.4k|		current_codepage = get_current_codepage();
 1658|     43|	else
 1659|     43|		current_codepage = a->current_codepage;
 1660|       |
 1661|  43.5k|	sc = create_sconv_object(canonical_charset_name(fc),
 1662|  43.5k|	    canonical_charset_name(tc), current_codepage, flag);
 1663|  43.5k|	if (sc == NULL) {
  ------------------
  |  Branch (1663:6): [True: 0, False: 43.5k]
  ------------------
 1664|      0|		if (a != NULL)
  ------------------
  |  Branch (1664:7): [True: 0, False: 0]
  ------------------
 1665|      0|			archive_set_error(a, ENOMEM,
 1666|      0|			    "Could not allocate memory for "
 1667|      0|			    "a string conversion object");
 1668|      0|		return (NULL);
 1669|      0|	}
 1670|       |
 1671|       |	/*
 1672|       |	 * If there is no converter for current string conversion object,
 1673|       |	 * we cannot handle this conversion.
 1674|       |	 */
 1675|  43.5k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1675:6): [True: 0, False: 43.5k]
  ------------------
 1676|      0|		if (a != NULL) {
  ------------------
  |  Branch (1676:7): [True: 0, False: 0]
  ------------------
 1677|      0|#if HAVE_ICONV
 1678|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  209|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1679|      0|			    "iconv_open failed : Cannot handle ``%s''",
 1680|      0|			    (flag & SCONV_TO_CHARSET)?tc:fc);
  ------------------
  |  |   89|      0|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1680:8): [True: 0, False: 0]
  ------------------
 1681|       |#else
 1682|       |			archive_set_error(a, ARCHIVE_ERRNO_MISC,
 1683|       |			    "A character-set conversion not fully supported "
 1684|       |			    "on this platform");
 1685|       |#endif
 1686|      0|		}
 1687|       |		/* Failed; free a sconv object. */
 1688|      0|		free_sconv_object(sc);
 1689|      0|		return (NULL);
 1690|      0|	}
 1691|       |
 1692|       |	/*
 1693|       |	 * Success!
 1694|       |	 */
 1695|  43.5k|	if (a != NULL)
  ------------------
  |  Branch (1695:6): [True: 43, False: 43.4k]
  ------------------
 1696|     43|		add_sconv_object(a, sc);
 1697|  43.5k|	return (sc);
 1698|  43.5k|}
archive_string.c:find_sconv_object:
  869|  43.5k|{
  870|  43.5k|	struct archive_string_conv *sc; 
  871|       |
  872|  43.5k|	if (a == NULL)
  ------------------
  |  Branch (872:6): [True: 43.4k, False: 80]
  ------------------
  873|  43.4k|		return (NULL);
  874|       |
  875|     80|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (875:22): [True: 37, False: 43]
  ------------------
  876|     37|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (876:7): [True: 37, False: 0]
  ------------------
  877|     37|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (877:7): [True: 37, False: 0]
  ------------------
  878|     37|			break;
  879|     37|	}
  880|     80|	return (sc);
  881|  43.5k|}
archive_string.c:get_current_codepage:
 1625|  43.5k|{
 1626|  43.5k|	return (-1);/* Unknown */
 1627|  43.5k|}
archive_string.c:create_sconv_object:
 1130|  43.5k|{
 1131|  43.5k|	struct archive_string_conv *sc; 
 1132|       |
 1133|  43.5k|	sc = calloc(1, sizeof(*sc));
 1134|  43.5k|	if (sc == NULL)
  ------------------
  |  Branch (1134:6): [True: 0, False: 43.5k]
  ------------------
 1135|      0|		return (NULL);
 1136|  43.5k|	sc->next = NULL;
 1137|  43.5k|	sc->from_charset = strdup(fc);
 1138|  43.5k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1138:6): [True: 0, False: 43.5k]
  ------------------
 1139|      0|		free(sc);
 1140|      0|		return (NULL);
 1141|      0|	}
 1142|  43.5k|	sc->to_charset = strdup(tc);
 1143|  43.5k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1143:6): [True: 0, False: 43.5k]
  ------------------
 1144|      0|		free(sc->from_charset);
 1145|      0|		free(sc);
 1146|      0|		return (NULL);
 1147|      0|	}
 1148|  43.5k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|  43.5k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1149|       |
 1150|  43.5k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|  43.5k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1150:6): [True: 28.0k, False: 15.4k]
  ------------------
 1151|       |		/*
 1152|       |		 * Convert characters from the current locale charset to
 1153|       |		 * a specified charset.
 1154|       |		 */
 1155|  28.0k|		sc->from_cp = current_codepage;
 1156|  28.0k|		sc->to_cp = make_codepage_from_charset(tc);
 1157|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1158|       |		if (IsValidCodePage(sc->to_cp))
 1159|       |			flag |= SCONV_WIN_CP;
 1160|       |#endif
 1161|  28.0k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  15.4k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1161:13): [True: 15.4k, False: 0]
  ------------------
 1162|       |		/*
 1163|       |		 * Convert characters from a specified charset to
 1164|       |		 * the current locale charset.
 1165|       |		 */
 1166|  15.4k|		sc->to_cp = current_codepage;
 1167|  15.4k|		sc->from_cp = make_codepage_from_charset(fc);
 1168|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1169|       |		if (IsValidCodePage(sc->from_cp))
 1170|       |			flag |= SCONV_WIN_CP;
 1171|       |#endif
 1172|  15.4k|	}
 1173|       |
 1174|       |	/*
 1175|       |	 * Check if "from charset" and "to charset" are the same.
 1176|       |	 */
 1177|  43.5k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1177:6): [True: 0, False: 43.5k]
  ------------------
 1178|  43.5k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1178:7): [True: 0, False: 43.5k]
  |  Branch (1178:38): [True: 0, False: 0]
  ------------------
 1179|      0|		sc->same = 1;
 1180|  43.5k|	else
 1181|  43.5k|		sc->same = 0;
 1182|       |
 1183|       |	/*
 1184|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1185|       |	 */
 1186|  43.5k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1186:6): [True: 28.0k, False: 15.4k]
  ------------------
 1187|  28.0k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|  28.0k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1188|  15.4k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1188:11): [True: 0, False: 15.4k]
  ------------------
 1189|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1190|  15.4k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1190:11): [True: 0, False: 15.4k]
  ------------------
 1191|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1192|  43.5k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1192:6): [True: 15.4k, False: 28.0k]
  ------------------
 1193|  15.4k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  15.4k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1194|  28.0k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1194:11): [True: 2, False: 28.0k]
  ------------------
 1195|      2|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|      2|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1196|  28.0k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1196:11): [True: 5, False: 28.0k]
  ------------------
 1197|      5|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|      5|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1198|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1199|       |	if (sc->to_cp == CP_UTF8)
 1200|       |		flag |= SCONV_TO_UTF8;
 1201|       |	else if (sc->to_cp == CP_UTF16BE)
 1202|       |		flag |= SCONV_TO_UTF16BE | SCONV_WIN_CP;
 1203|       |	else if (sc->to_cp == CP_UTF16LE)
 1204|       |		flag |= SCONV_TO_UTF16LE | SCONV_WIN_CP;
 1205|       |	if (sc->from_cp == CP_UTF8)
 1206|       |		flag |= SCONV_FROM_UTF8;
 1207|       |	else if (sc->from_cp == CP_UTF16BE)
 1208|       |		flag |= SCONV_FROM_UTF16BE | SCONV_WIN_CP;
 1209|       |	else if (sc->from_cp == CP_UTF16LE)
 1210|       |		flag |= SCONV_FROM_UTF16LE | SCONV_WIN_CP;
 1211|       |#endif
 1212|       |
 1213|       |	/*
 1214|       |	 * Set a flag for Unicode NFD. Usually iconv cannot correctly
 1215|       |	 * handle it. So we have to translate NFD characters to NFC ones
 1216|       |	 * ourselves before iconv handles. Another reason is to prevent
 1217|       |	 * that the same sight of two filenames, one is NFC and other
 1218|       |	 * is NFD, would be in its directory.
 1219|       |	 * On Mac OS X, although its filesystem layer automatically
 1220|       |	 * convert filenames to NFD, it would be useful for filename
 1221|       |	 * comparing to find out the same filenames that we normalize
 1222|       |	 * that to be NFD ourselves.
 1223|       |	 */
 1224|  43.5k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  43.5k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1224:6): [True: 15.4k, False: 28.0k]
  ------------------
 1225|  43.5k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  15.4k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  15.4k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  15.4k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1225:6): [True: 15.4k, False: 0]
  ------------------
 1226|       |#if defined(__APPLE__)
 1227|       |		if (flag & SCONV_TO_UTF8)
 1228|       |			flag |= SCONV_NORMALIZATION_D;
 1229|       |		else
 1230|       |#endif
 1231|  15.4k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  15.4k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1232|  15.4k|	}
 1233|       |#if defined(__APPLE__)
 1234|       |	/*
 1235|       |	 * In case writing an archive file, make sure that a filename
 1236|       |	 * going to be passed to iconv is a Unicode NFC string since
 1237|       |	 * a filename in HFS Plus filesystem is a Unicode NFD one and
 1238|       |	 * iconv cannot handle it with "UTF-8" charset. It is simpler
 1239|       |	 * than a use of "UTF-8-MAC" charset.
 1240|       |	 */
 1241|       |	if ((flag & SCONV_TO_CHARSET) &&
 1242|       |	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1243|       |	    !(flag & (SCONV_TO_UTF16 | SCONV_TO_UTF8)))
 1244|       |		flag |= SCONV_NORMALIZATION_C;
 1245|       |	/*
 1246|       |	 * In case reading an archive file. make sure that a filename
 1247|       |	 * will be passed to users is a Unicode NFD string in order to
 1248|       |	 * correctly compare the filename with other one which comes
 1249|       |	 * from HFS Plus filesystem.
 1250|       |	 */
 1251|       |	if ((flag & SCONV_FROM_CHARSET) &&
 1252|       |	   !(flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1253|       |	    (flag & SCONV_TO_UTF8))
 1254|       |		flag |= SCONV_NORMALIZATION_D;
 1255|       |#endif
 1256|       |
 1257|  43.5k|#if defined(HAVE_ICONV)
 1258|  43.5k|	sc->cd_w = (iconv_t)-1;
 1259|       |	/*
 1260|       |	 * Create an iconv object.
 1261|       |	 */
 1262|  43.5k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|  43.5k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|  43.5k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  43.5k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  43.5k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1262:7): [True: 28.0k, False: 15.4k]
  ------------------
 1263|  43.5k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|  28.0k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|  28.0k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  28.0k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  28.0k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1263:6): [True: 0, False: 28.0k]
  ------------------
 1264|  43.5k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|  43.5k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1264:6): [True: 0, False: 43.5k]
  ------------------
 1265|       |		/* This case we won't use iconv. */
 1266|      0|		sc->cd = (iconv_t)-1;
 1267|  43.5k|	} else {
 1268|  43.5k|		sc->cd = iconv_open(tc, fc);
 1269|  43.5k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1269:7): [True: 0, False: 43.5k]
  |  Branch (1269:32): [True: 0, False: 0]
  ------------------
 1270|       |			/*
 1271|       |			 * Unfortunately, all of iconv implements do support
 1272|       |			 * "CP932" character-set, so we should use "SJIS"
 1273|       |			 * instead if iconv_open failed.
 1274|       |			 */
 1275|      0|			if (strcmp(tc, "CP932") == 0)
  ------------------
  |  Branch (1275:8): [True: 0, False: 0]
  ------------------
 1276|      0|				sc->cd = iconv_open("SJIS", fc);
 1277|      0|			else if (strcmp(fc, "CP932") == 0)
  ------------------
  |  Branch (1277:13): [True: 0, False: 0]
  ------------------
 1278|      0|				sc->cd = iconv_open(tc, "SJIS");
 1279|      0|		}
 1280|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1281|       |		/*
 1282|       |		 * archive_mstring on Windows directly convert multi-bytes
 1283|       |		 * into archive_wstring in order not to depend on locale
 1284|       |		 * so that you can do a I18N programming. This will be
 1285|       |		 * used only in archive_mstring_copy_mbs_len_l so far.
 1286|       |		 */
 1287|       |		if (flag & SCONV_FROM_CHARSET) {
 1288|       |			sc->cd_w = iconv_open("UTF-8", fc);
 1289|       |			if (sc->cd_w == (iconv_t)-1 &&
 1290|       |			    (sc->flag & SCONV_BEST_EFFORT)) {
 1291|       |				if (strcmp(fc, "CP932") == 0)
 1292|       |					sc->cd_w = iconv_open("UTF-8", "SJIS");
 1293|       |			}
 1294|       |		}
 1295|       |#endif /* _WIN32 && !__CYGWIN__ */
 1296|  43.5k|	}
 1297|  43.5k|#endif	/* HAVE_ICONV */
 1298|       |
 1299|  43.5k|	sc->flag = flag;
 1300|       |
 1301|       |	/*
 1302|       |	 * Set up converters.
 1303|       |	 */
 1304|  43.5k|	setup_converter(sc);
 1305|       |
 1306|  43.5k|	return (sc);
 1307|  43.5k|}
archive_string.c:make_codepage_from_charset:
 1630|  43.5k|{
 1631|  43.5k|	(void)charset; /* UNUSED */
 1632|  43.5k|	return (-1);/* Unknown */
 1633|  43.5k|}
archive_string.c:canonical_charset_name:
 1090|  87.0k|{
 1091|  87.0k|	char cs[16];
 1092|  87.0k|	char *p;
 1093|  87.0k|	const char *s;
 1094|       |
 1095|  87.0k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1095:6): [True: 0, False: 87.0k]
  |  Branch (1095:25): [True: 0, False: 87.0k]
  ------------------
 1096|  87.0k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1096:9): [True: 0, False: 87.0k]
  ------------------
 1097|      0|		return (charset);
 1098|       |
 1099|       |	/* Copy name to uppercase. */
 1100|  87.0k|	p = cs;
 1101|  87.0k|	s = charset;
 1102|   913k|	while (*s) {
  ------------------
  |  Branch (1102:9): [True: 826k, False: 87.0k]
  ------------------
 1103|   826k|		char c = *s++;
 1104|   826k|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1104:7): [True: 0, False: 826k]
  |  Branch (1104:19): [True: 0, False: 0]
  ------------------
 1105|      0|			c -= 'a' - 'A';
 1106|   826k|		*p++ = c;
 1107|   826k|	}
 1108|  87.0k|	*p++ = '\0';
 1109|       |
 1110|  87.0k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1110:6): [True: 43.5k, False: 43.5k]
  ------------------
 1111|  87.0k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1111:6): [True: 0, False: 43.5k]
  ------------------
 1112|  43.5k|		return ("UTF-8");
 1113|  43.5k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1113:6): [True: 2, False: 43.5k]
  ------------------
 1114|  43.5k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1114:6): [True: 0, False: 43.5k]
  ------------------
 1115|      2|		return ("UTF-16BE");
 1116|  43.5k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1116:6): [True: 5, False: 43.5k]
  ------------------
 1117|  43.5k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1117:6): [True: 0, False: 43.5k]
  ------------------
 1118|      5|		return ("UTF-16LE");
 1119|  43.5k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1119:6): [True: 0, False: 43.5k]
  ------------------
 1120|      0|		return ("CP932");
 1121|  43.5k|	return (charset);
 1122|  43.5k|}
archive_string.c:add_sconv_object:
  888|     43|{
  889|     43|	struct archive_string_conv **psc; 
  890|       |
  891|       |	/* Add a new sconv to sconv list. */
  892|     43|	psc = &(a->sconv);
  893|     43|	while (*psc != NULL)
  ------------------
  |  Branch (893:9): [True: 0, False: 43]
  ------------------
  894|      0|		psc = &((*psc)->next);
  895|     43|	*psc = sc;
  896|     43|}
archive_string.c:get_current_charset:
 1702|  43.5k|{
 1703|  43.5k|	const char *cur_charset;
 1704|       |
 1705|  43.5k|	if (a == NULL)
  ------------------
  |  Branch (1705:6): [True: 43.4k, False: 80]
  ------------------
 1706|  43.4k|		cur_charset = default_iconv_charset("");
 1707|     80|	else {
 1708|     80|		cur_charset = default_iconv_charset(a->current_code);
 1709|     80|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1709:7): [True: 43, False: 37]
  ------------------
 1710|     43|			a->current_code = strdup(cur_charset);
 1711|     43|			a->current_codepage = get_current_codepage();
 1712|     43|			a->current_oemcp = get_current_oemcp();
 1713|     43|		}
 1714|     80|	}
 1715|  43.5k|	return (cur_charset);
 1716|  43.5k|}
archive_string.c:default_iconv_charset:
  423|  43.5k|default_iconv_charset(const char *charset) {
  424|  43.5k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (424:6): [True: 43.5k, False: 43]
  |  Branch (424:25): [True: 37, False: 43.4k]
  ------------------
  425|     37|		return charset;
  426|       |#if HAVE_LOCALE_CHARSET && !defined(__APPLE__)
  427|       |	/* locale_charset() is broken on Mac OS */
  428|       |	return locale_charset();
  429|       |#elif HAVE_NL_LANGINFO
  430|  43.5k|	return nl_langinfo(CODESET);
  431|       |#else
  432|       |	return "";
  433|       |#endif
  434|  43.5k|}
archive_string.c:get_current_oemcp:
 1636|     43|{
 1637|     43|	return (-1);/* Unknown */
 1638|     43|}
archive_string.c:free_sconv_object:
 1314|  43.5k|{
 1315|  43.5k|	free(sc->from_charset);
 1316|  43.5k|	free(sc->to_charset);
 1317|  43.5k|	archive_string_free(&sc->utftmp);
 1318|  43.5k|#if HAVE_ICONV
 1319|  43.5k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1319:6): [True: 43.5k, False: 0]
  ------------------
 1320|  43.5k|		iconv_close(sc->cd);
 1321|  43.5k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1321:6): [True: 0, False: 43.5k]
  ------------------
 1322|      0|		iconv_close(sc->cd_w);
 1323|  43.5k|#endif
 1324|  43.5k|	free(sc);
 1325|  43.5k|}
archive_string.c:setup_converter:
  910|  43.5k|{
  911|       |
  912|       |	/* Reset. */
  913|  43.5k|	sc->nconverter = 0;
  914|       |
  915|       |	/*
  916|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  917|       |	 * made by libarchive2.x.
  918|       |	 */
  919|  43.5k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|  43.5k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (919:6): [True: 0, False: 43.5k]
  ------------------
  920|      0|		add_converter(sc, strncat_from_utf8_libarchive2);
  921|      0|		return;
  922|      0|	}
  923|       |
  924|       |	/*
  925|       |	 * Convert a string to UTF-16BE/LE.
  926|       |	 */
  927|  43.5k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|  43.5k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  43.5k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  43.5k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (927:6): [True: 0, False: 43.5k]
  ------------------
  928|       |		/*
  929|       |		 * If the current locale is UTF-8, we can translate
  930|       |		 * a UTF-8 string into a UTF-16BE string.
  931|       |		 */
  932|      0|		if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (932:7): [True: 0, False: 0]
  ------------------
  933|      0|			add_converter(sc, archive_string_append_unicode);
  934|      0|			return;
  935|      0|		}
  936|       |
  937|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  938|       |		if (sc->flag & SCONV_WIN_CP) {
  939|       |			if (sc->flag & SCONV_TO_UTF16BE)
  940|       |				add_converter(sc, win_strncat_to_utf16be);
  941|       |			else
  942|       |				add_converter(sc, win_strncat_to_utf16le);
  943|       |			return;
  944|       |		}
  945|       |#endif
  946|       |
  947|      0|#if defined(HAVE_ICONV)
  948|      0|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (948:7): [True: 0, False: 0]
  ------------------
  949|      0|			add_converter(sc, iconv_strncat_in_locale);
  950|      0|			return;
  951|      0|		}
  952|      0|#endif
  953|       |
  954|      0|		if (sc->flag & SCONV_BEST_EFFORT) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (954:7): [True: 0, False: 0]
  ------------------
  955|      0|			if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (955:8): [True: 0, False: 0]
  ------------------
  956|      0|				add_converter(sc,
  957|      0|					best_effort_strncat_to_utf16be);
  958|      0|			else
  959|      0|				add_converter(sc,
  960|      0|					best_effort_strncat_to_utf16le);
  961|      0|		} else
  962|       |			/* Make sure we have no converter. */
  963|      0|			sc->nconverter = 0;
  964|      0|		return;
  965|      0|	}
  966|       |
  967|       |	/*
  968|       |	 * Convert a string from UTF-16BE/LE.
  969|       |	 */
  970|  43.5k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|  43.5k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  43.5k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  43.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (970:6): [True: 7, False: 43.5k]
  ------------------
  971|       |		/*
  972|       |		 * At least we should normalize a UTF-16BE string.
  973|       |		 */
  974|      7|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|      7|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (974:7): [True: 0, False: 7]
  ------------------
  975|      0|			add_converter(sc,archive_string_normalize_D);
  976|      7|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|      7|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (976:12): [True: 7, False: 0]
  ------------------
  977|      7|			add_converter(sc, archive_string_normalize_C);
  978|       |
  979|      7|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|      7|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (979:7): [True: 0, False: 7]
  ------------------
  980|       |			/*
  981|       |			 * If the current locale is UTF-8, we can translate
  982|       |			 * a UTF-16BE/LE string into a UTF-8 string directly.
  983|       |			 */
  984|      0|			if (!(sc->flag &
  ------------------
  |  Branch (984:8): [True: 0, False: 0]
  ------------------
  985|      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.
  ------------------
  986|      0|				add_converter(sc,
  987|      0|				    archive_string_append_unicode);
  988|      0|			return;
  989|      0|		}
  990|       |
  991|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  992|       |		if (sc->flag & SCONV_WIN_CP) {
  993|       |			if (sc->flag & SCONV_FROM_UTF16BE)
  994|       |				add_converter(sc, win_strncat_from_utf16be);
  995|       |			else
  996|       |				add_converter(sc, win_strncat_from_utf16le);
  997|       |			return;
  998|       |		}
  999|       |#endif
 1000|       |
 1001|      7|#if defined(HAVE_ICONV)
 1002|      7|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1002:7): [True: 7, False: 0]
  ------------------
 1003|      7|			add_converter(sc, iconv_strncat_in_locale);
 1004|      7|			return;
 1005|      7|		}
 1006|      0|#endif
 1007|       |
 1008|      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 (1008:7): [True: 0, False: 0]
  ------------------
 1009|      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. */
  ------------------
 1010|      0|			add_converter(sc, best_effort_strncat_from_utf16be);
 1011|      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 (1011:12): [True: 0, False: 0]
  ------------------
 1012|      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. */
  ------------------
 1013|      0|			add_converter(sc, best_effort_strncat_from_utf16le);
 1014|      0|		else
 1015|       |			/* Make sure we have no converter. */
 1016|      0|			sc->nconverter = 0;
 1017|      0|		return;
 1018|      7|	}
 1019|       |
 1020|  43.5k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|  43.5k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1020:6): [True: 15.4k, False: 28.0k]
  ------------------
 1021|       |		/*
 1022|       |		 * At least we should normalize a UTF-8 string.
 1023|       |		 */
 1024|  15.4k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  15.4k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1024:7): [True: 0, False: 15.4k]
  ------------------
 1025|      0|			add_converter(sc,archive_string_normalize_D);
 1026|  15.4k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  15.4k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1026:12): [True: 15.4k, False: 0]
  ------------------
 1027|  15.4k|			add_converter(sc, archive_string_normalize_C);
 1028|       |
 1029|       |		/*
 1030|       |		 * Copy UTF-8 string with a check of CESU-8.
 1031|       |		 * Apparently, iconv does not check surrogate pairs in UTF-8
 1032|       |		 * when both from-charset and to-charset are UTF-8, and then
 1033|       |		 * we use our UTF-8 copy code.
 1034|       |		 */
 1035|  15.4k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  15.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1035:7): [True: 0, False: 15.4k]
  ------------------
 1036|       |			/*
 1037|       |			 * If the current locale is UTF-8, we can translate
 1038|       |			 * a UTF-16BE string into a UTF-8 string directly.
 1039|       |			 */
 1040|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1040:8): [True: 0, False: 0]
  ------------------
 1041|      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.
  ------------------
 1042|      0|				add_converter(sc, strncat_from_utf8_to_utf8);
 1043|      0|			return;
 1044|      0|		}
 1045|  15.4k|	}
 1046|       |
 1047|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1048|       |	/*
 1049|       |	 * On Windows we can use Windows API for a string conversion.
 1050|       |	 */
 1051|       |	if (sc->flag & SCONV_WIN_CP) {
 1052|       |		add_converter(sc, strncat_in_codepage);
 1053|       |		return;
 1054|       |	}
 1055|       |#endif
 1056|       |
 1057|  43.5k|#if HAVE_ICONV
 1058|  43.5k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1058:6): [True: 43.5k, False: 0]
  ------------------
 1059|  43.5k|		add_converter(sc, iconv_strncat_in_locale);
 1060|       |		/*
 1061|       |		 * iconv generally does not support UTF-8-MAC and so
 1062|       |		 * we have to the output of iconv from NFC to NFD if
 1063|       |		 * need.
 1064|       |		 */
 1065|  43.5k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  43.5k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1065:7): [True: 15.4k, False: 28.0k]
  ------------------
 1066|  43.5k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  15.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1066:7): [True: 0, False: 15.4k]
  ------------------
 1067|      0|			if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1067:8): [True: 0, False: 0]
  ------------------
 1068|      0|				add_converter(sc, archive_string_normalize_D);
 1069|      0|		}
 1070|  43.5k|		return;
 1071|  43.5k|	}
 1072|      0|#endif
 1073|       |
 1074|       |	/*
 1075|       |	 * Try conversion in the best effort or no conversion.
 1076|       |	 */
 1077|      0|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1077:6): [True: 0, False: 0]
  |  Branch (1077:40): [True: 0, False: 0]
  ------------------
 1078|      0|		add_converter(sc, best_effort_strncat_in_locale);
 1079|      0|	else
 1080|       |		/* Make sure we have no converter. */
 1081|      0|		sc->nconverter = 0;
 1082|      0|}
archive_string.c:add_converter:
  902|  58.9k|{
  903|  58.9k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (903:6): [True: 0, False: 58.9k]
  |  Branch (903:20): [True: 0, False: 58.9k]
  ------------------
  904|      0|		__archive_errx(1, "Programming error");
  905|  58.9k|	sc->converter[sc->nconverter++] = converter;
  906|  58.9k|}
archive_string.c:_utf8_to_unicode:
 2295|   429k|{
 2296|   429k|	static const char utf8_count[256] = {
 2297|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2298|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2299|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2300|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2301|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2302|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2303|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2304|   429k|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2305|   429k|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2306|   429k|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2307|   429k|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2308|   429k|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2309|   429k|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2310|   429k|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2311|   429k|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2312|   429k|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2313|   429k|	};
 2314|   429k|	int ch, i;
 2315|   429k|	int cnt;
 2316|   429k|	uint32_t wc;
 2317|       |
 2318|       |	/* Sanity check. */
 2319|   429k|	if (n == 0)
  ------------------
  |  Branch (2319:6): [True: 20.4k, False: 408k]
  ------------------
 2320|  20.4k|		return (0);
 2321|       |	/*
 2322|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2323|       |	 */
 2324|   408k|	ch = (unsigned char)*s;
 2325|   408k|	if (ch == 0)
  ------------------
  |  Branch (2325:6): [True: 0, False: 408k]
  ------------------
 2326|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2327|   408k|	cnt = utf8_count[ch];
 2328|       |
 2329|       |	/* Invalid sequence or there are not plenty bytes. */
 2330|   408k|	if ((int)n < cnt) {
  ------------------
  |  Branch (2330:6): [True: 3.00k, False: 405k]
  ------------------
 2331|  3.00k|		cnt = (int)n;
 2332|  3.49k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2332:15): [True: 541, False: 2.95k]
  ------------------
 2333|    541|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2333:8): [True: 49, False: 492]
  ------------------
 2334|     49|				cnt = i;
 2335|     49|				break;
 2336|     49|			}
 2337|    541|		}
 2338|  3.00k|		goto invalid_sequence;
 2339|  3.00k|	}
 2340|       |
 2341|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2342|   405k|	switch (cnt) {
 2343|   259k|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2343:2): [True: 259k, False: 145k]
  ------------------
 2344|   259k|		*pwc = ch & 0x7f;
 2345|   259k|		return (cnt);
 2346|  24.1k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2346:2): [True: 24.1k, False: 381k]
  ------------------
 2347|  24.1k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2347:7): [True: 1.47k, False: 22.6k]
  ------------------
 2348|  1.47k|			cnt = 1;
 2349|  1.47k|			goto invalid_sequence;
 2350|  1.47k|		}
 2351|  22.6k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2352|  22.6k|		return (cnt);
 2353|  8.56k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2353:2): [True: 8.56k, False: 397k]
  ------------------
 2354|  8.56k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2354:7): [True: 8.56k, False: 0]
  ------------------
 2355|  8.56k|			cnt = 1;
 2356|  8.56k|			goto invalid_sequence;
 2357|  8.56k|		}
 2358|      0|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2358:7): [True: 0, False: 0]
  ------------------
 2359|      0|			cnt = 2;
 2360|      0|			goto invalid_sequence;
 2361|      0|		}
 2362|      0|		wc = ((ch & 0x0f) << 12)
 2363|      0|		    | ((s[1] & 0x3f) << 6)
 2364|      0|		    | (s[2] & 0x3f);
 2365|      0|		if (wc < 0x800)
  ------------------
  |  Branch (2365:7): [True: 0, False: 0]
  ------------------
 2366|      0|			goto invalid_sequence;/* Overlong sequence. */
 2367|      0|		break;
 2368|  4.55k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2368:2): [True: 4.55k, False: 401k]
  ------------------
 2369|  4.55k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2369:7): [True: 4.55k, False: 0]
  ------------------
 2370|  4.55k|			cnt = 1;
 2371|  4.55k|			goto invalid_sequence;
 2372|  4.55k|		}
 2373|      0|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2373:7): [True: 0, False: 0]
  ------------------
 2374|      0|			cnt = 2;
 2375|      0|			goto invalid_sequence;
 2376|      0|		}
 2377|      0|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2377:7): [True: 0, False: 0]
  ------------------
 2378|      0|			cnt = 3;
 2379|      0|			goto invalid_sequence;
 2380|      0|		}
 2381|      0|		wc = ((ch & 0x07) << 18)
 2382|      0|		    | ((s[1] & 0x3f) << 12)
 2383|      0|		    | ((s[2] & 0x3f) << 6)
 2384|      0|		    | (s[3] & 0x3f);
 2385|      0|		if (wc < 0x10000)
  ------------------
  |  Branch (2385:7): [True: 0, False: 0]
  ------------------
 2386|      0|			goto invalid_sequence;/* Overlong sequence. */
 2387|      0|		break;
 2388|   108k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2388:2): [True: 108k, False: 297k]
  ------------------
 2389|   108k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2389:7): [True: 492, False: 108k]
  |  Branch (2389:21): [True: 0, False: 108k]
  ------------------
 2390|    492|			cnt = 2;
 2391|   108k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2391:12): [True: 72.8k, False: 35.2k]
  |  Branch (2391:26): [True: 0, False: 72.8k]
  ------------------
 2392|      0|			cnt = 4;
 2393|   108k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2393:12): [True: 72.8k, False: 35.2k]
  |  Branch (2393:26): [True: 4.52k, False: 68.3k]
  ------------------
 2394|  4.52k|			cnt = 5;
 2395|   103k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2395:12): [True: 0, False: 103k]
  |  Branch (2395:26): [True: 0, False: 103k]
  ------------------
 2396|      0|			cnt = 6;
 2397|   103k|		else
 2398|   103k|			cnt = 1;
 2399|   108k|		if ((int)n < cnt)
  ------------------
  |  Branch (2399:7): [True: 0, False: 108k]
  ------------------
 2400|      0|			cnt = (int)n;
 2401|   108k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2401:15): [True: 5.01k, False: 103k]
  ------------------
 2402|  5.01k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2402:8): [True: 5.01k, False: 0]
  ------------------
 2403|  5.01k|				cnt = i;
 2404|  5.01k|				break;
 2405|  5.01k|			}
 2406|  5.01k|		}
 2407|   108k|		goto invalid_sequence;
 2408|   405k|	}
 2409|       |
 2410|       |	/* The code point larger than 0x10FFFF is not legal
 2411|       |	 * Unicode values. */
 2412|      0|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|      0|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2412:6): [True: 0, False: 0]
  ------------------
 2413|      0|		goto invalid_sequence;
 2414|       |	/* Correctly gets a Unicode, returns used bytes. */
 2415|      0|	*pwc = wc;
 2416|      0|	return (cnt);
 2417|   126k|invalid_sequence:
 2418|   126k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   126k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2419|   126k|	return (cnt * -1);
 2420|      0|}
archive_string.c:unicode_to_utf8:
 2494|   138k|{
 2495|   138k|	char *_p = p;
 2496|       |
 2497|       |	/* Invalid Unicode char maps to Replacement character */
 2498|   138k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|   138k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2498:6): [True: 0, False: 138k]
  ------------------
 2499|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2500|       |	/* Translate code point to UTF8 */
 2501|   138k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2501:6): [True: 0, False: 138k]
  ------------------
 2502|      0|		if (remaining == 0)
  ------------------
  |  Branch (2502:7): [True: 0, False: 0]
  ------------------
 2503|      0|			return (0);
 2504|      0|		*p++ = (char)uc;
 2505|   138k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2505:13): [True: 13.5k, False: 124k]
  ------------------
 2506|  13.5k|		if (remaining < 2)
  ------------------
  |  Branch (2506:7): [True: 0, False: 13.5k]
  ------------------
 2507|      0|			return (0);
 2508|  13.5k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2509|  13.5k|		*p++ = 0x80 | (uc & 0x3f);
 2510|   124k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2510:13): [True: 124k, False: 0]
  ------------------
 2511|   124k|		if (remaining < 3)
  ------------------
  |  Branch (2511:7): [True: 2.82k, False: 121k]
  ------------------
 2512|  2.82k|			return (0);
 2513|   121k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2514|   121k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2515|   121k|		*p++ = 0x80 | (uc & 0x3f);
 2516|   121k|	} else {
 2517|      0|		if (remaining < 4)
  ------------------
  |  Branch (2517:7): [True: 0, False: 0]
  ------------------
 2518|      0|			return (0);
 2519|      0|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2520|      0|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2521|      0|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2522|      0|		*p++ = 0x80 | (uc & 0x3f);
 2523|      0|	}
 2524|   135k|	return (p - _p);
 2525|   138k|}
archive_string.c:utf16be_to_unicode:
 2529|     44|{
 2530|     44|	return (utf16_to_unicode(pwc, s, n, 1));
 2531|     44|}
archive_string.c:utf16_to_unicode:
 2541|     44|{
 2542|     44|	const char *utf16 = s;
 2543|     44|	unsigned uc;
 2544|       |
 2545|     44|	if (n == 0)
  ------------------
  |  Branch (2545:6): [True: 2, False: 42]
  ------------------
 2546|      2|		return (0);
 2547|     42|	if (n == 1) {
  ------------------
  |  Branch (2547:6): [True: 0, False: 42]
  ------------------
 2548|       |		/* set the Replacement Character instead. */
 2549|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2550|      0|		return (-1);
 2551|      0|	}
 2552|       |
 2553|     42|	if (be)
  ------------------
  |  Branch (2553:6): [True: 42, False: 0]
  ------------------
 2554|     42|		uc = archive_be16dec(utf16);
 2555|      0|	else
 2556|      0|		uc = archive_le16dec(utf16);
 2557|     42|	utf16 += 2;
 2558|       |		
 2559|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2560|     42|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|     42|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 0, False: 42]
  |  |  |  Branch (130:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2561|      0|		unsigned uc2;
 2562|       |
 2563|      0|		if (n >= 4) {
  ------------------
  |  Branch (2563:7): [True: 0, False: 0]
  ------------------
 2564|      0|			if (be)
  ------------------
  |  Branch (2564:8): [True: 0, False: 0]
  ------------------
 2565|      0|				uc2 = archive_be16dec(utf16);
 2566|      0|			else
 2567|      0|				uc2 = archive_le16dec(utf16);
 2568|      0|		} else
 2569|      0|			uc2 = 0;
 2570|      0|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  131|      0|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 0, False: 0]
  |  |  |  Branch (131:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2571|      0|			uc = combine_surrogate_pair(uc, uc2);
 2572|      0|			utf16 += 2;
 2573|      0|		} else {
 2574|       |	 		/* Undescribed code point should be U+FFFD
 2575|       |		 	* (replacement character). */
 2576|      0|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2577|      0|			return (-2);
 2578|      0|		}
 2579|      0|	}
 2580|       |
 2581|       |	/*
 2582|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2583|       |	 * used by UTF-16, so, after above calculation, the code
 2584|       |	 * must not be surrogate values, and Unicode has no codes
 2585|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2586|       |	 * values.
 2587|       |	 */
 2588|     42|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|     84|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 0, False: 42]
  |  |  |  Branch (132:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|     42|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2588:34): [True: 0, False: 42]
  ------------------
 2589|       |	 	/* Undescribed code point should be U+FFFD
 2590|       |	 	* (replacement character). */
 2591|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2592|      0|		return (((int)(utf16 - s)) * -1);
 2593|      0|	}
 2594|     42|	*pwc = uc;
 2595|     42|	return ((int)(utf16 - s));
 2596|     42|}
archive_string.c:cesu8_to_unicode:
 2455|   429k|{
 2456|   429k|	uint32_t wc = 0;
 2457|   429k|	int cnt;
 2458|       |
 2459|   429k|	cnt = _utf8_to_unicode(&wc, s, n);
 2460|   429k|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|      0|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 0, False: 0]
  |  |  |  Branch (130:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2460:6): [True: 0, False: 429k]
  ------------------
 2461|      0|		uint32_t wc2 = 0;
 2462|      0|		if (n - 3 < 3) {
  ------------------
  |  Branch (2462:7): [True: 0, False: 0]
  ------------------
 2463|       |			/* Invalid byte sequence. */
 2464|      0|			goto invalid_sequence;
 2465|      0|		}
 2466|      0|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2467|      0|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|      0|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 0, False: 0]
  |  |  |  Branch (131:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2467:7): [True: 0, False: 0]
  ------------------
 2468|       |			/* Invalid byte sequence. */
 2469|      0|			goto invalid_sequence;
 2470|      0|		}
 2471|      0|		wc = combine_surrogate_pair(wc, wc2);
 2472|      0|		cnt = 6;
 2473|   429k|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|      0|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 0, False: 0]
  |  |  |  Branch (131:53): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2473:13): [True: 0, False: 429k]
  ------------------
 2474|       |		/* Invalid byte sequence. */
 2475|      0|		goto invalid_sequence;
 2476|      0|	}
 2477|   429k|	*pwc = wc;
 2478|   429k|	return (cnt);
 2479|      0|invalid_sequence:
 2480|      0|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2481|      0|	if (cnt > 0)
  ------------------
  |  Branch (2481:6): [True: 0, False: 0]
  ------------------
 2482|      0|		cnt *= -1;
 2483|      0|	return (cnt);
 2484|   429k|}
archive_string.c:iconv_strncat_in_locale:
 2028|  42.0k|{
 2029|  42.0k|	ICONV_CONST char *itp;
 2030|  42.0k|	size_t remaining;
 2031|  42.0k|	iconv_t cd;
 2032|  42.0k|	char *outp;
 2033|  42.0k|	size_t avail, bs;
 2034|  42.0k|	int return_value = 0; /* success */
 2035|  42.0k|	int to_size, from_size;
 2036|       |
 2037|  42.0k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|  42.0k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  42.0k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  42.0k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2037:6): [True: 0, False: 42.0k]
  ------------------
 2038|      0|		to_size = 2;
 2039|  42.0k|	else
 2040|  42.0k|		to_size = 1;
 2041|  42.0k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|  42.0k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  42.0k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  42.0k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2041:6): [True: 2, False: 42.0k]
  ------------------
 2042|      2|		from_size = 2;
 2043|  42.0k|	else
 2044|  42.0k|		from_size = 1;
 2045|       |
 2046|  42.0k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2046:6): [True: 0, False: 42.0k]
  ------------------
 2047|      0|		return (-1);
 2048|       |
 2049|  42.0k|	cd = sc->cd;
 2050|  42.0k|	itp = (char *)(uintptr_t)_p;
 2051|  42.0k|	remaining = length;
 2052|  42.0k|	outp = as->s + as->length;
 2053|  42.0k|	avail = as->buffer_length - as->length - to_size;
 2054|   521k|	while (remaining >= (size_t)from_size) {
  ------------------
  |  Branch (2054:9): [True: 516k, False: 4.23k]
  ------------------
 2055|   516k|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2056|       |
 2057|   516k|		if (result != (size_t)-1)
  ------------------
  |  Branch (2057:7): [True: 37.8k, False: 479k]
  ------------------
 2058|  37.8k|			break; /* Conversion completed. */
 2059|       |
 2060|   479k|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2060:7): [True: 479k, False: 0]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|       |			/*
 2062|       |		 	 * If an output charset is UTF-8 or UTF-16BE/LE,
 2063|       |			 * unknown character should be U+FFFD
 2064|       |			 * (replacement character).
 2065|       |			 */
 2066|   479k|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|   479k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|   479k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   479k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   479k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2066:8): [True: 77.8k, False: 401k]
  ------------------
 2067|  77.8k|				size_t rbytes;
 2068|  77.8k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  77.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2068:9): [True: 77.8k, False: 0]
  ------------------
 2069|  77.8k|					rbytes = sizeof(utf8_replacement_char);
 2070|      0|				else
 2071|      0|					rbytes = 2;
 2072|       |
 2073|  77.8k|				if (avail < rbytes) {
  ------------------
  |  Branch (2073:9): [True: 249, False: 77.6k]
  ------------------
 2074|    249|					as->length = outp - as->s;
 2075|    249|					bs = as->buffer_length +
 2076|    249|					    (remaining * to_size) + rbytes;
 2077|    249|					if (NULL ==
  ------------------
  |  Branch (2077:10): [True: 0, False: 249]
  ------------------
 2078|    249|					    archive_string_ensure(as, bs))
 2079|      0|						return (-1);
 2080|    249|					outp = as->s + as->length;
 2081|    249|					avail = as->buffer_length
 2082|    249|					    - as->length - to_size;
 2083|    249|				}
 2084|  77.8k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  77.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2084:9): [True: 77.8k, False: 0]
  ------------------
 2085|  77.8k|					memcpy(outp, utf8_replacement_char, sizeof(utf8_replacement_char));
 2086|      0|				else if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2086:14): [True: 0, False: 0]
  ------------------
 2087|      0|					archive_be16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2088|      0|				else
 2089|      0|					archive_le16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2090|  77.8k|				outp += rbytes;
 2091|  77.8k|				avail -= rbytes;
 2092|   401k|			} else {
 2093|       |				/* Skip the illegal input bytes. */
 2094|   401k|				*outp++ = '?';
 2095|   401k|				avail--;
 2096|   401k|			}
 2097|   479k|			itp += from_size;
 2098|   479k|			remaining -= from_size;
 2099|   479k|			return_value = -1; /* failure */
 2100|   479k|		} else {
 2101|       |			/* E2BIG no output buffer,
 2102|       |			 * Increase an output buffer.  */
 2103|      0|			as->length = outp - as->s;
 2104|      0|			bs = as->buffer_length + remaining * 2;
 2105|      0|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2105:8): [True: 0, False: 0]
  ------------------
 2106|      0|				return (-1);
 2107|      0|			outp = as->s + as->length;
 2108|      0|			avail = as->buffer_length - as->length - to_size;
 2109|      0|		}
 2110|   479k|	}
 2111|  42.0k|	as->length = outp - as->s;
 2112|  42.0k|	as->s[as->length] = 0;
 2113|  42.0k|	if (to_size == 2)
  ------------------
  |  Branch (2113:6): [True: 0, False: 42.0k]
  ------------------
 2114|      0|		as->s[as->length+1] = 0;
 2115|  42.0k|	return (return_value);
 2116|  42.0k|}
archive_string.c:archive_string_normalize_C:
 2926|  20.4k|{
 2927|  20.4k|	const char *s = (const char *)_p;
 2928|  20.4k|	char *p, *endp;
 2929|  20.4k|	uint32_t uc, uc2;
 2930|  20.4k|	size_t w;
 2931|  20.4k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 2932|  20.4k|	int (*parse)(uint32_t *, const char *, size_t);
 2933|  20.4k|	size_t (*unparse)(char *, size_t, uint32_t);
 2934|       |
 2935|  20.4k|	always_replace = 1;
 2936|  20.4k|	ts = 1;/* text size. */
 2937|  20.4k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  20.4k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2937:6): [True: 0, False: 20.4k]
  ------------------
 2938|      0|		unparse = unicode_to_utf16be;
 2939|      0|		ts = 2;
 2940|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (2940:7): [True: 0, False: 0]
  ------------------
 2941|      0|			always_replace = 0;
 2942|  20.4k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  20.4k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (2942:13): [True: 0, False: 20.4k]
  ------------------
 2943|      0|		unparse = unicode_to_utf16le;
 2944|      0|		ts = 2;
 2945|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (2945:7): [True: 0, False: 0]
  ------------------
 2946|      0|			always_replace = 0;
 2947|  20.4k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  20.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2947:13): [True: 0, False: 20.4k]
  ------------------
 2948|      0|		unparse = unicode_to_utf8;
 2949|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (2949:7): [True: 0, False: 0]
  ------------------
 2950|      0|			always_replace = 0;
 2951|  20.4k|	} else {
 2952|       |		/*
 2953|       |		 * This case is going to be converted to another
 2954|       |		 * character-set through iconv.
 2955|       |		 */
 2956|  20.4k|		always_replace = 0;
 2957|  20.4k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  20.4k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (2957:7): [True: 2, False: 20.4k]
  ------------------
 2958|      2|			unparse = unicode_to_utf16be;
 2959|      2|			ts = 2;
 2960|  20.4k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  20.4k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (2960:14): [True: 0, False: 20.4k]
  ------------------
 2961|      0|			unparse = unicode_to_utf16le;
 2962|      0|			ts = 2;
 2963|  20.4k|		} else {
 2964|  20.4k|			unparse = unicode_to_utf8;
 2965|  20.4k|		}
 2966|  20.4k|	}
 2967|       |
 2968|  20.4k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  20.4k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (2968:6): [True: 2, False: 20.4k]
  ------------------
 2969|      2|		parse = utf16be_to_unicode;
 2970|      2|		tm = 1;
 2971|      2|		spair = 4;/* surrogate pair size in UTF-16. */
 2972|  20.4k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  20.4k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (2972:13): [True: 0, False: 20.4k]
  ------------------
 2973|      0|		parse = utf16le_to_unicode;
 2974|      0|		tm = 1;
 2975|      0|		spair = 4;/* surrogate pair size in UTF-16. */
 2976|  20.4k|	} else {
 2977|  20.4k|		parse = cesu8_to_unicode;
 2978|  20.4k|		tm = ts;
 2979|  20.4k|		spair = 6;/* surrogate pair size in UTF-8. */
 2980|  20.4k|	}
 2981|       |
 2982|  20.4k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (2982:6): [True: 0, False: 20.4k]
  ------------------
 2983|      0|		return (-1);
 2984|       |
 2985|  20.4k|	p = as->s + as->length;
 2986|  20.4k|	endp = as->s + as->buffer_length - ts;
 2987|   146k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (2987:9): [True: 142k, False: 3.74k]
  ------------------
 2988|   142k|		const char *ucptr, *uc2ptr;
 2989|       |
 2990|   142k|		if (n < 0) {
  ------------------
  |  Branch (2990:7): [True: 82.6k, False: 60.2k]
  ------------------
 2991|       |			/* Use a replaced unicode character. */
 2992|  82.6k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2856|  82.6k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2857|  83.6k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2857:9): [True: 1.01k, False: 82.6k]
  |  |  ------------------
  |  | 2858|  1.01k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2847|  1.01k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|  1.01k|	as->length = p - as->s;			\
  |  |  |  | 2849|  1.01k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 1.01k]
  |  |  |  |  ------------------
  |  |  |  | 2850|  1.01k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|  1.01k|		return (-1);			\
  |  |  |  | 2852|  1.01k|	p = as->s + as->length;			\
  |  |  |  | 2853|  1.01k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|  1.01k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2859|  1.01k|	}					\
  |  | 2860|  82.6k|	p += w;					\
  |  | 2861|  82.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2993|  82.6k|			s += n*-1;
 2994|  82.6k|			len -= n*-1;
 2995|  82.6k|			ret = -1;
 2996|  82.6k|			continue;
 2997|  82.6k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (2997:14): [True: 0, False: 60.2k]
  |  Branch (2997:28): [True: 0, False: 60.2k]
  ------------------
 2998|       |			/* uc is converted from a surrogate pair.
 2999|       |			 * this should be treated as a changed code. */
 3000|      0|			ucptr = NULL;
 3001|  60.2k|		else
 3002|  60.2k|			ucptr = s;
 3003|  60.2k|		s += n;
 3004|  60.2k|		len -= n;
 3005|       |
 3006|       |		/* Read second code point. */
 3007|   264k|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3007:10): [True: 208k, False: 55.6k]
  ------------------
 3008|   208k|			uint32_t ucx[FDC_MAX];
 3009|   208k|			int ccx[FDC_MAX];
 3010|   208k|			int cl, cx, i, nx, ucx_size;
 3011|   208k|			int LIndex,SIndex;
 3012|   208k|			uint32_t nfc;
 3013|       |
 3014|   208k|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3014:8): [True: 0, False: 208k]
  |  Branch (3014:23): [True: 0, False: 208k]
  ------------------
 3015|       |				/* uc2 is converted from a surrogate pair.
 3016|       |			 	 * this should be treated as a changed code. */
 3017|      0|				uc2ptr = NULL;
 3018|   208k|			else
 3019|   208k|				uc2ptr = s;
 3020|   208k|			s += n2;
 3021|   208k|			len -= n2;
 3022|       |
 3023|       |			/*
 3024|       |			 * If current second code point is out of decomposable
 3025|       |			 * code points, finding compositions is unneeded.
 3026|       |			 */
 3027|   208k|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|   208k|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 208k, False: 0]
  |  |  |  Branch (986:25): [True: 4.52k, False: 204k]
  |  |  ------------------
  ------------------
 3028|   204k|				WRITE_UC();
  ------------------
  |  | 2869|   204k|#define WRITE_UC()	do {			\
  |  | 2870|   204k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 204k, False: 0]
  |  |  ------------------
  |  | 2871|   204k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 904, False: 203k]
  |  |  ------------------
  |  | 2872|   204k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|    904|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|    904|	as->length = p - as->s;			\
  |  |  |  | 2849|    904|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 904]
  |  |  |  |  ------------------
  |  |  |  | 2850|    904|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|    904|		return (-1);			\
  |  |  |  | 2852|    904|	p = as->s + as->length;			\
  |  |  |  | 2853|    904|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|    904|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|   204k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 204k]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 204k]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 204k]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|  4.59k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 4.59k, False: 199k]
  |  |  ------------------
  |  | 2881|  4.59k|			*p++ = *ucptr++;	\
  |  | 2882|  4.59k|			/* FALL THROUGH */	\
  |  | 2883|   204k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 199k, False: 4.59k]
  |  |  ------------------
  |  | 2884|   204k|			*p++ = *ucptr;		\
  |  | 2885|   204k|			break;			\
  |  | 2886|   204k|		}				\
  |  | 2887|   204k|		ucptr = NULL;			\
  |  | 2888|   204k|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|   204k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3029|   204k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2841|   204k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2842|   204k|	uc = uc2;				\
  |  | 2843|   204k|	ucptr = uc2ptr;				\
  |  | 2844|   204k|	n = n2;					\
  |  | 2845|   204k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2845:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3030|   204k|				continue;
 3031|   204k|			}
 3032|       |
 3033|       |			/*
 3034|       |			 * Try to combine current code points.
 3035|       |			 */
 3036|       |			/*
 3037|       |			 * We have to combine Hangul characters according to
 3038|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3039|       |			 */
 3040|  4.52k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2795|  4.52k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3040:8): [True: 0, False: 4.52k]
  ------------------
 3041|  4.52k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2798|      0|#define HC_LCOUNT	19
  ------------------
  |  Branch (3041:8): [True: 0, False: 0]
  ------------------
 3042|       |				/*
 3043|       |				 * Hangul Composition.
 3044|       |				 * 1. Two current code points are L and V.
 3045|       |				 */
 3046|      0|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2796|      0|#define HC_VBASE	0x1161
  ------------------
 3047|      0|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2799|      0|#define HC_VCOUNT	21
  ------------------
  |  Branch (3047:9): [True: 0, False: 0]
  |  Branch (3047:24): [True: 0, False: 0]
  ------------------
 3048|       |					/* Make syllable of form LV. */
 3049|      0|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2833|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2834|      0|	uc = new_uc;				\
  |  | 2835|      0|	ucptr = NULL;				\
  |  | 2836|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2836:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3050|      0|					    (LIndex * HC_VCOUNT + VIndex) *
 3051|      0|					     HC_TCOUNT);
 3052|      0|				} else {
 3053|      0|					WRITE_UC();
  ------------------
  |  | 2869|      0|#define WRITE_UC()	do {			\
  |  | 2870|      0|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 2871|      0|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2872|      0|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|      0|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|      0|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2881|      0|			*p++ = *ucptr++;	\
  |  | 2882|      0|			/* FALL THROUGH */	\
  |  | 2883|      0|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2884|      0|			*p++ = *ucptr;		\
  |  | 2885|      0|			break;			\
  |  | 2886|      0|		}				\
  |  | 2887|      0|		ucptr = NULL;			\
  |  | 2888|      0|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3054|      0|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2841|      0|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2842|      0|	uc = uc2;				\
  |  | 2843|      0|	ucptr = uc2ptr;				\
  |  | 2844|      0|	n = n2;					\
  |  | 2845|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2845:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3055|      0|				}
 3056|      0|				continue;
 3057|  4.52k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2794|  4.52k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3057:15): [True: 0, False: 4.52k]
  ------------------
 3058|  4.52k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2802|  4.52k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2798|      0|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2801|      0|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2799|      0|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2800|      0|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2800|      0|#define HC_TCOUNT	28
  ------------------
  |  Branch (3058:8): [True: 0, False: 0]
  |  Branch (3058:30): [True: 0, False: 0]
  ------------------
 3059|       |				/*
 3060|       |				 * Hangul Composition.
 3061|       |				 * 2. Two current code points are LV and T.
 3062|       |				 */
 3063|      0|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2797|      0|#define HC_TBASE	0x11A7
  ------------------
 3064|      0|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2800|      0|#define HC_TCOUNT	28
  ------------------
  |  Branch (3064:9): [True: 0, False: 0]
  |  Branch (3064:23): [True: 0, False: 0]
  ------------------
 3065|       |					/* Make syllable of form LVT. */
 3066|      0|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2833|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2834|      0|	uc = new_uc;				\
  |  | 2835|      0|	ucptr = NULL;				\
  |  | 2836|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2836:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3067|      0|				} else {
 3068|      0|					WRITE_UC();
  ------------------
  |  | 2869|      0|#define WRITE_UC()	do {			\
  |  | 2870|      0|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 2871|      0|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2872|      0|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|      0|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|      0|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2881|      0|			*p++ = *ucptr++;	\
  |  | 2882|      0|			/* FALL THROUGH */	\
  |  | 2883|      0|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2884|      0|			*p++ = *ucptr;		\
  |  | 2885|      0|			break;			\
  |  | 2886|      0|		}				\
  |  | 2887|      0|		ucptr = NULL;			\
  |  | 2888|      0|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3069|      0|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2841|      0|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2842|      0|	uc = uc2;				\
  |  | 2843|      0|	ucptr = uc2ptr;				\
  |  | 2844|      0|	n = n2;					\
  |  | 2845|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2845:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3070|      0|				}
 3071|      0|				continue;
 3072|  4.52k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3072:15): [True: 0, False: 4.52k]
  ------------------
 3073|       |				/* A composition to current code points
 3074|       |				 * is found. */
 3075|      0|				UPDATE_UC(nfc);
  ------------------
  |  | 2833|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2834|      0|	uc = new_uc;				\
  |  | 2835|      0|	ucptr = NULL;				\
  |  | 2836|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2836:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3076|      0|				continue;
 3077|  4.52k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  4.52k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 4.52k]
  |  |  ------------------
  |  | 1008|  4.52k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3077:15): [True: 4, False: 4.52k]
  ------------------
 3078|       |				/* Clearly 'uc2' the second code point is not
 3079|       |				 * a decomposable code. */
 3080|      4|				WRITE_UC();
  ------------------
  |  | 2869|      4|#define WRITE_UC()	do {			\
  |  | 2870|      4|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 4, False: 0]
  |  |  ------------------
  |  | 2871|      4|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 0, False: 4]
  |  |  ------------------
  |  | 2872|      4|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|      4|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 4]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 4]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 4]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|      4|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 4, False: 0]
  |  |  ------------------
  |  | 2881|      4|			*p++ = *ucptr++;	\
  |  | 2882|      4|			/* FALL THROUGH */	\
  |  | 2883|      4|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 0, False: 4]
  |  |  ------------------
  |  | 2884|      4|			*p++ = *ucptr;		\
  |  | 2885|      4|			break;			\
  |  | 2886|      4|		}				\
  |  | 2887|      4|		ucptr = NULL;			\
  |  | 2888|      4|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|      4|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3081|      4|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2841|      4|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2842|      4|	uc = uc2;				\
  |  | 2843|      4|	ucptr = uc2ptr;				\
  |  | 2844|      4|	n = n2;					\
  |  | 2845|      4|} while (0)
  |  |  ------------------
  |  |  |  Branch (2845:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3082|      4|				continue;
 3083|      4|			}
 3084|       |
 3085|       |			/*
 3086|       |			 * Collect following decomposable code points.
 3087|       |			 */
 3088|  4.52k|			cx = 0;
 3089|  4.52k|			ucx[0] = uc2;
 3090|  4.52k|			ccx[0] = cl;
 3091|  4.52k|			COLLECT_CPS(1);
  ------------------
  |  | 2896|  4.52k|#define COLLECT_CPS(start)	do {		\
  |  | 2897|  4.52k|	int _i;					\
  |  | 2898|  9.04k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2827|  9.04k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2898:19): [True: 9.04k, False: 0]
  |  |  ------------------
  |  | 2899|  9.04k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2900|  9.04k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2900:7): [True: 0, False: 9.04k]
  |  |  ------------------
  |  | 2901|  9.04k|			break;			\
  |  | 2902|  9.04k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  9.04k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 0, False: 9.04k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  9.04k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2903|  9.04k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2903:7): [True: 4.52k, False: 4.52k]
  |  |  |  Branch (2903:19): [True: 4.52k, False: 0]
  |  |  |  Branch (2903:32): [True: 4.52k, False: 0]
  |  |  ------------------
  |  | 2904|  9.04k|			break;			\
  |  | 2905|  9.04k|		s += nx;			\
  |  | 2906|  4.52k|		len -= nx;			\
  |  | 2907|  4.52k|		cl = cx;			\
  |  | 2908|  4.52k|		ccx[_i] = cx;			\
  |  | 2909|  4.52k|	}					\
  |  | 2910|  4.52k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2827|  4.52k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2910:6): [True: 0, False: 4.52k]
  |  |  ------------------
  |  | 2911|      0|		ret = -1;			\
  |  | 2912|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2827|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2913|      0|	} else					\
  |  | 2914|  4.52k|		ucx_size = _i;			\
  |  | 2915|  4.52k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2915:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3092|       |
 3093|       |			/*
 3094|       |			 * Find a composed code in the collected code points.
 3095|       |			 */
 3096|  4.52k|			i = 1;
 3097|  18.0k|			while (i < ucx_size) {
  ------------------
  |  Branch (3097:11): [True: 13.5k, False: 4.52k]
  ------------------
 3098|  13.5k|				int j;
 3099|       |
 3100|  13.5k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3100:9): [True: 9.04k, False: 4.52k]
  ------------------
 3101|  9.04k|					i++;
 3102|  9.04k|					continue;
 3103|  9.04k|				}
 3104|       |
 3105|       |				/*
 3106|       |				 * nfc is composed of uc and ucx[i].
 3107|       |				 */
 3108|  4.52k|				UPDATE_UC(nfc);
  ------------------
  |  | 2833|  4.52k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2834|  4.52k|	uc = new_uc;				\
  |  | 2835|  4.52k|	ucptr = NULL;				\
  |  | 2836|  4.52k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2836:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3109|       |
 3110|       |				/*
 3111|       |				 * Remove ucx[i] by shifting
 3112|       |				 * following code points.
 3113|       |				 */
 3114|  4.52k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3114:17): [True: 0, False: 4.52k]
  ------------------
 3115|      0|					ucx[j] = ucx[j+1];
 3116|      0|					ccx[j] = ccx[j+1];
 3117|      0|				}
 3118|  4.52k|				ucx_size --;
 3119|       |
 3120|       |				/*
 3121|       |				 * Collect following code points blocked
 3122|       |				 * by ucx[i] the removed code point.
 3123|       |				 */
 3124|  4.52k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3124:9): [True: 4.52k, False: 0]
  |  Branch (3124:25): [True: 4.52k, False: 0]
  ------------------
 3125|  4.52k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3125:9): [True: 4.52k, False: 0]
  |  Branch (3125:19): [True: 4.52k, False: 0]
  ------------------
 3126|  4.52k|					cl =  ccx[ucx_size-1];
 3127|  4.52k|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2896|  4.52k|#define COLLECT_CPS(start)	do {		\
  |  | 2897|  4.52k|	int _i;					\
  |  | 2898|  9.04k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2827|  9.04k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2898:19): [True: 9.04k, False: 0]
  |  |  ------------------
  |  | 2899|  9.04k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2900|  9.04k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2900:7): [True: 4.52k, False: 4.52k]
  |  |  ------------------
  |  | 2901|  9.04k|			break;			\
  |  | 2902|  9.04k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  4.52k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 0, False: 4.52k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  4.52k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2903|  4.52k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2903:7): [True: 0, False: 4.52k]
  |  |  |  Branch (2903:19): [True: 0, False: 0]
  |  |  |  Branch (2903:32): [True: 0, False: 0]
  |  |  ------------------
  |  | 2904|  4.52k|			break;			\
  |  | 2905|  4.52k|		s += nx;			\
  |  | 2906|  4.52k|		len -= nx;			\
  |  | 2907|  4.52k|		cl = cx;			\
  |  | 2908|  4.52k|		ccx[_i] = cx;			\
  |  | 2909|  4.52k|	}					\
  |  | 2910|  4.52k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2827|  4.52k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2910:6): [True: 0, False: 4.52k]
  |  |  ------------------
  |  | 2911|      0|		ret = -1;			\
  |  | 2912|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2827|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2913|      0|	} else					\
  |  | 2914|  4.52k|		ucx_size = _i;			\
  |  | 2915|  4.52k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2915:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3128|  4.52k|				}
 3129|       |				/*
 3130|       |				 * Restart finding a composed code with
 3131|       |				 * the updated uc from the top of the
 3132|       |				 * collected code points.
 3133|       |				 */
 3134|  4.52k|				i = 0;
 3135|  4.52k|			}
 3136|       |
 3137|       |			/*
 3138|       |			 * Apparently the current code points are not
 3139|       |			 * decomposed characters or already composed.
 3140|       |			 */
 3141|  4.52k|			WRITE_UC();
  ------------------
  |  | 2869|  4.52k|#define WRITE_UC()	do {			\
  |  | 2870|  4.52k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 0, False: 4.52k]
  |  |  ------------------
  |  | 2871|      0|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2872|      0|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|      0|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|      0|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2881|      0|			*p++ = *ucptr++;	\
  |  | 2882|      0|			/* FALL THROUGH */	\
  |  | 2883|      0|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 2884|      0|			*p++ = *ucptr;		\
  |  | 2885|      0|			break;			\
  |  | 2886|      0|		}				\
  |  | 2887|      0|		ucptr = NULL;			\
  |  | 2888|  4.52k|	} else {				\
  |  | 2889|  4.52k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|  4.52k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|  4.52k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 4.52k]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|  4.52k|	p += w;					\
  |  |  |  | 2861|  4.52k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|  4.52k|	}					\
  |  | 2891|  4.52k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3142|  13.5k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3142:16): [True: 9.04k, False: 4.52k]
  ------------------
 3143|  9.04k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2856|  13.5k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2857|  9.04k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2857:9): [True: 0, False: 9.04k]
  |  |  ------------------
  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2859|      0|	}					\
  |  | 2860|  9.04k|	p += w;					\
  |  | 2861|  9.04k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3144|       |
 3145|       |			/*
 3146|       |			 * Flush out remaining canonical combining characters.
 3147|       |			 */
 3148|  4.52k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3148:8): [True: 0, False: 4.52k]
  |  Branch (3148:18): [True: 0, False: 0]
  |  Branch (3148:30): [True: 0, False: 0]
  ------------------
 3149|      0|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3149:12): [True: 0, False: 0]
  ------------------
 3150|      0|				    > 0) {
 3151|      0|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|      0|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1008|      0|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3152|      0|					if (cl > cx)
  ------------------
  |  Branch (3152:10): [True: 0, False: 0]
  ------------------
 3153|      0|						break;
 3154|      0|					s += nx;
 3155|      0|					len -= nx;
 3156|      0|					cl = cx;
 3157|      0|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2859|      0|	}					\
  |  | 2860|      0|	p += w;					\
  |  | 2861|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3158|      0|				}
 3159|      0|			}
 3160|  4.52k|			break;
 3161|  4.52k|		}
 3162|  60.2k|		if (n2 < 0) {
  ------------------
  |  Branch (3162:7): [True: 39.0k, False: 21.2k]
  ------------------
 3163|  39.0k|			WRITE_UC();
  ------------------
  |  | 2869|  39.0k|#define WRITE_UC()	do {			\
  |  | 2870|  39.0k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 39.0k, False: 0]
  |  |  ------------------
  |  | 2871|  39.0k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 902, False: 38.1k]
  |  |  ------------------
  |  | 2872|  39.0k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|    902|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|    902|	as->length = p - as->s;			\
  |  |  |  | 2849|    902|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 902]
  |  |  |  |  ------------------
  |  |  |  | 2850|    902|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|    902|		return (-1);			\
  |  |  |  | 2852|    902|	p = as->s + as->length;			\
  |  |  |  | 2853|    902|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|    902|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|  39.0k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 39.0k]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 39.0k]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 39.0k]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|      0|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 0, False: 39.0k]
  |  |  ------------------
  |  | 2881|      0|			*p++ = *ucptr++;	\
  |  | 2882|      0|			/* FALL THROUGH */	\
  |  | 2883|  39.0k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 39.0k, False: 0]
  |  |  ------------------
  |  | 2884|  39.0k|			*p++ = *ucptr;		\
  |  | 2885|  39.0k|			break;			\
  |  | 2886|  39.0k|		}				\
  |  | 2887|  39.0k|		ucptr = NULL;			\
  |  | 2888|  39.0k|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|  39.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3164|       |			/* Use a replaced unicode character. */
 3165|  39.0k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2856|  39.0k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2857|  40.8k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2857:9): [True: 1.80k, False: 39.0k]
  |  |  ------------------
  |  | 2858|  1.80k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2847|  1.80k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|  1.80k|	as->length = p - as->s;			\
  |  |  |  | 2849|  1.80k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 1.80k]
  |  |  |  |  ------------------
  |  |  |  | 2850|  1.80k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|  1.80k|		return (-1);			\
  |  |  |  | 2852|  1.80k|	p = as->s + as->length;			\
  |  |  |  | 2853|  1.80k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|  1.80k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2859|  1.80k|	}					\
  |  | 2860|  39.0k|	p += w;					\
  |  | 2861|  39.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3166|  39.0k|			s += n2*-1;
 3167|  39.0k|			len -= n2*-1;
 3168|  39.0k|			ret = -1;
 3169|  39.0k|			continue;
 3170|  39.0k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3170:14): [True: 16.6k, False: 4.52k]
  ------------------
 3171|  16.6k|			WRITE_UC();
  ------------------
  |  | 2869|  16.6k|#define WRITE_UC()	do {			\
  |  | 2870|  16.6k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2870:6): [True: 16.6k, False: 0]
  |  |  ------------------
  |  | 2871|  16.6k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2871:7): [True: 0, False: 16.6k]
  |  |  ------------------
  |  | 2872|  16.6k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2873|  16.6k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2873:11): [True: 0, False: 16.6k]
  |  |  ------------------
  |  | 2874|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2874:3): [True: 0, False: 16.6k]
  |  |  ------------------
  |  | 2875|      0|			*p++ = *ucptr++;	\
  |  | 2876|      0|			/* FALL THROUGH */	\
  |  | 2877|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2877:3): [True: 0, False: 16.6k]
  |  |  ------------------
  |  | 2878|      0|			*p++ = *ucptr++;	\
  |  | 2879|      0|			/* FALL THROUGH */	\
  |  | 2880|     37|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2880:3): [True: 37, False: 16.6k]
  |  |  ------------------
  |  | 2881|     37|			*p++ = *ucptr++;	\
  |  | 2882|     37|			/* FALL THROUGH */	\
  |  | 2883|  16.6k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2883:3): [True: 16.6k, False: 37]
  |  |  ------------------
  |  | 2884|  16.6k|			*p++ = *ucptr;		\
  |  | 2885|  16.6k|			break;			\
  |  | 2886|  16.6k|		}				\
  |  | 2887|  16.6k|		ucptr = NULL;			\
  |  | 2888|  16.6k|	} else {				\
  |  | 2889|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2856|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2857|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2857:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2858|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2847|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2848|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2849|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2849:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2850|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2851|      0|		return (-1);			\
  |  |  |  |  |  | 2852|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2853|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2854|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2854:10): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2859|      0|	}					\
  |  |  |  | 2860|      0|	p += w;					\
  |  |  |  | 2861|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2861:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2890|      0|	}					\
  |  | 2891|  16.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2891:10): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3172|  16.6k|			break;
 3173|  16.6k|		}
 3174|  60.2k|	}
 3175|  20.4k|	as->length = p - as->s;
 3176|  20.4k|	as->s[as->length] = '\0';
 3177|  20.4k|	if (ts == 2)
  ------------------
  |  Branch (3177:6): [True: 2, False: 20.4k]
  ------------------
 3178|      2|		as->s[as->length+1] = '\0';
 3179|  20.4k|	return (ret);
 3180|  20.4k|}
archive_string.c:get_nfc:
 2806|  18.0k|{
 2807|  18.0k|	int t, b;
 2808|       |
 2809|  18.0k|	t = 0;
 2810|  18.0k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2811|   180k|	while (b >= t) {
  ------------------
  |  Branch (2811:9): [True: 167k, False: 13.5k]
  ------------------
 2812|   167k|		int m = (t + b) / 2;
 2813|   167k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2813:7): [True: 94.9k, False: 72.4k]
  ------------------
 2814|  94.9k|			t = m + 1;
 2815|  72.4k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2815:12): [True: 58.8k, False: 13.5k]
  ------------------
 2816|  58.8k|			b = m - 1;
 2817|  13.5k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2817:12): [True: 4.53k, False: 9.04k]
  ------------------
 2818|  4.53k|			t = m + 1;
 2819|  9.04k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2819:12): [True: 4.52k, False: 4.52k]
  ------------------
 2820|  4.52k|			b = m - 1;
 2821|  4.52k|		else
 2822|  4.52k|			return (u_composition_table[m].nfc);
 2823|   167k|	}
 2824|  13.5k|	return (0);
 2825|  18.0k|}
archive_string.c:utf16nbytes:
 1936|      2|{
 1937|      2|	size_t s;
 1938|      2|	const char *p, *pp;
 1939|       |
 1940|      2|	if (_p == NULL)
  ------------------
  |  Branch (1940:6): [True: 0, False: 2]
  ------------------
 1941|      0|		return (0);
 1942|      2|	p = (const char *)_p;
 1943|       |
 1944|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1945|      2|	s = 0;
 1946|      2|	pp = p;
 1947|      2|	n >>= 1;
 1948|     44|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (1948:9): [True: 44, False: 0]
  |  Branch (1948:19): [True: 4, False: 40]
  |  Branch (1948:28): [True: 38, False: 2]
  ------------------
 1949|     42|		pp += 2;
 1950|     42|		s++;
 1951|     42|	}
 1952|      2|	return (s<<1);
 1953|      2|}
archive_string.c:mbsnbytes:
 1916|  60.6k|{
 1917|  60.6k|	size_t s;
 1918|  60.6k|	const char *p, *pp;
 1919|       |
 1920|  60.6k|	if (_p == NULL)
  ------------------
  |  Branch (1920:6): [True: 0, False: 60.6k]
  ------------------
 1921|      0|		return (0);
 1922|  60.6k|	p = (const char *)_p;
 1923|       |
 1924|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1925|  60.6k|	s = 0;
 1926|  60.6k|	pp = p;
 1927|   998k|	while (s < n && *pp) {
  ------------------
  |  Branch (1927:9): [True: 942k, False: 56.1k]
  |  Branch (1927:18): [True: 938k, False: 4.56k]
  ------------------
 1928|   938k|		pp++;
 1929|   938k|		s++;
 1930|   938k|	}
 1931|  60.6k|	return (s);
 1932|  60.6k|}

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

__archive_clean:
   85|    238|{
   86|    238|	archive_string_conversion_free(a);
   87|    238|	return (ARCHIVE_OK);
  ------------------
  |  |  192|    238|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|    238|}
archive_file_count:
  120|    233|{
  121|    233|	return (a->file_count);
  122|    233|}
archive_clear_error:
  170|   330k|{
  171|   330k|	archive_string_empty(&a->error_string);
  ------------------
  |  |  181|   330k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  172|   330k|	a->error = NULL;
  173|   330k|	a->archive_error_number = 0;
  174|   330k|}
archive_set_error:
  178|   466k|{
  179|   466k|	va_list ap;
  180|       |
  181|   466k|	a->archive_error_number = error_number;
  182|   466k|	if (fmt == NULL) {
  ------------------
  |  Branch (182:6): [True: 0, False: 466k]
  ------------------
  183|      0|		a->error = NULL;
  184|      0|		return;
  185|      0|	}
  186|       |
  187|   466k|	archive_string_empty(&(a->error_string));
  ------------------
  |  |  181|   466k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  188|   466k|	va_start(ap, fmt);
  189|   466k|	archive_string_vsprintf(&(a->error_string), fmt, ap);
  190|   466k|	va_end(ap);
  191|   466k|	a->error = a->error_string.s;
  192|   466k|}

archive_filter_bytes:
   52|      4|{
   53|      4|	return ((a->vtable->archive_filter_bytes)(a, n));
   54|      4|}
archive_free:
   58|    238|{
   59|    238|	if (a == NULL)
  ------------------
  |  Branch (59:6): [True: 0, False: 238]
  ------------------
   60|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  192|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   61|    238|	return ((a->vtable->archive_free)(a));
   62|    238|}
archive_read_close:
   72|     57|{
   73|     57|	return ((a->vtable->archive_close)(a));
   74|     57|}
archive_read_free:
  100|    238|{
  101|    238|	return archive_free(a);
  102|    238|}
archive_read_next_header:
  147|   329k|{
  148|   329k|	return ((a->vtable->archive_read_next_header)(a, entry));
  149|   329k|}
archive_read_data_block:
  160|  52.5k|{
  161|  52.5k|	return ((a->vtable->archive_read_data_block)(a, buff, s, o));
  162|  52.5k|}

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

