LLVMFuzzerTestOneInput:
   90|  4.23k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   91|  4.23k|  PT_Indexes indexes;
   92|  4.23k|  char **flat = NULL, **tree = NULL, **none = NULL;
   93|  4.23k|  FILE *fp;
   94|  4.23k|  hts_boolean written;
   95|       |
   96|  4.23k|  if (size > FUZZ_ARC_MAXSIZE || fuzz_arc_setup() != 0) {
  ------------------
  |  |   41|  8.47k|#define FUZZ_ARC_MAXSIZE (1024 * 1024)
  ------------------
  |  Branch (96:7): [True: 0, False: 4.23k]
  |  Branch (96:34): [True: 0, False: 4.23k]
  ------------------
   97|      0|    return 0;
   98|      0|  }
   99|  4.23k|  if ((fp = fopen(arc_in, "wb")) == NULL) {
  ------------------
  |  Branch (99:7): [True: 0, False: 4.23k]
  ------------------
  100|      0|    return 0;
  101|      0|  }
  102|  4.23k|  written = fwrite(data, 1, size, fp) == size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  4.23k|#define HTS_TRUE 1
  ------------------
                written = fwrite(data, 1, size, fp) == size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|  4.23k|#define HTS_FALSE 0
  ------------------
  |  Branch (102:13): [True: 4.23k, False: 0]
  ------------------
  103|  4.23k|  if (fclose(fp) != 0 || !written) {
  ------------------
  |  Branch (103:7): [True: 0, False: 4.23k]
  |  Branch (103:26): [True: 0, False: 4.23k]
  ------------------
  104|      0|    return 0;
  105|      0|  }
  106|       |
  107|  4.23k|  indexes = PT_New();
  108|  4.23k|  if (indexes != NULL) {
  ------------------
  |  Branch (108:7): [True: 4.23k, False: 0]
  ------------------
  109|  4.23k|    if (PT_AddIndex(indexes, arc_in) > 0) {
  ------------------
  |  Branch (109:9): [True: 2.93k, False: 1.30k]
  ------------------
  110|       |      /* the writer reads back every entry the loader indexed */
  111|  2.93k|      (void) PT_SaveCache(indexes, arc_out);
  112|       |      /* An empty prefix takes every entry, subtree=1 takes the other shape,
  113|       |         and a prefix almost no input indexes takes the no-match return. */
  114|  2.93k|      flat = PT_Enumerate(indexes, "", 0);
  115|  2.93k|      tree = PT_Enumerate(indexes, "http://", 1);
  116|  2.93k|      none = PT_Enumerate(indexes, "http://255.255.255.255./", 0);
  117|  2.93k|    }
  118|  4.23k|    PT_Delete(indexes);
  119|  4.23k|  }
  120|  4.23k|  fuzz_arc_walk(flat);
  121|  4.23k|  fuzz_arc_walk(tree);
  122|  4.23k|  fuzz_arc_walk(none);
  123|  4.23k|  PT_Enumerate_Delete(&flat);
  124|  4.23k|  PT_Enumerate_Delete(&tree);
  125|  4.23k|  PT_Enumerate_Delete(&none);
  126|  4.23k|  return 0;
  127|  4.23k|}
fuzz-arc.c:fuzz_arc_setup:
   63|  4.23k|static int fuzz_arc_setup(void) {
   64|  4.23k|  if (arc_in[0] == '\0') {
  ------------------
  |  Branch (64:7): [True: 1, False: 4.23k]
  ------------------
   65|      1|    coucal_set_global_assert_handler(fuzz_arc_coucal_log, NULL);
   66|       |
   67|      1|    if (!fuzz_tmpdir(HTS_BUF(arc_dir), "fuzz-arc", fuzz_arc_cleanup)) {
  ------------------
  |  |  194|      1|#define HTS_BUF(ARR) hts_buf_at((ARR), sizeof(ARR) + HTS_BUF_GUARD_(ARR))
  |  |  ------------------
  |  |  |  |  190|      1|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      1|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|      1|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|      1|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|      return -1;
   69|      0|    }
   70|      1|    snprintf(arc_out, sizeof(arc_out), "%s/out.arc", arc_dir);
   71|      1|    snprintf(arc_in, sizeof(arc_in), "%s/in.arc", arc_dir);
   72|      1|  }
   73|  4.23k|  return 0;
   74|  4.23k|}
fuzz-arc.c:fuzz_arc_coucal_log:
   55|  17.2k|                                const char *format, va_list args) {
   56|  17.2k|  (void) arg;
   57|  17.2k|  (void) level;
   58|  17.2k|  (void) format;
   59|  17.2k|  (void) args;
   60|  17.2k|}
fuzz-arc.c:fuzz_arc_cleanup:
   47|      1|static void fuzz_arc_cleanup(void) {
   48|      1|  (void) unlink(arc_in);
   49|      1|  (void) unlink(arc_out);
   50|      1|  (void) rmdir(arc_dir);
   51|      1|}
fuzz-arc.c:fuzz_arc_walk:
   78|  12.7k|static void fuzz_arc_walk(char **list) {
   79|  12.7k|  static volatile size_t sink; /* keeps the reads from being optimised away */
   80|  12.7k|  size_t i;
   81|       |
   82|  12.7k|  if (list == NULL) {
  ------------------
  |  Branch (82:7): [True: 6.73k, False: 5.98k]
  ------------------
   83|  6.73k|    return;
   84|  6.73k|  }
   85|  89.5k|  for (i = 0; list[i] != NULL; i++) {
  ------------------
  |  Branch (85:15): [True: 83.6k, False: 5.98k]
  ------------------
   86|  83.6k|    sink += strlen(list[i]);
   87|  83.6k|  }
   88|  5.98k|}

fuzz-arc.c:fuzz_tmpdir:
   52|      1|                                          void (*cleanup)(void)) {
   53|      1|  const char *const tmp = getenv("TMPDIR");
   54|       |
   55|      1|  hts_buf_printf_clip(dir, "%s/%s-XXXXXX",
   56|      1|                      tmp != NULL && *tmp != '\0' ? tmp : "/tmp", prefix);
  ------------------
  |  Branch (56:23): [True: 0, False: 1]
  |  Branch (56:38): [True: 0, False: 0]
  ------------------
   57|      1|  if (mkdtemp(dir.p) == NULL)
  ------------------
  |  Branch (57:7): [True: 0, False: 1]
  ------------------
   58|      0|    return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
   59|      1|  atexit(cleanup);
   60|      1|  return HTS_TRUE;
  ------------------
  |  |  381|      1|#define HTS_TRUE 1
  ------------------
   61|      1|}

coucal_get_name:
  380|  17.2k|const char* coucal_get_name(coucal hashtable) {
  381|       |  /* the assertion path calls this with a NULL table (see HashMD5Init) */
  382|  17.2k|  return hashtable != NULL ? hashtable->custom.error.name : NULL;
  ------------------
  |  Branch (382:10): [True: 17.2k, False: 0]
  ------------------
  383|  17.2k|}
coucal_hash_data:
  434|   356k|coucal_hashkeys coucal_hash_data(const void *data_, size_t size) {
  435|   356k|  const unsigned char *const data = (const unsigned char *) data_;
  436|       |#if (defined(HTS_INTHASH_USES_MD5) || defined(HTS_INTHASH_USES_OPENSSL_MD5))
  437|       |  /* compute a regular MD5 and extract two 32-bit integers */
  438|       |  HashMD5Context ctx;
  439|       |  union {
  440|       |    unsigned char md5digest[16];
  441|       |#if (COUCAL_HASH_SIZE == 32)
  442|       |    coucal_hashkeys mhashes[2];
  443|       |#endif
  444|       |    coucal_hashkeys hashes;
  445|       |  } u;
  446|       |  size_t offset;
  447|       |
  448|       |  /* compute MD5 ; fed by chunks, as the update size is an unsigned int */
  449|       |  HashMD5Init(&ctx, 0);
  450|       |  for (offset = 0; offset < size;) {
  451|       |    const size_t remaining = size - offset;
  452|       |    const unsigned int chunk =
  453|       |        remaining <= 0x10000000 ? (unsigned int) remaining : 0x10000000;
  454|       |    HashMD5Update(&ctx, data + offset, chunk);
  455|       |    offset += chunk;
  456|       |  }
  457|       |  HashMD5Final(u.md5digest, &ctx);
  458|       |
  459|       |#if (COUCAL_HASH_SIZE == 32)
  460|       |  /* mix mix mix */
  461|       |  u.mhashes[0].hash1 ^= u.mhashes[1].hash1;
  462|       |  u.mhashes[0].hash2 ^= u.mhashes[1].hash2;
  463|       |#endif
  464|       |
  465|       |  /* do not keep identical hashes */
  466|       |  if (u.hashes.hash1 == u.hashes.hash2) {
  467|       |    u.hashes.hash2 = ~u.hashes.hash2;
  468|       |  }
  469|       |
  470|       |  return u.hashes;
  471|       |#elif (defined(HTS_INTHASH_USES_MURMUR))
  472|       |  union {
  473|   356k|    uint32_t result[4];
  474|   356k|    coucal_hashkeys hashes;
  475|   356k|  } u;
  476|   356k|  MurmurHash3_x86_128(data, size, 42, &u.result);
  477|       |
  478|   356k|#if (COUCAL_HASH_SIZE == 32)
  479|       |  /* mix mix mix */
  480|   356k|  u.result[0] ^= u.result[2];
  481|   356k|  u.result[1] ^= u.result[3];
  482|   356k|#endif
  483|       |
  484|       |  /* do not keep identical hashes */
  485|   356k|  if (u.hashes.hash1 == u.hashes.hash2) {
  ------------------
  |  Branch (485:7): [True: 0, False: 356k]
  ------------------
  486|      0|    u.hashes.hash2 = ~u.hashes.hash2;
  487|      0|  }
  488|       |
  489|   356k|  return u.hashes;
  490|       |#elif (defined(HTS_INTHASH_USES_FNV1))
  491|       |  /* compute two Fowler-Noll-Vo hashes (64-bit FNV-1 variant) ;
  492|       |     each 64-bit hash being XOR-folded into a single 32-bit hash. */
  493|       |  size_t i;
  494|       |  coucal_hashkeys hashes;
  495|       |  uint64_t h1, h2;
  496|       |
  497|       |  /* FNV-1, 64-bit. */
  498|       |#define FNV1_PRIME UINT_64_CONST(1099511628211)
  499|       |#define FNV1_OFFSET_BASIS UINT_64_CONST(14695981039346656037)
  500|       |
  501|       |  /* compute the hashes ; second variant is using xored data */
  502|       |  h1 = FNV1_OFFSET_BASIS;
  503|       |  h2 = ~FNV1_OFFSET_BASIS;
  504|       |  for(i = 0 ; i < size ; i++) {
  505|       |    const unsigned char c1 = data[i];
  506|       |    const unsigned char c2 = ~c1;
  507|       |    h1 = ( h1 * FNV1_PRIME ) ^ c1;
  508|       |    h2 = ( h2 * FNV1_PRIME ) ^ c2;
  509|       |  }
  510|       |
  511|       |#if (COUCAL_HASH_SIZE == 32)
  512|       |  /* XOR-folding to improve diffusion (Wikipedia) */
  513|       |  hashes.hash1 = ( (uint32_t) h1 ^ (uint32_t) ( h1 >> 32 ) );
  514|       |  hashes.hash2 = ( (uint32_t) h2 ^ (uint32_t) ( h2 >> 32 ) );
  515|       |#elif (COUCAL_HASH_SIZE == 64)
  516|       |  /* Direct hashes */
  517|       |  hashes.hash1 = h1;
  518|       |  hashes.hash2 = h2;
  519|       |#else
  520|       |#error "Unsupported COUCAL_HASH_SIZE"
  521|       |#endif
  522|       |
  523|       |#undef FNV1_PRIME
  524|       |#undef FNV1_OFFSET_BASIS
  525|       |
  526|       |  /* do not keep identical hashes */
  527|       |  if (hashes.hash1 == hashes.hash2) {
  528|       |    hashes.hash2 = ~hashes.hash2;
  529|       |  }
  530|       |
  531|       |  return hashes;
  532|       |
  533|       |#else
  534|       |#error "Undefined hashing method"
  535|       |#endif
  536|   356k|}
coucal_hash_string:
  538|   356k|INTHASH_INLINE coucal_hashkeys coucal_hash_string(const char *name) {
  539|   356k|  return coucal_hash_data(name, strlen(name));
  540|   356k|}
coucal_calc_hashes:
  543|   356k|                                                  coucal_key_const value) {
  544|   356k|  return hashtable->custom.key.hash == NULL 
  ------------------
  |  Branch (544:10): [True: 356k, False: 0]
  ------------------
  545|   356k|    ? coucal_hash_string(value)
  546|   356k|    : hashtable->custom.key.hash(hashtable->custom.key.arg, value);
  547|   356k|}
coucal_write:
  876|   133k|int coucal_write(coucal hashtable, coucal_key_const name, intptr_t intvalue) {
  877|   133k|  coucal_value value = INTHASH_VALUE_NULL;
  ------------------
  |  |  132|   133k|#define INTHASH_VALUE_NULL { 0 }
  ------------------
  878|       |
  879|   133k|  value.intg = intvalue;
  880|   133k|  return coucal_write_value(hashtable, name, value);
  881|   133k|}
coucal_write_value:
 1182|   201k|                       coucal_value_const value) {
 1183|       |  /* replace of add item */
 1184|   201k|  const int ret = coucal_write_value_(hashtable, name, value);
 1185|       |
 1186|       |  /* added ? */
 1187|   201k|  if (ret) {
  ------------------
  |  Branch (1187:7): [True: 182k, False: 18.8k]
  ------------------
 1188|       |    /* size of half of the table */
 1189|   182k|    const size_t half_size = POW2(hashtable->lg_size - 1);
  ------------------
  |  |  322|   182k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1190|       |
 1191|       |    /* size of half of the stash */
 1192|   182k|    const size_t half_stash_size = STASH_SIZE / 2;
  ------------------
  |  |  119|   182k|#define STASH_SIZE 16
  ------------------
 1193|       |
 1194|       |    /* item was added: increase count */
 1195|   182k|    hashtable->used++;
 1196|       |
 1197|       |    /* table is more than half-full, or stash is more than half-full */
 1198|   182k|    if (hashtable->used >= half_size
  ------------------
  |  Branch (1198:9): [True: 4.98k, False: 178k]
  ------------------
 1199|   178k|      || hashtable->stash.size >= half_stash_size) {
  ------------------
  |  Branch (1199:10): [True: 5, False: 178k]
  ------------------
 1200|  4.98k|      size_t i;
 1201|       |
 1202|       |      /* size before  */
 1203|  4.98k|      const size_t prev_power = hashtable->lg_size;
 1204|  4.98k|      const size_t prev_size = half_size * 2;
 1205|  4.98k|      const size_t prev_alloc_size = prev_size*sizeof(coucal_item);
 1206|       |
 1207|       |      /* size after doubling it ; a wrap here would silently under-allocate */
 1208|  4.98k|      const int size_overflow =
 1209|  4.98k|          prev_size > ((size_t) -1) / (2 * sizeof(coucal_item));
 1210|  4.98k|      const size_t alloc_size = size_overflow ? 0 : prev_alloc_size * 2;
  ------------------
  |  Branch (1210:33): [True: 0, False: 4.98k]
  ------------------
 1211|       |
 1212|       |      /* log stash issues */
 1213|  4.98k|      if (hashtable->stash.size >= half_stash_size 
  ------------------
  |  Branch (1213:11): [True: 7, False: 4.98k]
  ------------------
 1214|      7|        && half_size > POW2(16) 
  ------------------
  |  |  322|  4.99k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  |  Branch (1214:12): [True: 0, False: 7]
  ------------------
 1215|      0|        && hashtable->used < half_size / 4) {
  ------------------
  |  Branch (1215:12): [True: 0, False: 0]
  ------------------
 1216|      0|          coucal_warning(hashtable, 
  ------------------
  |  |  298|      0|#define coucal_warning coucal_do_warning
  ------------------
 1217|      0|            "stash size still full despite %"UINT_64_FORMAT
 1218|      0|            " elements used out of %"UINT_64_FORMAT,
  ------------------
  |  |  141|      0|#define UINT_64_FORMAT PRIu64
  ------------------
 1219|      0|            (uint64_t) hashtable->used, (uint64_t) half_size*2);
 1220|      0|      }
 1221|       |
 1222|       |      /* statistics */
 1223|  4.98k|      hashtable->stats.rehash_count++;
 1224|       |
 1225|       |      /* realloc */
 1226|  4.98k|      hashtable->lg_size++;
 1227|  4.98k|      coucal_assert(hashtable, coucal_is_acceptable_pow2(hashtable->lg_size));
  ------------------
  |  |  253|  4.98k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 4.98k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1228|  4.98k|      coucal_assert(hashtable, !size_overflow);
  ------------------
  |  |  253|  4.98k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 4.98k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1229|  4.98k|      hashtable->items = 
 1230|  4.98k|        (coucal_item *) realloc(hashtable->items, alloc_size);
 1231|  4.98k|      if (hashtable->items == NULL) {
  ------------------
  |  Branch (1231:11): [True: 0, False: 4.98k]
  ------------------
 1232|      0|        coucal_crit(hashtable,
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1233|      0|          "** hashtable allocation error: "
 1234|      0|          "could not allocate %"UINT_64_FORMAT" bytes", 
 1235|      0|          (uint64_t) alloc_size);
 1236|      0|        coucal_assert(hashtable, ! "hashtable allocation error");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1237|      0|      }
 1238|       |
 1239|       |      /* clear upper half */
 1240|  4.98k|      memset(&hashtable->items[prev_size], 0, prev_alloc_size);
 1241|       |
 1242|       |      /* relocate lower half items when needed */
 1243|   527k|      for(i = 0 ; i < prev_size ; i++) {
  ------------------
  |  Branch (1243:19): [True: 522k, False: 4.98k]
  ------------------
 1244|   522k|        if (!coucal_is_free(hashtable, i)) {
  ------------------
  |  Branch (1244:13): [True: 260k, False: 262k]
  ------------------
 1245|   260k|          const coucal_hashkeys *const hashes = &hashtable->items[i].hashes;
 1246|       |
 1247|       |          /* currently at old position 1 */
 1248|   260k|          if (coucal_hash_to_pos_(prev_power, hashes->hash1) == i) {
  ------------------
  |  Branch (1248:15): [True: 173k, False: 86.7k]
  ------------------
 1249|   173k|            const size_t pos = coucal_hash_to_pos(hashtable, hashes->hash1);
 1250|       |            /* no more the expected position */
 1251|   173k|            if (pos != i) {
  ------------------
  |  Branch (1251:17): [True: 80.5k, False: 92.6k]
  ------------------
 1252|  80.5k|              coucal_assert(hashtable, pos >= prev_size);
  ------------------
  |  |  253|  80.5k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 80.5k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1253|  80.5k|              hashtable->items[pos] = hashtable->items[i];
 1254|  80.5k|              memset(&hashtable->items[i], 0, sizeof(hashtable->items[i]));
 1255|  80.5k|            }
 1256|   173k|          }
 1257|  86.7k|          else if (coucal_hash_to_pos_(prev_power, hashes->hash2) == i) {
  ------------------
  |  Branch (1257:20): [True: 86.7k, False: 0]
  ------------------
 1258|  86.7k|            const size_t pos = coucal_hash_to_pos(hashtable, hashes->hash2);
 1259|       |            /* no more the expected position */
 1260|  86.7k|            if (pos != i) {
  ------------------
  |  Branch (1260:17): [True: 39.2k, False: 47.5k]
  ------------------
 1261|  39.2k|              coucal_assert(hashtable, pos >= prev_size);
  ------------------
  |  |  253|  39.2k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 39.2k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1262|  39.2k|              hashtable->items[pos] = hashtable->items[i];
 1263|  39.2k|              memset(&hashtable->items[i], 0, sizeof(hashtable->items[i]));
 1264|  39.2k|            }
 1265|  86.7k|          }
 1266|      0|          else {
 1267|      0|            coucal_assert(hashtable, ! "hashtable unexpected internal error (bad position)");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1268|      0|          }
 1269|   260k|        }
 1270|   522k|      }
 1271|       |
 1272|  4.98k|      coucal_debug(hashtable,
  ------------------
  |  |  312|  4.98k|#define coucal_debug COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  4.98k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  4.98k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 4.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1273|      0|                    "expanded hashtable to %"UINT_64_FORMAT" elements",
 1274|      0|                    (uint64_t) POW2(hashtable->lg_size));
  ------------------
  |  |  322|      0|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1275|       |
 1276|       |      /* attempt to merge the stash if present */
 1277|  4.98k|      if (hashtable->stash.size != 0) {
  ------------------
  |  Branch (1277:11): [True: 799, False: 4.18k]
  ------------------
 1278|    799|        const size_t old_extent = hashtable->stash.extent;
 1279|    799|        const size_t old_size = hashtable->stash.size;
 1280|    799|        size_t i;
 1281|       |
 1282|       |        /* backup stash and reset it */
 1283|    799|        coucal_item stash[STASH_SIZE];
 1284|    799|        memcpy(&stash, hashtable->stash.items, sizeof(hashtable->stash.items));
 1285|       |        /* stale copies above the new extent would alias live entries */
 1286|    799|        memset(hashtable->stash.items, 0, sizeof(hashtable->stash.items));
 1287|    799|        hashtable->stash.extent = 0;
 1288|    799|        hashtable->stash.size = 0;
 1289|       |
 1290|       |        /* insert all items */
 1291|  2.16k|        for (i = 0; i < old_extent; i++) {
  ------------------
  |  Branch (1291:21): [True: 1.36k, False: 799]
  ------------------
 1292|  1.36k|          if (stash[i].name != NULL) {
  ------------------
  |  Branch (1292:15): [True: 1.36k, False: 0]
  ------------------
 1293|  1.36k|            const int ret = coucal_add_item_(hashtable, stash[i]);
 1294|  1.36k|            if (ret == 0) {
  ------------------
  |  Branch (1294:17): [True: 0, False: 1.36k]
  ------------------
 1295|      0|              coucal_assert(hashtable,
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1296|      0|                            !"hashtable duplicate key when merging the stash");
 1297|      0|            }
 1298|  1.36k|          }
 1299|  1.36k|        }
 1300|       |
 1301|       |        /* logging */
 1302|    799|        coucal_assert(hashtable, hashtable->stash.size <= old_size);
  ------------------
  |  |  253|    799|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 799, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1303|    799|        if (hashtable->stash.size < old_size) {
  ------------------
  |  Branch (1303:13): [True: 784, False: 15]
  ------------------
 1304|    784|          coucal_debug(hashtable, "reduced stash size from %"UINT_64_FORMAT" "
  ------------------
  |  |  312|    784|#define coucal_debug COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|    784|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    784|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 784]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1305|      0|                        "to %"UINT_64_FORMAT,
  ------------------
  |  |  141|      0|#define UINT_64_FORMAT PRIu64
  ------------------
 1306|      0|                        (uint64_t) old_size, (uint64_t) hashtable->stash.size);
 1307|    784|        } else {
 1308|     15|          coucal_trace(hashtable, "stash has still %"UINT_64_FORMAT" elements",
  ------------------
  |  |  318|     15|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|     15|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|     15|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1309|      0|                        (uint64_t) hashtable->stash.size);
 1310|     15|        }
 1311|    799|      }
 1312|       |
 1313|  4.98k|    }
 1314|   182k|  }
 1315|       |
 1316|   201k|  return ret;
 1317|   201k|}
coucal_add:
 1319|  68.5k|void coucal_add(coucal hashtable, coucal_key_const name, intptr_t intvalue) {
 1320|  68.5k|  coucal_value value = INTHASH_VALUE_NULL;
  ------------------
  |  |  132|  68.5k|#define INTHASH_VALUE_NULL { 0 }
  ------------------
 1321|       |
 1322|  68.5k|  memset(&value, 0, sizeof(value));
 1323|  68.5k|  value.intg = intvalue;
 1324|  68.5k|  coucal_write_value(hashtable, name, value);
 1325|  68.5k|}
coucal_read:
 1327|  99.4k|int coucal_read(coucal hashtable, coucal_key_const name, intptr_t * intvalue) {
 1328|  99.4k|  coucal_value value = INTHASH_VALUE_NULL;
  ------------------
  |  |  132|  99.4k|#define INTHASH_VALUE_NULL { 0 }
  ------------------
 1329|  99.4k|  int ret =
 1330|  99.4k|    coucal_read_value(hashtable, name, (intvalue != NULL) ? &value : NULL);
  ------------------
  |  Branch (1330:40): [True: 99.4k, False: 0]
  ------------------
 1331|  99.4k|  if (intvalue != NULL)
  ------------------
  |  Branch (1331:7): [True: 99.4k, False: 0]
  ------------------
 1332|  99.4k|    *intvalue = value.intg;
 1333|  99.4k|  return ret;
 1334|  99.4k|}
coucal_fetch_value_hashes:
 1338|   154k|                                        const coucal_hashkeys *hashes) {
 1339|   154k|  size_t pos;
 1340|       |
 1341|       |  /* found at position 1 ? */
 1342|   154k|  pos = coucal_hash_to_pos(hashtable, hashes->hash1);
 1343|   154k|  if (coucal_matches(hashtable, pos, name, hashes)) {
  ------------------
  |  Branch (1343:7): [True: 45.6k, False: 108k]
  ------------------
 1344|  45.6k|    return &hashtable->items[pos].value;
 1345|  45.6k|  }
 1346|       |
 1347|       |  /* found at position 2 ? */
 1348|   108k|  pos = coucal_hash_to_pos(hashtable, hashes->hash2);
 1349|   108k|  if (coucal_matches(hashtable, pos, name, hashes)) {
  ------------------
  |  Branch (1349:7): [True: 24.7k, False: 83.9k]
  ------------------
 1350|  24.7k|    return &hashtable->items[pos].value;
 1351|  24.7k|  }
 1352|       |
 1353|       |  /* find in stash ? */
 1354|  83.9k|  if (hashtable->stash.size != 0) {
  ------------------
  |  Branch (1354:7): [True: 6.46k, False: 77.4k]
  ------------------
 1355|  6.46k|    size_t i;
 1356|  17.6k|    for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (1356:17): [True: 11.2k, False: 6.39k]
  ------------------
 1357|  11.2k|      if (coucal_matches_(hashtable, &hashtable->stash.items[i], name,
  ------------------
  |  Branch (1357:11): [True: 69, False: 11.1k]
  ------------------
 1358|  11.2k|                          hashes)) {
 1359|     69|        return &hashtable->stash.items[i].value;
 1360|     69|      }
 1361|  11.2k|    }
 1362|  6.46k|  }
 1363|       |
 1364|       |  /* not found */
 1365|  83.8k|  return NULL;
 1366|  83.9k|}
coucal_fetch_value:
 1369|   154k|                                                coucal_key_const name) {
 1370|   154k|  const coucal_hashkeys hashes = coucal_calc_hashes(hashtable, name);
 1371|   154k|  return coucal_fetch_value_hashes(hashtable, name, &hashes);
 1372|   154k|}
coucal_read_value:
 1375|   154k|                      coucal_value * pvalue) {
 1376|   154k|  coucal_value* const value = coucal_fetch_value(hashtable, name);
 1377|   154k|  if (value != NULL) {
  ------------------
  |  Branch (1377:7): [True: 70.4k, False: 83.8k]
  ------------------
 1378|  70.4k|    if (pvalue != NULL) {
  ------------------
  |  Branch (1378:9): [True: 49.2k, False: 21.1k]
  ------------------
 1379|  49.2k|      *pvalue = *value;
 1380|  49.2k|    }
 1381|  70.4k|    return 1;
 1382|  70.4k|  }
 1383|  83.8k|  return 0;
 1384|   154k|}
coucal_exists:
 1408|  54.8k|int coucal_exists(coucal hashtable, coucal_key_const name) {
 1409|       |  return coucal_read_value(hashtable, name, NULL);
 1410|  54.8k|}
coucal_new:
 1498|  17.2k|coucal coucal_new(size_t initial_size) {
 1499|  17.2k|  const size_t lg_size = coucal_get_pow2(initial_size);
 1500|  17.2k|  coucal hashtable;
 1501|  17.2k|  coucal_item *items;
 1502|       |
 1503|  17.2k|  if (!coucal_is_acceptable_pow2(lg_size)) {
  ------------------
  |  Branch (1503:7): [True: 0, False: 17.2k]
  ------------------
 1504|      0|    return NULL;
 1505|      0|  }
 1506|       |
 1507|  17.2k|  hashtable = (coucal) calloc(1, sizeof(struct_coucal));
 1508|  17.2k|  items = (coucal_item *) calloc(POW2(lg_size), sizeof(coucal_item));
  ------------------
  |  |  322|  17.2k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1509|       |
 1510|  17.2k|  if (items != NULL && hashtable != NULL) {
  ------------------
  |  Branch (1510:7): [True: 17.2k, False: 0]
  |  Branch (1510:24): [True: 17.2k, False: 0]
  ------------------
 1511|  17.2k|    hashtable->lg_size = lg_size;
 1512|  17.2k|    hashtable->items = items;
 1513|  17.2k|    hashtable->used = 0;
 1514|  17.2k|    hashtable->stash.extent = 0;
 1515|  17.2k|    hashtable->stash.size = 0;
 1516|  17.2k|    hashtable->pool.buffer = NULL;
 1517|  17.2k|    hashtable->pool.size = 0;
 1518|  17.2k|    hashtable->pool.capacity = 0;
 1519|  17.2k|    hashtable->pool.used = 0;
 1520|  17.2k|    hashtable->stats.max_stash_size = 0;
 1521|  17.2k|    hashtable->stats.write_count = 0;
 1522|  17.2k|    hashtable->stats.add_count = 0;
 1523|  17.2k|    hashtable->stats.cuckoo_moved = 0;
 1524|  17.2k|    hashtable->stats.stash_added= 0;
 1525|  17.2k|    hashtable->stats.pool_compact_count = 0;
 1526|  17.2k|    hashtable->stats.pool_realloc_count = 0;
 1527|  17.2k|    hashtable->stats.rehash_count = 0;
 1528|  17.2k|    hashtable->custom.value.free = NULL;
 1529|  17.2k|    hashtable->custom.value.arg = NULL;
 1530|  17.2k|    hashtable->custom.key.dup = NULL;
 1531|  17.2k|    hashtable->custom.key.free = NULL;
 1532|  17.2k|    hashtable->custom.key.hash = NULL;
 1533|  17.2k|    hashtable->custom.key.equals = NULL;
 1534|  17.2k|    hashtable->custom.key.arg = NULL;
 1535|  17.2k|    hashtable->custom.error.log = NULL;
 1536|  17.2k|    hashtable->custom.error.fatal = NULL;
 1537|  17.2k|    hashtable->custom.error.name = NULL;
 1538|  17.2k|    hashtable->custom.error.arg = NULL;
 1539|  17.2k|    hashtable->custom.print.key = NULL;
 1540|  17.2k|    hashtable->custom.print.value = NULL;
 1541|  17.2k|    hashtable->custom.print.arg = NULL;
 1542|  17.2k|    return hashtable;
 1543|  17.2k|  }
 1544|      0|  if (items != NULL) {
  ------------------
  |  Branch (1544:7): [True: 0, False: 0]
  ------------------
 1545|      0|    free(items);
 1546|      0|  }
 1547|      0|  if (hashtable != NULL) {
  ------------------
  |  Branch (1547:7): [True: 0, False: 0]
  ------------------
 1548|      0|    free(hashtable);
 1549|      0|  }
 1550|       |  return NULL;
 1551|  17.2k|}
coucal_set_name:
 1569|  17.2k|void coucal_set_name(coucal hashtable, coucal_key_const name) {
 1570|  17.2k|  hashtable->custom.error.name = name;
 1571|  17.2k|}
coucal_memory_size:
 1619|  17.2k|size_t coucal_memory_size(coucal hashtable) {
 1620|  17.2k|  const size_t size_struct = sizeof(struct_coucal);
 1621|  17.2k|  const size_t hash_size = POW2(hashtable->lg_size)*sizeof(coucal_item);
  ------------------
  |  |  322|  17.2k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1622|  17.2k|  const size_t pool_size = hashtable->pool.capacity*sizeof(char);
 1623|  17.2k|  return size_struct + hash_size + pool_size;
 1624|  17.2k|}
coucal_delete:
 1630|  17.2k|void coucal_delete(coucal *phashtable) {
 1631|  17.2k|  if (phashtable != NULL) {
  ------------------
  |  Branch (1631:7): [True: 17.2k, False: 0]
  ------------------
 1632|  17.2k|    coucal hashtable = *phashtable;
 1633|  17.2k|    if (hashtable != NULL) {
  ------------------
  |  Branch (1633:9): [True: 17.2k, False: 0]
  ------------------
 1634|  17.2k|      coucal_log_stats(hashtable);
 1635|  17.2k|      if (hashtable->items != NULL) {
  ------------------
  |  Branch (1635:11): [True: 17.2k, False: 0]
  ------------------
 1636|       |        /* we need to delete values */
 1637|  17.2k|        const size_t hash_size = POW2(hashtable->lg_size);
  ------------------
  |  |  322|  17.2k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1638|       |        /* internal-pool names go away with the pool buffer below */
 1639|  17.2k|        const int free_names = hashtable->custom.key.free != NULL;
 1640|  17.2k|        size_t i;
 1641|       |
 1642|       |        /* wipe hashtable values (and names, if custom-allocated) */
 1643|   816k|        for(i = 0 ; i < hash_size ; i++) {
  ------------------
  |  Branch (1643:21): [True: 799k, False: 17.2k]
  ------------------
 1644|   799k|          if (!coucal_is_free(hashtable, i)) {
  ------------------
  |  Branch (1644:15): [True: 182k, False: 616k]
  ------------------
 1645|   182k|            coucal_del_value(hashtable, i);
 1646|   182k|            if (free_names) {
  ------------------
  |  Branch (1646:17): [True: 0, False: 182k]
  ------------------
 1647|      0|              coucal_del_name(hashtable, &hashtable->items[i]);
 1648|      0|            }
 1649|   182k|          }
 1650|   799k|        }
 1651|       |
 1652|       |        /* wipe stash values (and names); holes below extent are not live */
 1653|  17.5k|        for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (1653:21): [True: 296, False: 17.2k]
  ------------------
 1654|    296|          coucal_item *const item = &hashtable->stash.items[i];
 1655|    296|          if (item->name != NULL) {
  ------------------
  |  Branch (1655:15): [True: 296, False: 0]
  ------------------
 1656|    296|            coucal_del_value_(hashtable, &item->value);
 1657|    296|            if (free_names) {
  ------------------
  |  Branch (1657:17): [True: 0, False: 296]
  ------------------
 1658|      0|              coucal_del_name(hashtable, item);
 1659|      0|            }
 1660|    296|          }
 1661|    296|        }
 1662|  17.2k|      }
 1663|       |      /* wipe top-level */
 1664|  17.2k|      hashtable->lg_size = 0;
 1665|  17.2k|      hashtable->used = 0;
 1666|  17.2k|      free(hashtable->pool.buffer);
 1667|  17.2k|      hashtable->pool.buffer = NULL;
 1668|  17.2k|      free(hashtable->items);
 1669|  17.2k|      hashtable->items = NULL;
 1670|  17.2k|      free(hashtable);
 1671|       |      *phashtable = NULL;
 1672|  17.2k|    }
 1673|  17.2k|  }
 1674|  17.2k|}
coucal_enum_new:
 1678|  19.4k|struct_coucal_enum coucal_enum_new(coucal hashtable) {
 1679|  19.4k|  struct_coucal_enum e;
 1680|       |
 1681|  19.4k|  e.index = 0;
 1682|  19.4k|  e.table = hashtable;
 1683|  19.4k|  return e;
 1684|  19.4k|}
coucal_enum_next:
 1686|   268k|coucal_item *coucal_enum_next(struct_coucal_enum * e) {
 1687|   268k|  const size_t hash_size = POW2(e->table->lg_size);
  ------------------
  |  |  322|   268k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
 1688|  1.05M|  for( ; e->index < hash_size 
  ------------------
  |  Branch (1688:10): [True: 1.03M, False: 16.8k]
  ------------------
 1689|  1.03M|    && coucal_is_free(e->table, e->index) ; e->index++) ;
  ------------------
  |  Branch (1689:8): [True: 782k, False: 251k]
  ------------------
 1690|       |  /* enumerate all table */
 1691|   268k|  if (e->index < hash_size) {
  ------------------
  |  Branch (1691:7): [True: 251k, False: 16.8k]
  ------------------
 1692|   251k|    coucal_item *const next = &e->table->items[e->index];
 1693|   251k|    e->index++;
 1694|   251k|    return next;
 1695|   251k|  }
 1696|       |  /* enumerate stash if present */
 1697|  16.8k|  for (; e->index < hash_size + e->table->stash.extent &&
  ------------------
  |  Branch (1697:10): [True: 280, False: 16.5k]
  ------------------
 1698|    280|         e->table->stash.items[e->index - hash_size].name == NULL;
  ------------------
  |  Branch (1698:10): [True: 0, False: 280]
  ------------------
 1699|  16.8k|       e->index++)
 1700|      0|    ;
 1701|  16.8k|  if (e->index < hash_size + e->table->stash.extent) {
  ------------------
  |  Branch (1701:7): [True: 280, False: 16.5k]
  ------------------
 1702|    280|    coucal_item *const next = &e->table->stash.items[e->index - hash_size];
 1703|    280|    e->index++;
 1704|    280|    return next;
 1705|    280|  }
 1706|       |  /* eof */
 1707|  16.5k|  return NULL;
 1708|  16.8k|}
coucal_set_global_assert_handler:
 1711|      1|                                      t_coucal_asserthandler fatal) {
 1712|      1|  global_log_handler = log;
 1713|      1|  global_assert_handler = fatal;
 1714|      1|}
htscoucal.c:coucal_write_value_:
  921|   201k|                               coucal_value value) {
  922|   201k|  coucal_item item;
  923|   201k|  size_t pos;
  924|   201k|  const coucal_hashkeys hashes = coucal_calc_hashes(hashtable, name);
  925|       |
  926|       |  /* Statistics */
  927|   201k|  hashtable->stats.write_count++;
  928|       |
  929|       |  /* replace at position 1 ? */
  930|   201k|  pos = coucal_hash_to_pos(hashtable, hashes.hash1);
  931|   201k|  if (coucal_matches(hashtable, pos, name, &hashes)) {
  ------------------
  |  Branch (931:7): [True: 12.0k, False: 189k]
  ------------------
  932|  12.0k|    coucal_del_value(hashtable, pos);
  933|  12.0k|    hashtable->items[pos].value = value;
  934|  12.0k|    return 0;  /* replaced */
  935|  12.0k|  }
  936|       |
  937|       |  /* replace at position 2 ? */
  938|   189k|  pos = coucal_hash_to_pos(hashtable, hashes.hash2);
  939|   189k|  if (coucal_matches(hashtable, pos, name, &hashes)) {
  ------------------
  |  Branch (939:7): [True: 6.77k, False: 183k]
  ------------------
  940|  6.77k|    coucal_del_value(hashtable, pos);
  941|  6.77k|    hashtable->items[pos].value = value;
  942|  6.77k|    return 0;  /* replaced */
  943|  6.77k|  }
  944|       |
  945|       |  /* replace in the stash ? */
  946|   183k|  if (hashtable->stash.size != 0) {
  ------------------
  |  Branch (946:7): [True: 13.9k, False: 169k]
  ------------------
  947|  13.9k|    size_t i;
  948|  38.9k|    for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (948:17): [True: 24.9k, False: 13.9k]
  ------------------
  949|  24.9k|      if (coucal_matches_(hashtable, &hashtable->stash.items[i], name, 
  ------------------
  |  Branch (949:11): [True: 11, False: 24.9k]
  ------------------
  950|  24.9k|                           &hashes)) {
  951|     11|        coucal_del_value_(hashtable, &hashtable->stash.items[i].value);
  952|     11|        hashtable->stash.items[i].value = value;
  953|     11|        return 0;  /* replaced */
  954|     11|      }
  955|  24.9k|    }
  956|  13.9k|  }
  957|       |
  958|       |  /* Statistics */
  959|   182k|  hashtable->stats.add_count++;
  960|       |
  961|       |  /* the write turned out to be an add: reshuffling is allowed from here on */
  962|   182k|  if (hashtable->stash.size != 0) {
  ------------------
  |  Branch (962:7): [True: 13.9k, False: 169k]
  ------------------
  963|  13.9k|    coucal_drain_stash(hashtable);
  964|  13.9k|  }
  965|       |
  966|       |  /* otherwise we need to create a new item */
  967|   182k|  item.name = coucal_dup_name(hashtable, name);
  968|   182k|  item.value = value;
  969|   182k|  item.hashes = hashes;
  970|       |
  971|   182k|  return coucal_add_item_(hashtable, item);
  972|   183k|}
htscoucal.c:coucal_drain_stash:
 1154|  13.9k|static void coucal_drain_stash(coucal hashtable) {
 1155|  13.9k|  size_t i;
 1156|       |
 1157|  38.9k|  for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (1157:15): [True: 24.9k, False: 13.9k]
  ------------------
 1158|  24.9k|    coucal_item *const item = &hashtable->stash.items[i];
 1159|  24.9k|    if (item->name != NULL) {
  ------------------
  |  Branch (1159:9): [True: 24.9k, False: 0]
  ------------------
 1160|  24.9k|      const size_t pos1 = coucal_hash_to_pos(hashtable, item->hashes.hash1);
 1161|  24.9k|      const size_t pos2 = coucal_hash_to_pos(hashtable, item->hashes.hash2);
 1162|  24.9k|      const size_t pos =
 1163|  24.9k|          coucal_is_free(hashtable, pos1)
  ------------------
  |  Branch (1163:11): [True: 0, False: 24.9k]
  ------------------
 1164|  24.9k|              ? pos1
 1165|  24.9k|              : (coucal_is_free(hashtable, pos2) ? pos2 : (size_t) -1);
  ------------------
  |  Branch (1165:18): [True: 0, False: 24.9k]
  ------------------
 1166|  24.9k|      if (pos != (size_t) -1) {
  ------------------
  |  Branch (1166:11): [True: 0, False: 24.9k]
  ------------------
 1167|      0|        hashtable->items[pos] = *item;
 1168|      0|        memset(item, 0, sizeof(*item));
 1169|      0|        hashtable->stash.size--;
 1170|      0|        coucal_debug(hashtable, "debug:moved item from stash (%d entries)",
  ------------------
  |  |  312|      0|#define coucal_debug COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|      0|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1171|      0|                     (int) hashtable->stash.size);
 1172|      0|      }
 1173|  24.9k|    }
 1174|  24.9k|  }
 1175|  13.9k|  while (hashtable->stash.extent != 0 &&
  ------------------
  |  Branch (1175:10): [True: 13.9k, False: 0]
  ------------------
 1176|  13.9k|         hashtable->stash.items[hashtable->stash.extent - 1].name == NULL) {
  ------------------
  |  Branch (1176:10): [True: 0, False: 13.9k]
  ------------------
 1177|      0|    hashtable->stash.extent--;
 1178|      0|  }
 1179|  13.9k|}
htscoucal.c:coucal_dup_name:
  789|   182k|                                                 coucal_key_const name) {
  790|   182k|  return hashtable->custom.key.dup == NULL
  ------------------
  |  Branch (790:10): [True: 182k, False: 0]
  ------------------
  791|   182k|    ? coucal_dup_name_internal(hashtable, name)
  792|   182k|    : hashtable->custom.key.dup(hashtable->custom.key.arg, name);
  793|   182k|}
htscoucal.c:coucal_dup_name_internal:
  735|   182k|                                           coucal_key_const name_) {
  736|   182k|  const char *name = (const char *) name_;
  737|   182k|  const size_t len = strlen(name) + 1;
  738|   182k|  char *staged = NULL;
  739|   182k|  char *s;
  740|       |
  741|       |  /* the pool does not allow empty strings for safety purpose ; handhe that
  742|       |    (keys are being emptied when free'd to detect duplicate free) */
  743|   182k|  if (len == 1) {
  ------------------
  |  Branch (743:7): [True: 285, False: 182k]
  ------------------
  744|       |    /* uintptr_t round-trip: this key alone is const, a cast would discard it */
  745|    285|    return (coucal_key) (uintptr_t) the_empty_string;
  746|    285|  }
  747|       |
  748|       |  /* expand pool capacity */
  749|   182k|  coucal_assert(hashtable, hashtable->pool.size <= hashtable->pool.capacity);
  ------------------
  |  |  253|   182k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 182k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  750|   182k|  if (hashtable->pool.capacity - hashtable->pool.size < len) {
  ------------------
  |  Branch (750:7): [True: 16.0k, False: 166k]
  ------------------
  751|  16.0k|    size_t capacity;
  752|       |
  753|       |    /* growing the pool may relocate or free the block `name` points into */
  754|  16.0k|    if (coucal_is_pooled(hashtable, name)) {
  ------------------
  |  Branch (754:9): [True: 0, False: 16.0k]
  ------------------
  755|      0|      staged = (char *) malloc(len);
  756|      0|      if (staged == NULL) {
  ------------------
  |  Branch (756:11): [True: 0, False: 0]
  ------------------
  757|      0|        coucal_crit(hashtable,
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
  758|      0|                    "** hashtable key staging error: could not allocate "
  759|      0|                    "%" UINT_64_FORMAT " bytes",
  760|      0|                    (uint64_t) len);
  761|      0|        coucal_assert(hashtable, !"hashtable key staging error");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  762|      0|      }
  763|      0|      memcpy(staged, name, len);
  764|      0|      name = staged;
  765|      0|    }
  766|       |
  767|  31.6k|    for(capacity = MIN_POOL_CAPACITY ; capacity < hashtable->pool.size + len
  ------------------
  |  |  125|  16.0k|#define MIN_POOL_CAPACITY 256
  ------------------
  |  Branch (767:40): [True: 15.6k, False: 16.0k]
  ------------------
  768|  16.0k|      ; capacity <<= 1) ;
  769|  16.0k|    coucal_assert(hashtable, hashtable->pool.size < capacity);
  ------------------
  |  |  253|  16.0k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 16.0k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  770|  16.0k|    coucal_realloc_pool(hashtable, capacity);
  771|  16.0k|  }
  772|       |
  773|       |  /* copy */
  774|   182k|  coucal_assert(hashtable, len + hashtable->pool.size <= hashtable->pool.capacity);
  ------------------
  |  |  253|   182k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 182k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  775|   182k|  s = &hashtable->pool.buffer[hashtable->pool.size];
  776|   182k|  memcpy(s, name, len);
  777|   182k|  hashtable->pool.size += len;
  778|   182k|  hashtable->pool.used += len;
  779|       |
  780|   182k|  if (staged != NULL) {
  ------------------
  |  Branch (780:7): [True: 0, False: 182k]
  ------------------
  781|      0|    free(staged);
  782|      0|  }
  783|       |
  784|   182k|  return s;
  785|   182k|}
htscoucal.c:coucal_is_pooled:
  727|  16.0k|                                           const char *name) {
  728|  16.0k|  const uintptr_t base = (uintptr_t) hashtable->pool.buffer;
  729|  16.0k|  const uintptr_t addr = (uintptr_t) name;
  730|  16.0k|  return hashtable->pool.buffer != NULL && addr >= base &&
  ------------------
  |  Branch (730:10): [True: 4.21k, False: 11.8k]
  |  Branch (730:44): [True: 2.26k, False: 1.95k]
  ------------------
  731|  2.26k|         addr - base < hashtable->pool.capacity;
  ------------------
  |  Branch (731:10): [True: 0, False: 2.26k]
  ------------------
  732|  16.0k|}
htscoucal.c:coucal_realloc_pool:
  664|  16.0k|static void coucal_realloc_pool(coucal hashtable, size_t capacity) {
  665|  16.0k|  const size_t hash_size = POW2(hashtable->lg_size);
  ------------------
  |  |  322|  16.0k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  666|       |  /* keep the old base as an integer: after realloc() the old pointer value is
  667|       |     indeterminate and must not be used in pointer arithmetic (-Wuse-after-free) */
  668|  16.0k|  const uintptr_t oldbase = (uintptr_t) hashtable->pool.buffer;
  669|  16.0k|  size_t count = 0;
  670|       |
  671|       |  /* we manage the string pool */
  672|  16.0k|  coucal_assert(hashtable, hashtable->custom.key.dup == NULL);
  ------------------
  |  |  253|  16.0k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 16.0k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  673|       |
  674|       |  /* compact instead ? */
  675|  16.0k|  if (hashtable->pool.used < ( hashtable->pool.size*3 ) / 4) {
  ------------------
  |  Branch (675:7): [True: 0, False: 16.0k]
  ------------------
  676|      0|    coucal_compact_pool(hashtable, capacity);
  677|      0|    return ;
  678|      0|  }
  679|       |
  680|       |  /* statistics */
  681|  16.0k|  hashtable->stats.pool_realloc_count++;
  682|       |
  683|       |  /* change capacity now */
  684|  16.0k|  hashtable->pool.capacity = capacity;
  685|       |
  686|       |  /* realloc */
  687|  16.0k|  hashtable->pool.buffer = realloc(hashtable->pool.buffer,
  688|  16.0k|    hashtable->pool.capacity);
  689|  16.0k|  if (hashtable->pool.buffer == NULL) {
  ------------------
  |  Branch (689:7): [True: 0, False: 16.0k]
  ------------------
  690|      0|    coucal_crit(hashtable,
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
  691|      0|      "** hashtable string pool allocation error: could not allocate "
  692|      0|      "%"UINT_64_FORMAT" bytes", 
  693|      0|      (uint64_t) hashtable->pool.capacity);
  694|      0|    coucal_assert(hashtable, ! "hashtable string pool allocation error");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  695|      0|  }
  696|       |
  697|       |  /* recompute string address */
  698|  16.0k|#define RECOMPUTE_STRING(S) do {                                     \
  699|  16.0k|    if (S != NULL && S != the_empty_string) {                        \
  700|  16.0k|      const size_t offset = (uintptr_t) (const char*) (S) - oldbase; \
  701|  16.0k|      coucal_assert(hashtable, offset < hashtable->pool.capacity);  \
  702|  16.0k|      S = &hashtable->pool.buffer[offset];                           \
  703|  16.0k|      count++;                                                       \
  704|  16.0k|    }                                                                \
  705|  16.0k|} while(0)
  706|       |
  707|       |  /* recompute string addresses */
  708|  16.0k|  if ((uintptr_t) hashtable->pool.buffer != oldbase) {
  ------------------
  |  Branch (708:7): [True: 15.3k, False: 723]
  ------------------
  709|  15.3k|    size_t i;
  710|   761k|    for(i = 0 ; i < hash_size ; i++) {
  ------------------
  |  Branch (710:17): [True: 746k, False: 15.3k]
  ------------------
  711|   746k|      RECOMPUTE_STRING(hashtable->items[i].name);
  ------------------
  |  |  698|   746k|#define RECOMPUTE_STRING(S) do {                                     \
  |  |  699|   746k|    if (S != NULL && S != the_empty_string) {                        \
  |  |  ------------------
  |  |  |  Branch (699:9): [True: 184k, False: 562k]
  |  |  |  Branch (699:22): [True: 183k, False: 237]
  |  |  ------------------
  |  |  700|   183k|      const size_t offset = (uintptr_t) (const char*) (S) - oldbase; \
  |  |  701|   183k|      coucal_assert(hashtable, offset < hashtable->pool.capacity);  \
  |  |  ------------------
  |  |  |  |  253|   183k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (253:11): [True: 183k, False: 0]
  |  |  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  702|   183k|      S = &hashtable->pool.buffer[offset];                           \
  |  |  703|   183k|      count++;                                                       \
  |  |  704|   183k|    }                                                                \
  |  |  705|   746k|} while(0)
  |  |  ------------------
  |  |  |  Branch (705:9): [Folded, False: 746k]
  |  |  ------------------
  ------------------
  712|   746k|    }
  713|  15.6k|    for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (713:17): [True: 300, False: 15.3k]
  ------------------
  714|    300|      RECOMPUTE_STRING(hashtable->stash.items[i].name);
  ------------------
  |  |  698|    300|#define RECOMPUTE_STRING(S) do {                                     \
  |  |  699|    300|    if (S != NULL && S != the_empty_string) {                        \
  |  |  ------------------
  |  |  |  Branch (699:9): [True: 300, False: 0]
  |  |  |  Branch (699:22): [True: 291, False: 9]
  |  |  ------------------
  |  |  700|    291|      const size_t offset = (uintptr_t) (const char*) (S) - oldbase; \
  |  |  701|    291|      coucal_assert(hashtable, offset < hashtable->pool.capacity);  \
  |  |  ------------------
  |  |  |  |  253|    291|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (253:11): [True: 291, False: 0]
  |  |  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  702|    291|      S = &hashtable->pool.buffer[offset];                           \
  |  |  703|    291|      count++;                                                       \
  |  |  704|    291|    }                                                                \
  |  |  705|    300|} while(0)
  |  |  ------------------
  |  |  |  Branch (705:9): [Folded, False: 300]
  |  |  ------------------
  ------------------
  715|    300|    }
  716|  15.3k|  }
  717|       |
  718|  16.0k|#undef RECOMPUTE_STRING
  719|       |
  720|  16.0k|  coucal_debug(hashtable, "reallocated string pool for "
  ------------------
  |  |  312|  16.0k|#define coucal_debug COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  16.0k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  16.0k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 16.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  721|      0|                "%"UINT_64_FORMAT" strings: %"UINT_64_FORMAT" bytes",
  722|      0|                (uint64_t) count, (uint64_t) hashtable->pool.capacity);
  723|  16.0k|}
htscoucal.c:coucal_log:
  357|  17.2k|                       const char *format, va_list args) {
  358|  17.2k|  coucal_assert(hashtable, format != NULL);
  ------------------
  |  |  253|  17.2k|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [True: 17.2k, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  359|  17.2k|  if (hashtable != NULL && hashtable->custom.error.log != NULL) {
  ------------------
  |  Branch (359:7): [True: 17.2k, False: 0]
  |  Branch (359:28): [True: 0, False: 17.2k]
  ------------------
  360|      0|    hashtable->custom.error.log(hashtable->custom.error.arg, level, format, args);
  361|  17.2k|  } else if (global_log_handler != NULL) {
  ------------------
  |  Branch (361:14): [True: 17.2k, False: 0]
  ------------------
  362|  17.2k|    global_log_handler(hashtable, level, format, args);
  363|  17.2k|  } else {
  364|      0|    fprintf(stderr, "[%p] ", (void*) hashtable);
  365|      0|    (void) vfprintf(stderr, format, args);
  366|       |    putc('\n', stderr);
  367|      0|  }
  368|  17.2k|}
htscoucal.c:coucal_is_acceptable_pow2:
 1148|  39.5k|static INTHASH_INLINE int coucal_is_acceptable_pow2(size_t lg_size) {
 1149|  39.5k|  return lg_size <= COUCAL_HASH_SIZE && lg_size < sizeof(size_t)*8;
  ------------------
  |  |  141|  79.1k|#define COUCAL_HASH_SIZE 32
  ------------------
  |  Branch (1149:10): [True: 39.5k, False: 0]
  |  Branch (1149:41): [True: 39.5k, False: 0]
  ------------------
 1150|  39.5k|}
htscoucal.c:coucal_is_free:
  550|  2.77M|static INTHASH_INLINE int coucal_is_free(const coucal hashtable, size_t pos) {
  551|       |  return hashtable->items[pos].name == NULL;
  552|  2.77M|}
htscoucal.c:coucal_hash_to_pos_:
  834|  1.82M|                                                 coucal_hashkey hash) {
  835|       |  /* Both casts are lossless: see coucal_is_acceptable_pow2(). */
  836|  1.82M|  const coucal_hashkey mask = (coucal_hashkey) (POW2(lg_size) - 1);
  ------------------
  |  |  322|  1.82M|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  837|  1.82M|  return (size_t) (hash & mask);
  838|  1.82M|}
htscoucal.c:coucal_hash_to_pos:
  841|  1.47M|                                                coucal_hashkey hash) {
  842|  1.47M|  return coucal_hash_to_pos_(hashtable->lg_size, hash);
  843|  1.47M|}
htscoucal.c:coucal_add_item_:
  983|   184k|static int coucal_add_item_(coucal hashtable, coucal_item item) {
  984|   184k|  coucal_hashkey cuckoo_hash, initial_cuckoo_hash;
  985|   184k|  size_t loops;
  986|   184k|  size_t pos;
  987|       |
  988|       |  /* place at free position 1 ? */
  989|   184k|  pos = coucal_hash_to_pos(hashtable, item.hashes.hash1);
  990|   184k|  if (coucal_is_free(hashtable, pos)) {
  ------------------
  |  Branch (990:7): [True: 123k, False: 60.6k]
  ------------------
  991|   123k|    hashtable->items[pos] = item;
  992|   123k|    return 1; /* added */
  993|   123k|  } else {
  994|       |    /* place at free position 2 ? */
  995|  60.6k|    pos = coucal_hash_to_pos(hashtable, item.hashes.hash2);
  996|  60.6k|    if (coucal_is_free(hashtable, pos)) {
  ------------------
  |  Branch (996:9): [True: 36.9k, False: 23.6k]
  ------------------
  997|  36.9k|      hashtable->items[pos] = item;
  998|  36.9k|      return 1; /* added */
  999|  36.9k|    }
 1000|       |    /* prepare cuckoo ; let's take position 1 */
 1001|  23.6k|    else {
 1002|  23.6k|      cuckoo_hash = initial_cuckoo_hash = item.hashes.hash1;
 1003|  23.6k|      coucal_trace(hashtable,
  ------------------
  |  |  318|  23.6k|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  23.6k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  23.6k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 23.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1004|      0|                    "debug:collision with '%s' at %"UINT_64_FORMAT
 1005|      0|                    " (%"UINT_64_HEX_FORMAT")",
 1006|      0|                     coucal_print_key(hashtable, item.name),
 1007|      0|                     (uint64_t) pos, (uint64_t) cuckoo_hash);
 1008|  23.6k|    }
 1009|  60.6k|  }
 1010|       |
 1011|       |  /* put 'item' in place with hash 'cuckoo_hash' */
 1012|   126k|  for(loops = POW2(hashtable->lg_size) ; loops != 0 ; --loops) {
  ------------------
  |  |  322|  23.6k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  |  Branch (1012:42): [True: 126k, False: 176]
  ------------------
 1013|   126k|    const size_t pos = coucal_hash_to_pos(hashtable, cuckoo_hash);
 1014|       |
 1015|   126k|    coucal_trace(hashtable,
  ------------------
  |  |  318|   126k|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|   126k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|   126k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 126k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|      0|                  "\tdebug:placing cuckoo '%s' at %"UINT_64_FORMAT
 1017|      0|                  " (%"UINT_64_HEX_FORMAT")",
 1018|      0|                  coucal_print_key(hashtable, item.name),
 1019|      0|                  (uint64_t) pos, (uint64_t) cuckoo_hash);
 1020|       |
 1021|       |    /* place at alternate free position ? */
 1022|   126k|    if (coucal_is_free(hashtable, pos)) {
  ------------------
  |  Branch (1022:9): [True: 21.9k, False: 104k]
  ------------------
 1023|  21.9k|      coucal_trace(hashtable, "debug:free position");
  ------------------
  |  |  318|  21.9k|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  21.9k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  21.9k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 21.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|  21.9k|      hashtable->items[pos] = item;
 1025|  21.9k|      return 1; /* added */
 1026|  21.9k|    }
 1027|       |    /* then cuckoo's place it is */
 1028|   104k|    else {
 1029|       |      /* replace */
 1030|   104k|      const coucal_item backup_item = hashtable->items[pos];
 1031|   104k|      hashtable->items[pos] = item;
 1032|       |
 1033|       |      /* statistics */
 1034|   104k|      hashtable->stats.cuckoo_moved++;
 1035|       |
 1036|       |      /* take care of new lost item */
 1037|   104k|      item = backup_item;
 1038|       |
 1039|       |      /* we just kicked this item from its position 1 */
 1040|   104k|      if (pos == coucal_hash_to_pos(hashtable, item.hashes.hash1)) {
  ------------------
  |  Branch (1040:11): [True: 64.1k, False: 39.9k]
  ------------------
 1041|       |        /* then place it on position 2 on next run */
 1042|  64.1k|        coucal_trace(hashtable, "\tdebug:position 1");
  ------------------
  |  |  318|  64.1k|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  64.1k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  64.1k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 64.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  64.1k|        cuckoo_hash = item.hashes.hash2;
 1044|  64.1k|      }
 1045|       |      /* we just kicked this item from its position 2 */
 1046|  39.9k|      else if (pos == coucal_hash_to_pos(hashtable, item.hashes.hash2)) {
  ------------------
  |  Branch (1046:16): [True: 39.9k, False: 0]
  ------------------
 1047|       |        /* then place it on position 1 on next run */
 1048|  39.9k|        coucal_trace(hashtable, "\tdebug:position 2");
  ------------------
  |  |  318|  39.9k|#define coucal_trace COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  39.9k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  39.9k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 39.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1049|  39.9k|        cuckoo_hash = item.hashes.hash1;
 1050|  39.9k|      }
 1051|      0|      else {
 1052|      0|        coucal_assert(hashtable, ! "hashtable internal error: unexpected position");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1053|      0|      }
 1054|       |
 1055|       |      /* we are looping (back to same hash) */
 1056|       |      /* TODO FIXME: we should actually check the positions */
 1057|   104k|      if (cuckoo_hash == initial_cuckoo_hash) {
  ------------------
  |  Branch (1057:11): [True: 1.48k, False: 102k]
  ------------------
 1058|       |        /* emergency stash */
 1059|  1.48k|        break;
 1060|  1.48k|      }
 1061|   104k|    }
 1062|   126k|  }
 1063|       |
 1064|       |  /* emergency stashing for the rare cases of collisions */
 1065|  1.66k|  if (hashtable->stash.size < STASH_SIZE) {
  ------------------
  |  |  119|  1.66k|#define STASH_SIZE 16
  ------------------
  |  Branch (1065:7): [True: 1.66k, False: 0]
  ------------------
 1066|  1.66k|    size_t i;
 1067|  1.66k|    for (i = 0;
 1068|  3.05k|         i < hashtable->stash.extent && hashtable->stash.items[i].name != NULL;
  ------------------
  |  Branch (1068:10): [True: 1.39k, False: 1.66k]
  |  Branch (1068:41): [True: 1.39k, False: 0]
  ------------------
 1069|  1.66k|         i++)
 1070|  1.39k|      ;
 1071|  1.66k|    if (i == hashtable->stash.extent) {
  ------------------
  |  Branch (1071:9): [True: 1.66k, False: 0]
  ------------------
 1072|  1.66k|      hashtable->stash.extent++;
 1073|  1.66k|    }
 1074|  1.66k|    hashtable->stash.items[i] = item;
 1075|  1.66k|    hashtable->stash.size++;
 1076|       |    /* for statistics */
 1077|  1.66k|    hashtable->stats.stash_added++;
 1078|  1.66k|    if (hashtable->stash.size > hashtable->stats.max_stash_size) {
  ------------------
  |  Branch (1078:9): [True: 1.12k, False: 542]
  ------------------
 1079|  1.12k|      hashtable->stats.max_stash_size = hashtable->stash.size;
 1080|  1.12k|    }
 1081|  1.66k|    coucal_debug(hashtable, "used stash because of collision (%d entries)",
  ------------------
  |  |  312|  1.66k|#define coucal_debug COUCAL_NO_LOG
  |  |  ------------------
  |  |  |  |  285|  1.66k|#define COUCAL_NO_LOG COUCAL_NEVER coucal_nolog
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  1.66k|#define COUCAL_NEVER while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (284:29): [Folded, False: 1.66k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1082|      0|                  (int) hashtable->stash.size);
 1083|  1.66k|    return 1; /* added */
 1084|  1.66k|  } else {
 1085|       |    /* debugging */
 1086|      0|    if (hashtable->custom.print.key != NULL 
  ------------------
  |  Branch (1086:9): [True: 0, False: 0]
  ------------------
 1087|      0|      && hashtable->custom.print.value != NULL) {
  ------------------
  |  Branch (1087:10): [True: 0, False: 0]
  ------------------
 1088|      0|      size_t i;
 1089|      0|      for (i = 0; i < hashtable->stash.extent; i++) {
  ------------------
  |  Branch (1089:19): [True: 0, False: 0]
  ------------------
 1090|      0|        coucal_item *const item = &hashtable->stash.items[i];
 1091|      0|        const size_t pos1 = coucal_hash_to_pos(hashtable, item->hashes.hash1);
 1092|      0|        const size_t pos2 = coucal_hash_to_pos(hashtable, item->hashes.hash2);
 1093|      0|        if (item->name == NULL) {
  ------------------
  |  Branch (1093:13): [True: 0, False: 0]
  ------------------
 1094|      0|          continue;
 1095|      0|        }
 1096|      0|        coucal_crit(hashtable,
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1097|      0|                    "stash[%d]: key='%s' value='%s' pos1=%d pos2=%d"
 1098|      0|                    " hash1=%04" UINT_64_HEX_FORMAT
 1099|      0|                    " hash2=%04" UINT_64_HEX_FORMAT,
  ------------------
  |  |  146|      0|#define UINT_64_HEX_FORMAT PRIx64
  ------------------
 1100|      0|                    (int) i,
 1101|      0|                    hashtable->custom.print.key(hashtable->custom.print.arg,
 1102|      0|                                                item->name),
 1103|      0|                    hashtable->custom.print.value(hashtable->custom.print.arg,
 1104|      0|                                                  item->value),
 1105|      0|                    (int) pos1, (int) pos2, (uint64_t) item->hashes.hash1,
 1106|      0|                    (uint64_t) item->hashes.hash2);
 1107|      0|        if (!coucal_is_free(hashtable, pos1)) {
  ------------------
  |  Branch (1107:13): [True: 0, False: 0]
  ------------------
 1108|      0|          coucal_item *const item = &hashtable->items[pos1];
 1109|      0|          const size_t pos1 = coucal_hash_to_pos(hashtable, item->hashes.hash1);
 1110|      0|          const size_t pos2 = coucal_hash_to_pos(hashtable, item->hashes.hash2);
 1111|      0|          coucal_crit(hashtable, 
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1112|      0|            "\t.. collisionning with key='%s' value='%s' pos1=%d pos2=%d"
 1113|      0|            " hash1=%04"UINT_64_HEX_FORMAT" hash2=%04"UINT_64_HEX_FORMAT,
  ------------------
  |  |  146|      0|#define UINT_64_HEX_FORMAT PRIx64
  ------------------
 1114|      0|            hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
 1115|      0|            hashtable->custom.print.value(hashtable->custom.print.arg, item->value),
 1116|      0|            (int) pos1, (int) pos2,
 1117|      0|            (uint64_t) item->hashes.hash1, (uint64_t) item->hashes.hash2);
 1118|      0|        } else {
 1119|      0|          coucal_crit(hashtable, "\t.. collisionning with a free slot (%d)!", (int) pos1);
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1120|      0|        }
 1121|      0|        if (!coucal_is_free(hashtable, pos2)) {
  ------------------
  |  Branch (1121:13): [True: 0, False: 0]
  ------------------
 1122|      0|          coucal_item *const item = &hashtable->items[pos2];
 1123|      0|          const size_t pos1 = coucal_hash_to_pos(hashtable, item->hashes.hash1);
 1124|      0|          const size_t pos2 = coucal_hash_to_pos(hashtable, item->hashes.hash2);
 1125|      0|          coucal_crit(hashtable, 
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1126|      0|            "\t.. collisionning with key='%s' value='%s' pos1=%d pos2=%d"
 1127|      0|            " hash1=%04"UINT_64_HEX_FORMAT" hash2=%04"UINT_64_HEX_FORMAT,
  ------------------
  |  |  146|      0|#define UINT_64_HEX_FORMAT PRIx64
  ------------------
 1128|      0|            hashtable->custom.print.key(hashtable->custom.print.arg, item->name),
 1129|      0|            hashtable->custom.print.value(hashtable->custom.print.arg, item->value),
 1130|      0|            (int) pos1, (int) pos2,
 1131|      0|            (uint64_t) item->hashes.hash1, (uint64_t) item->hashes.hash2);
 1132|      0|        } else {
 1133|      0|          coucal_crit(hashtable, "\t.. collisionning with a free slot (%d)!", (int) pos2);
  ------------------
  |  |  295|      0|#define coucal_crit coucal_do_crit
  ------------------
 1134|      0|        }
 1135|      0|      }
 1136|      0|    }
 1137|       |
 1138|       |    /* we are doomed. hopefully the probability is lower than being killed
 1139|       |       by a wandering radioactive monkey */
 1140|      0|    coucal_log_stats(hashtable);
 1141|      0|    coucal_assert(hashtable, ! "hashtable internal error: cuckoo/stash collision");
  ------------------
  |  |  253|      0|  (void)( (EXP) || (coucal_assert_failed(HASHTABLE, #EXP, __FILE__, __LINE__), 0) )
  |  |  ------------------
  |  |  |  Branch (253:11): [Folded, False: 0]
  |  |  |  Branch (253:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1142|       |
 1143|       |    /* not reachable code */
 1144|      0|    return -1;
 1145|      0|  }
 1146|  1.66k|}
htscoucal.c:coucal_matches:
  575|   654k|                                         const coucal_hashkeys *hashes) {
  576|   654k|  const coucal_item *const item = &hashtable->items[pos];
  577|   654k|  return coucal_matches_(hashtable, item, name, hashes);
  578|   654k|}
htscoucal.c:coucal_matches_:
  566|   690k|                                          const coucal_hashkeys *hashes) {
  567|   690k|  return item->name != NULL
  ------------------
  |  Branch (567:10): [True: 320k, False: 370k]
  ------------------
  568|   320k|    && item->hashes.hash1 == hashes->hash1
  ------------------
  |  Branch (568:8): [True: 89.2k, False: 231k]
  ------------------
  569|  89.2k|    && item->hashes.hash2 == hashes->hash2
  ------------------
  |  Branch (569:8): [True: 89.2k, False: 11]
  ------------------
  570|  89.2k|    && coucal_equals(hashtable, item->name, name);
  ------------------
  |  Branch (570:8): [True: 89.2k, False: 0]
  ------------------
  571|   690k|}
htscoucal.c:coucal_equals:
  557|  89.2k|                                        coucal_key_const b) {
  558|  89.2k|  return hashtable->custom.key.equals == NULL
  ------------------
  |  Branch (558:10): [True: 89.2k, False: 0]
  ------------------
  559|  89.2k|    ? strcmp((const char*) a, (const char*) b) == 0
  560|  89.2k|    : hashtable->custom.key.equals(hashtable->custom.key.arg, a, b);
  561|  89.2k|}
htscoucal.c:coucal_get_pow2:
 1489|  17.2k|static INTHASH_INLINE size_t coucal_get_pow2(size_t initial_size) {
 1490|  17.2k|  size_t size;
 1491|       |  /* short-circuit: POW2() must never shift by the width of size_t */
 1492|  17.2k|  for (size = MIN_LG_SIZE;
  ------------------
  |  |  122|  17.2k|#define MIN_LG_SIZE 4
  ------------------
 1493|  17.2k|       coucal_is_acceptable_pow2(size) && POW2(size) < initial_size; size++)
  ------------------
  |  |  322|  17.2k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  |  Branch (1493:8): [True: 17.2k, False: 0]
  |  Branch (1493:43): [True: 0, False: 17.2k]
  ------------------
 1494|      0|    ;
 1495|  17.2k|  return size;
 1496|  17.2k|}
htscoucal.c:coucal_log_stats:
  385|  17.2k|static void coucal_log_stats(coucal hashtable) {
  386|  17.2k|  const char *const name = coucal_get_name(hashtable);
  387|  17.2k|  const double avg_moved =
  388|  17.2k|      hashtable->stats.add_count != 0
  ------------------
  |  Branch (388:7): [True: 11.8k, False: 5.43k]
  ------------------
  389|  17.2k|          ? (double) hashtable->stats.cuckoo_moved / hashtable->stats.add_count
  390|  17.2k|          : 0.0;
  391|       |  /* clang-format off */
  392|  17.2k|  coucal_info(hashtable, "hashtable %s%s%ssummary: "
  ------------------
  |  |  304|  17.2k|#define coucal_info coucal_do_info
  ------------------
  393|  17.2k|               "size=%"UINT_64_FORMAT" (lg2=%"UINT_64_FORMAT") "
  394|  17.2k|               "used=%"UINT_64_FORMAT" "
  395|  17.2k|               "stash-size=%"UINT_64_FORMAT" "
  396|  17.2k|               "pool-size=%"UINT_64_FORMAT" "
  397|  17.2k|               "pool-capacity=%"UINT_64_FORMAT" "
  398|  17.2k|               "pool-used=%"UINT_64_FORMAT" "
  399|  17.2k|               "writes=%"UINT_64_FORMAT" "
  400|  17.2k|               "(new=%"UINT_64_FORMAT") "
  401|  17.2k|               "moved=%"UINT_64_FORMAT " "
  402|  17.2k|               "stashed=%"UINT_64_FORMAT" "
  403|  17.2k|               "max-stash-size=%"UINT_64_FORMAT" "
  404|  17.2k|               "avg-moved=%g "
  405|  17.2k|               "rehash=%"UINT_64_FORMAT" "
  406|  17.2k|               "pool-compact=%"UINT_64_FORMAT" "
  407|  17.2k|               "pool-realloc=%"UINT_64_FORMAT" "
  408|  17.2k|               "memory=%"UINT_64_FORMAT,
  ------------------
  |  |  141|  17.2k|#define UINT_64_FORMAT PRIu64
  ------------------
  409|  17.2k|               name != NULL ? "\"" : "",
  ------------------
  |  Branch (409:16): [True: 17.2k, False: 0]
  ------------------
  410|  17.2k|               name != NULL ? name : "",
  ------------------
  |  Branch (410:16): [True: 17.2k, False: 0]
  ------------------
  411|  17.2k|               name != NULL ? "\" " : "",
  ------------------
  |  Branch (411:16): [True: 17.2k, False: 0]
  ------------------
  412|  17.2k|               (uint64_t) POW2(hashtable->lg_size),
  ------------------
  |  |  322|  17.2k|#define POW2(X) ( (size_t) 1 << (X) )
  ------------------
  413|  17.2k|               (uint64_t) hashtable->lg_size,
  414|  17.2k|               (uint64_t) hashtable->used,
  415|  17.2k|               (uint64_t) hashtable->stash.size,
  416|  17.2k|               (uint64_t) hashtable->pool.size,
  417|  17.2k|               (uint64_t) hashtable->pool.capacity,
  418|  17.2k|               (uint64_t) hashtable->pool.used,
  419|  17.2k|               (uint64_t) hashtable->stats.write_count,
  420|  17.2k|               (uint64_t) hashtable->stats.add_count,
  421|  17.2k|               (uint64_t) hashtable->stats.cuckoo_moved,
  422|  17.2k|               (uint64_t) hashtable->stats.stash_added,
  423|  17.2k|               (uint64_t) hashtable->stats.max_stash_size,
  424|  17.2k|               avg_moved,
  425|  17.2k|               (uint64_t) hashtable->stats.rehash_count,
  426|  17.2k|               (uint64_t) hashtable->stats.pool_compact_count,
  427|  17.2k|               (uint64_t) hashtable->stats.pool_realloc_count,
  428|  17.2k|               (uint64_t) coucal_memory_size(hashtable)
  429|  17.2k|               );
  430|       |  /* clang-format on */
  431|  17.2k|}
htscoucal.c:coucal_del_value:
  898|   201k|static INTHASH_INLINE void coucal_del_value(coucal hashtable, size_t pos) {
  899|   201k|  coucal_del_value_(hashtable, &hashtable->items[pos].value);
  900|   201k|}
htscoucal.c:coucal_del_value_:
  890|   201k|static INTHASH_INLINE void coucal_del_value_(coucal hashtable, coucal_value *pvalue) {
  891|   201k|  if (pvalue->ptr != NULL) {
  ------------------
  |  Branch (891:7): [True: 68.5k, False: 133k]
  ------------------
  892|  68.5k|    if (hashtable->custom.value.free != NULL)
  ------------------
  |  Branch (892:9): [True: 0, False: 68.5k]
  ------------------
  893|      0|      hashtable->custom.value.free(hashtable->custom.value.arg, *pvalue);
  894|       |    pvalue->ptr = NULL;
  895|  68.5k|  }
  896|   201k|}

htscoucal.c:MurmurHash3_x86_128:
   52|   356k|                                uint32_t seed, void *out) {
   53|   356k|  const uint8_t * data = (const uint8_t*)key;
   54|   356k|  const ptrdiff_t nblocks = (ptrdiff_t) (len / 16);
   55|       |
   56|   356k|  uint32_t h1 = seed;
   57|   356k|  uint32_t h2 = seed;
   58|   356k|  uint32_t h3 = seed;
   59|   356k|  uint32_t h4 = seed;
   60|       |
   61|   356k|  const uint32_t c1 = 0x239b961b; 
   62|   356k|  const uint32_t c2 = 0xab0e9789;
   63|   356k|  const uint32_t c3 = 0x38b34ae5; 
   64|   356k|  const uint32_t c4 = 0xa1e38b93;
   65|       |
   66|   356k|  const uint8_t * blocks = data + nblocks*16;
   67|   356k|  ptrdiff_t i;
   68|       |
   69|  2.67M|  for(i = -nblocks; i; i++)
  ------------------
  |  Branch (69:21): [True: 2.31M, False: 356k]
  ------------------
   70|  2.31M|  {
   71|  2.31M|    uint32_t k1 = getblock32(blocks,i*4+0);
   72|  2.31M|    uint32_t k2 = getblock32(blocks,i*4+1);
   73|  2.31M|    uint32_t k3 = getblock32(blocks,i*4+2);
   74|  2.31M|    uint32_t k4 = getblock32(blocks,i*4+3);
   75|       |
   76|  2.31M|    k1 *= c1; k1  = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   77|       |
   78|  2.31M|    h1 = ROTL32(h1,19); h1 += h2; h1 = h1*5+0x561ccd1b;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   79|       |
   80|  2.31M|    k2 *= c2; k2  = ROTL32(k2,16); k2 *= c3; h2 ^= k2;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   81|       |
   82|  2.31M|    h2 = ROTL32(h2,17); h2 += h3; h2 = h2*5+0x0bcaa747;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   83|       |
   84|  2.31M|    k3 *= c3; k3  = ROTL32(k3,17); k3 *= c4; h3 ^= k3;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   85|       |
   86|  2.31M|    h3 = ROTL32(h3,15); h3 += h4; h3 = h3*5+0x96cd1c35;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   87|       |
   88|  2.31M|    k4 *= c4; k4  = ROTL32(k4,18); k4 *= c1; h4 ^= k4;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   89|       |
   90|  2.31M|    h4 = ROTL32(h4,13); h4 += h1; h4 = h4*5+0x32ac3b17;
  ------------------
  |  |   31|  2.31M|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
   91|  2.31M|  }
   92|       |
   93|   356k|  {
   94|   356k|  const uint8_t * tail = (const uint8_t*)(data + nblocks*16);
   95|       |
   96|   356k|  uint32_t k1 = 0;
   97|   356k|  uint32_t k2 = 0;
   98|   356k|  uint32_t k3 = 0;
   99|   356k|  uint32_t k4 = 0;
  100|       |
  101|       |  /* deliberate fall-through; widen each byte to uint32_t so a high byte shifted
  102|       |     left 24 can't overflow signed int (UBSan) */
  103|   356k|#if defined(__GNUC__) || defined(__clang__)
  104|   356k|#pragma GCC diagnostic push
  105|   356k|#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
  106|   356k|#endif
  107|   356k|  switch(len & 15)
  ------------------
  |  Branch (107:10): [True: 336k, False: 19.9k]
  ------------------
  108|   356k|  {
  109|  14.9k|  case 15: k4 ^= (uint32_t)tail[14] << 16;
  ------------------
  |  Branch (109:3): [True: 14.9k, False: 341k]
  ------------------
  110|  30.4k|  case 14: k4 ^= (uint32_t)tail[13] << 8;
  ------------------
  |  Branch (110:3): [True: 15.4k, False: 340k]
  ------------------
  111|  47.4k|  case 13: k4 ^= (uint32_t)tail[12] << 0;
  ------------------
  |  Branch (111:3): [True: 16.9k, False: 339k]
  ------------------
  112|  47.4k|           k4 *= c4; k4  = ROTL32(k4,18); k4 *= c1; h4 ^= k4;
  ------------------
  |  |   31|  47.4k|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
  113|       |
  114|  67.1k|  case 12: k3 ^= (uint32_t)tail[11] << 24;
  ------------------
  |  Branch (114:3): [True: 19.6k, False: 336k]
  ------------------
  115|  91.7k|  case 11: k3 ^= (uint32_t)tail[10] << 16;
  ------------------
  |  Branch (115:3): [True: 24.6k, False: 331k]
  ------------------
  116|   115k|  case 10: k3 ^= (uint32_t)tail[ 9] << 8;
  ------------------
  |  Branch (116:3): [True: 24.2k, False: 331k]
  ------------------
  117|   139k|  case  9: k3 ^= (uint32_t)tail[ 8] << 0;
  ------------------
  |  Branch (117:3): [True: 23.8k, False: 332k]
  ------------------
  118|   139k|           k3 *= c3; k3  = ROTL32(k3,17); k3 *= c4; h3 ^= k3;
  ------------------
  |  |   31|   139k|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
  119|       |
  120|   165k|  case  8: k2 ^= (uint32_t)tail[ 7] << 24;
  ------------------
  |  Branch (120:3): [True: 25.4k, False: 330k]
  ------------------
  121|   193k|  case  7: k2 ^= (uint32_t)tail[ 6] << 16;
  ------------------
  |  Branch (121:3): [True: 28.4k, False: 327k]
  ------------------
  122|   226k|  case  6: k2 ^= (uint32_t)tail[ 5] << 8;
  ------------------
  |  Branch (122:3): [True: 33.0k, False: 323k]
  ------------------
  123|   265k|  case  5: k2 ^= (uint32_t)tail[ 4] << 0;
  ------------------
  |  Branch (123:3): [True: 38.8k, False: 317k]
  ------------------
  124|   265k|           k2 *= c2; k2  = ROTL32(k2,16); k2 *= c3; h2 ^= k2;
  ------------------
  |  |   31|   265k|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
  125|       |
  126|   287k|  case  4: k1 ^= (uint32_t)tail[ 3] << 24;
  ------------------
  |  Branch (126:3): [True: 22.1k, False: 333k]
  ------------------
  127|   302k|  case  3: k1 ^= (uint32_t)tail[ 2] << 16;
  ------------------
  |  Branch (127:3): [True: 14.8k, False: 341k]
  ------------------
  128|   318k|  case  2: k1 ^= (uint32_t)tail[ 1] << 8;
  ------------------
  |  Branch (128:3): [True: 16.0k, False: 340k]
  ------------------
  129|   336k|  case  1: k1 ^= (uint32_t)tail[ 0] << 0;
  ------------------
  |  Branch (129:3): [True: 17.5k, False: 338k]
  ------------------
  130|   336k|           k1 *= c1; k1  = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
  ------------------
  |  |   31|   336k|#define ROTL32(x,y)     rotl32(x,y)
  ------------------
  131|   356k|  };
  132|   356k|#if defined(__GNUC__) || defined(__clang__)
  133|   356k|#pragma GCC diagnostic pop
  134|   356k|#endif
  135|       |
  136|   356k|  h1 ^= (uint32_t) len;
  137|   356k|  h2 ^= (uint32_t) len;
  138|   356k|  h3 ^= (uint32_t) len;
  139|   356k|  h4 ^= (uint32_t) len;
  140|       |
  141|   356k|  h1 += h2; h1 += h3; h1 += h4;
  142|   356k|  h2 += h1; h3 += h1; h4 += h1;
  143|       |
  144|   356k|  h1 = fmix32(h1);
  145|   356k|  h2 = fmix32(h2);
  146|   356k|  h3 = fmix32(h3);
  147|   356k|  h4 = fmix32(h4);
  148|       |
  149|   356k|  h1 += h2; h1 += h3; h1 += h4;
  150|   356k|  h2 += h1; h3 += h1; h4 += h1;
  151|       |
  152|   356k|  ((uint32_t*)out)[0] = h1;
  153|   356k|  ((uint32_t*)out)[1] = h2;
  154|   356k|  ((uint32_t*)out)[2] = h3;
  155|   356k|  ((uint32_t*)out)[3] = h4;
  156|   356k|  }
  157|   356k|}
htscoucal.c:getblock32:
   32|  9.26M|static uint32_t getblock32(const uint8_t *p, ptrdiff_t i) {
   33|       |  /* memcpy the 32-bit block: defined on any alignment, and lowered to the same
   34|       |     single load as p[i] on hosts that tolerate unaligned access. */
   35|  9.26M|  uint32_t v;
   36|  9.26M|  memcpy(&v, p + i * 4, sizeof(v));
   37|  9.26M|  return v;
   38|  9.26M|}
htscoucal.c:rotl32:
   28|  19.3M|{
   29|  19.3M|  return (x << r) | (x >> (32 - r));
   30|  19.3M|}
htscoucal.c:fmix32:
   40|  1.42M|{
   41|  1.42M|  h ^= h >> 16;
   42|  1.42M|  h *= 0x85ebca6b;
   43|  1.42M|  h ^= h >> 13;
   44|  1.42M|  h *= 0xc2b2ae35;
   45|  1.42M|  h ^= h >> 16;
   46|       |
   47|  1.42M|  return h;
   48|  1.42M|}

fuzz-arc.c:hts_buf_printf_clip:
  179|      1|    hts_buf b, HTS_FORMAT_STRING const char *fmt, ...) {
  180|      1|  va_list args;
  181|       |
  182|      1|  va_start(args, fmt);
  183|      1|  (void) vslprintfbuff(b.p, b.size, fmt, args);
  184|       |  va_end(args);
  185|      1|}
fuzz-arc.c:hts_buf_at:
   53|      1|static HTS_INLINE HTS_UNUSED hts_buf hts_buf_at(char *p, size_t size) {
   54|      1|  hts_buf b;
   55|       |
   56|      1|  b.p = p;
   57|      1|  b.size = size;
   58|      1|  return b;
   59|      1|}
store.c:hts_buf_at:
   53|  2.14M|static HTS_INLINE HTS_UNUSED hts_buf hts_buf_at(char *p, size_t size) {
   54|  2.14M|  hts_buf b;
   55|       |
   56|  2.14M|  b.p = p;
   57|  2.14M|  b.size = size;
   58|  2.14M|  return b;
   59|  2.14M|}
store.c:hts_buf_printf:
  167|  49.7k|    hts_buf_printf(hts_buf b, HTS_FORMAT_STRING const char *fmt, ...) {
  168|  49.7k|  va_list args;
  169|  49.7k|  hts_boolean fit;
  170|       |
  171|  49.7k|  va_start(args, fmt);
  172|  49.7k|  fit = vslprintfbuff(b.p, b.size, fmt, args);
  173|       |  va_end(args);
  174|  49.7k|  return fit;
  175|  49.7k|}
store.c:hts_buf_put_span_clip:
  154|  77.2k|hts_buf_put_span_clip(hts_buf b, hts_span s) {
  155|  77.2k|  size_t n;
  156|       |
  157|  77.2k|  if (b.size == 0)
  ------------------
  |  Branch (157:7): [True: 0, False: 77.2k]
  ------------------
  158|      0|    return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  159|  77.2k|  n = s.len < b.size ? s.len : b.size - 1;
  ------------------
  |  Branch (159:7): [True: 77.2k, False: 0]
  ------------------
  160|  77.2k|  memcpy(b.p, s.p, n);
  161|  77.2k|  b.p[n] = '\0';
  162|  77.2k|  return n == s.len;
  163|  77.2k|}
store.c:hts_buf_printf_clip:
  179|  2.93k|    hts_buf b, HTS_FORMAT_STRING const char *fmt, ...) {
  180|  2.93k|  va_list args;
  181|       |
  182|  2.93k|  va_start(args, fmt);
  183|  2.93k|  (void) vslprintfbuff(b.p, b.size, fmt, args);
  184|       |  va_end(args);
  185|  2.93k|}

store.c:hts_cache_store_field:
  116|  3.05M|                      const char *name, const char *value) {
  117|  3.05M|  size_t i;
  118|       |
  119|  21.3M|  for (i = 0; i < count && !hts_streq_ci(name, fields[i].name); i++) {
  ------------------
  |  Branch (119:15): [True: 18.3M, False: 3.05M]
  |  Branch (119:28): [True: 18.3M, False: 4.72k]
  ------------------
  120|  18.3M|  }
  121|  3.05M|  if (i == count) {
  ------------------
  |  Branch (121:7): [True: 3.05M, False: 4.72k]
  ------------------
  122|  3.05M|    return HTS_FALSE;
  ------------------
  |  |  380|  3.05M|#define HTS_FALSE 0
  ------------------
  123|  3.05M|  } else if (fields[i].kind == HTS_CACHE_FIELD_INT) {
  ------------------
  |  Branch (123:14): [True: 0, False: 4.72k]
  ------------------
  124|      0|    int intval = 0;
  125|       |
  126|      0|    sscanf(value, "%d", &intval);
  127|      0|    *(int *) fields[i].dest = intval;
  128|  4.72k|  } else if (fields[i].kind == HTS_CACHE_FIELD_LLINT) {
  ------------------
  |  Branch (128:14): [True: 2.46k, False: 2.25k]
  ------------------
  129|  2.46k|    LLint intval = 0;
  130|       |
  131|  2.46k|    sscanf(value, LLintP, &intval);
  ------------------
  |  |  490|  2.46k|#define LLintP "%" PRId64
  ------------------
  132|  2.46k|    *(LLint *) fields[i].dest = intval;
  133|  2.46k|  } else if (fields[i].kind == HTS_CACHE_FIELD_STRING) {
  ------------------
  |  Branch (133:14): [True: 2.25k, False: 0]
  ------------------
  134|       |    /* a corrupt cache can carry a field wider than ours; clipping keeps the
  135|       |       entry, where aborting would take the crawl down */
  136|  2.25k|    (void) strclipbuff((char *) fields[i].dest, fields[i].dest_size, value);
  137|  2.25k|  }
  138|  4.72k|  return HTS_TRUE;
  ------------------
  |  |  381|  4.72k|#define HTS_TRUE 1
  ------------------
  139|  3.05M|}

store.c:hts_strcasecmp:
   94|  18.4M|static HTS_INLINE HTS_UNUSED int hts_strcasecmp(const char *a, const char *b) {
   95|  18.4M|  return hts_strncasecmp(a, b, (size_t) -1);
   96|  18.4M|}
store.c:hts_strncasecmp:
   83|  18.4M|                                                 size_t n) {
   84|  18.7M|  for (; n != 0; a++, b++, n--) {
  ------------------
  |  Branch (84:10): [True: 18.7M, False: 0]
  ------------------
   85|  18.7M|    const int ca = hts_tolower((unsigned char) *a);
   86|  18.7M|    const int cb = hts_tolower((unsigned char) *b);
   87|       |
   88|  18.7M|    if (ca != cb || ca == '\0')
  ------------------
  |  Branch (88:9): [True: 18.4M, False: 298k]
  |  Branch (88:21): [True: 11.9k, False: 286k]
  ------------------
   89|  18.4M|      return ca - cb;
   90|  18.7M|  }
   91|      0|  return 0;
   92|  18.4M|}
store.c:hts_tolower:
   73|  37.4M|static HTS_INLINE HTS_UNUSED int hts_tolower(int c) {
   74|  37.4M|  return hts_isupper(c) ? c + ('a' - 'A') : c;
  ------------------
  |  Branch (74:10): [True: 18.7M, False: 18.7M]
  ------------------
   75|  37.4M|}
store.c:hts_isupper:
   47|  56.6M|static HTS_INLINE HTS_UNUSED int hts_isupper(int c) {
   48|  56.6M|  return c >= 'A' && c <= 'Z';
  ------------------
  |  Branch (48:10): [True: 55.3M, False: 1.29M]
  |  Branch (48:22): [True: 20.7M, False: 34.6M]
  ------------------
   49|  56.6M|}
store.c:hts_streq_ci:
  100|  18.4M|hts_streq_ci(const char *a, const char *b) {
  101|  18.4M|  return hts_strcasecmp(a, b) == 0;
  102|  18.4M|}
store.c:hts_isalpha:
   55|  19.2M|static HTS_INLINE HTS_UNUSED int hts_isalpha(int c) {
   56|  19.2M|  return hts_isupper(c) || hts_islower(c);
  ------------------
  |  Branch (56:10): [True: 2.06M, False: 17.1M]
  |  Branch (56:28): [True: 16.3M, False: 805k]
  ------------------
   57|  19.2M|}
store.c:hts_islower:
   51|  17.1M|static HTS_INLINE HTS_UNUSED int hts_islower(int c) {
   52|  17.1M|  return c >= 'a' && c <= 'z';
  ------------------
  |  Branch (52:10): [True: 16.4M, False: 722k]
  |  Branch (52:22): [True: 16.3M, False: 82.5k]
  ------------------
   53|  17.1M|}
store.c:hts_isalnum:
   59|  15.3M|static HTS_INLINE HTS_UNUSED int hts_isalnum(int c) {
   60|  15.3M|  return hts_isalpha(c) || hts_isdigit(c);
  ------------------
  |  Branch (60:10): [True: 14.6M, False: 707k]
  |  Branch (60:28): [True: 394k, False: 313k]
  ------------------
   61|  15.3M|}
store.c:hts_isdigit:
   43|   707k|static HTS_INLINE HTS_UNUSED int hts_isdigit(int c) {
   44|   707k|  return c >= '0' && c <= '9';
  ------------------
  |  Branch (44:10): [True: 446k, False: 261k]
  |  Branch (44:22): [True: 394k, False: 52.4k]
  ------------------
   45|   707k|}
htsshared.c:hts_isalpha:
   55|   241k|static HTS_INLINE HTS_UNUSED int hts_isalpha(int c) {
   56|   241k|  return hts_isupper(c) || hts_islower(c);
  ------------------
  |  Branch (56:10): [True: 1.57k, False: 240k]
  |  Branch (56:28): [True: 187k, False: 52.6k]
  ------------------
   57|   241k|}
htsshared.c:hts_isupper:
   47|   241k|static HTS_INLINE HTS_UNUSED int hts_isupper(int c) {
   48|   241k|  return c >= 'A' && c <= 'Z';
  ------------------
  |  Branch (48:10): [True: 194k, False: 47.1k]
  |  Branch (48:22): [True: 1.57k, False: 193k]
  ------------------
   49|   241k|}
htsshared.c:hts_islower:
   51|   240k|static HTS_INLINE HTS_UNUSED int hts_islower(int c) {
   52|   240k|  return c >= 'a' && c <= 'z';
  ------------------
  |  Branch (52:10): [True: 193k, False: 47.3k]
  |  Branch (52:22): [True: 187k, False: 5.35k]
  ------------------
   53|   240k|}
htsurlport.c:hts_isspace:
   68|  10.2k|static HTS_INLINE HTS_UNUSED int hts_isspace(int c) {
   69|  10.2k|  return c == ' ' || (c >= '\t' && c <= '\r');
  ------------------
  |  Branch (69:10): [True: 0, False: 10.2k]
  |  Branch (69:23): [True: 10.2k, False: 51]
  |  Branch (69:36): [True: 0, False: 10.2k]
  ------------------
   70|  10.2k|}
htsdate.c:hts_lowcase:
  124|  49.7k|static HTS_INLINE HTS_UNUSED void hts_lowcase(char *s) {
  125|   109k|  for (; *s != '\0'; s++)
  ------------------
  |  Branch (125:10): [True: 59.5k, False: 49.7k]
  ------------------
  126|  59.5k|    *s = (char) hts_tolower((unsigned char) *s);
  127|  49.7k|}
htsdate.c:hts_tolower:
   73|  59.5k|static HTS_INLINE HTS_UNUSED int hts_tolower(int c) {
   74|  59.5k|  return hts_isupper(c) ? c + ('a' - 'A') : c;
  ------------------
  |  Branch (74:10): [True: 1.41k, False: 58.1k]
  ------------------
   75|  59.5k|}
htsdate.c:hts_isupper:
   47|  59.5k|static HTS_INLINE HTS_UNUSED int hts_isupper(int c) {
   48|  59.5k|  return c >= 'A' && c <= 'Z';
  ------------------
  |  Branch (48:10): [True: 19.9k, False: 39.6k]
  |  Branch (48:22): [True: 1.41k, False: 18.5k]
  ------------------
   49|  59.5k|}
htsdate.c:hts_isdigit:
   43|  2.10k|static HTS_INLINE HTS_UNUSED int hts_isdigit(int c) {
   44|  2.10k|  return c >= '0' && c <= '9';
  ------------------
  |  Branch (44:10): [True: 1.49k, False: 617]
  |  Branch (44:22): [True: 649, False: 842]
  ------------------
   45|  2.10k|}

convert_time_rfc822:
   45|  49.7k|struct tm *convert_time_rfc822(struct tm *result, const char *s) {
   46|  49.7k|  return convert_time_rfc822_pivot(result, s, 50);
   47|  49.7k|}
convert_time_rfc822_pivot:
   50|  49.7k|                                     int pivot) {
   51|  49.7k|  char months[] = "jan feb mar apr may jun jul aug sep oct nov dec";
   52|  49.7k|  char str[256];
   53|  49.7k|  char *a;
   54|       |
   55|       |  /* The numbers in order of appearance, dd first. n1..n4 are then year, hour,
   56|       |     min, sec, or hour, min, sec, year when n4 is four digits. */
   57|  49.7k|  int result_mm = -1;
   58|  49.7k|  int result_dd = -1;
   59|  49.7k|  int result_n1 = -1;
   60|  49.7k|  int result_n2 = -1;
   61|  49.7k|  int result_n3 = -1;
   62|  49.7k|  int result_n4 = -1;
   63|       |
   64|  49.7k|  if ((int) strlen(s) > 200)
  ------------------
  |  Branch (64:7): [True: 0, False: 49.7k]
  ------------------
   65|      0|    return NULL;
   66|  49.7k|  strcpybuff(str, s);
  ------------------
  |  |  293|  49.7k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  49.7k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|  49.7k|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|  49.7k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  49.7k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  49.7k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [True: 49.7k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|  49.7k|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|  49.7k|                                     "'",                                      \
  |  |  297|  49.7k|                                     __FILE__, __LINE__),                      \
  |  |  298|  49.7k|                        strcpybuff_ptr_((A), (B)))
  ------------------
   67|  49.7k|  hts_lowcase(str);
   68|       |
   69|  51.4k|  while ((a = strchr(str, '-')))
  ------------------
  |  Branch (69:10): [True: 1.76k, False: 49.7k]
  ------------------
   70|  1.76k|    *a = ' ';
   71|  52.4k|  while ((a = strchr(str, ':')))
  ------------------
  |  Branch (71:10): [True: 2.71k, False: 49.7k]
  ------------------
   72|  2.71k|    *a = ' ';
   73|  50.8k|  while ((a = strchr(str, ',')))
  ------------------
  |  Branch (73:10): [True: 1.15k, False: 49.7k]
  ------------------
   74|  1.15k|    *a = ' ';
   75|       |  /* tokenise */
   76|  49.7k|  a = str;
   77|  60.8k|  while (*a) {
  ------------------
  |  Branch (77:10): [True: 11.1k, False: 49.7k]
  ------------------
   78|  11.1k|    char *first, *last;
   79|  11.1k|    char tok[256];
   80|       |
   81|  11.1k|    a += strspn(a, " ");
   82|  11.1k|    first = a;
   83|  11.1k|    a += strcspn(a, " ");
   84|  11.1k|    last = a;
   85|  11.1k|    tok[0] = '\0';
   86|  11.1k|    if (first != last) {
  ------------------
  |  Branch (86:9): [True: 10.6k, False: 475]
  ------------------
   87|  10.6k|      char *pos;
   88|       |
   89|  10.6k|      strncatbuff(tok, first, (int) (last - first));
  ------------------
  |  |  242|  10.6k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  10.6k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  243|  10.6k|                        strncat_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B), N,  \
  |  |  ------------------
  |  |  |  |  164|  10.6k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.6k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  10.6k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [True: 10.6k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  244|  10.6k|                                      "overflow while appending '" #B          \
  |  |  245|  10.6k|                                      "' to '" #A "'",                         \
  |  |  246|  10.6k|                                      __FILE__, __LINE__),                     \
  |  |  247|  10.6k|                        strncatbuff_ptr_((A), (B), (N)))
  ------------------
   90|       |      /* classify it */
   91|       |      /* a month is a whole three-letter name: "n" or "c" is a zone letter */
   92|  10.6k|      if (strlen(tok) == 3 && (pos = strstr(months, tok)) != NULL &&
  ------------------
  |  Branch (92:11): [True: 2.26k, False: 8.43k]
  |  Branch (92:31): [True: 439, False: 1.82k]
  ------------------
   93|    439|          (pos - months) % 4 == 0) { /* month always in letters */
  ------------------
  |  Branch (93:11): [True: 439, False: 0]
  ------------------
   94|    439|        result_mm = ((int) (pos - months)) / 4;
   95|  10.2k|      } else {
   96|  10.2k|        const char *digits = tok;
   97|  10.2k|        LLint value;
   98|       |
   99|       |        /* A '+' zone such as "+0100" reads as its digits. */
  100|  10.2k|        digits += strspn(digits, HTS_REALSPACES);
  ------------------
  |  |  698|  10.2k|#define HTS_REALSPACES " \n\r\t\f\v"
  ------------------
  101|  10.2k|        if (digits[0] == '+' && hts_isdigit((unsigned char) digits[1]))
  ------------------
  |  Branch (101:13): [True: 2.10k, False: 8.14k]
  |  Branch (101:33): [True: 649, False: 1.45k]
  ------------------
  102|    649|          digits++;
  103|  10.2k|        if (hts_scan_llint(&digits, 0, INT_MAX, &value) == HTS_SCAN_OK) {
  ------------------
  |  Branch (103:13): [True: 6.22k, False: 4.02k]
  ------------------
  104|  6.22k|          const int number = (int) value;
  105|       |
  106|  6.22k|          if (result_dd < 0)                   /* day always first number */
  ------------------
  |  Branch (106:15): [True: 1.38k, False: 4.84k]
  ------------------
  107|  1.38k|            result_dd = number;
  108|  4.84k|          else if (result_n1 < 0)
  ------------------
  |  Branch (108:20): [True: 1.28k, False: 3.55k]
  ------------------
  109|  1.28k|            result_n1 = number;
  110|  3.55k|          else if (result_n2 < 0)
  ------------------
  |  Branch (110:20): [True: 1.14k, False: 2.40k]
  ------------------
  111|  1.14k|            result_n2 = number;
  112|  2.40k|          else if (result_n3 < 0)
  ------------------
  |  Branch (112:20): [True: 1.04k, False: 1.36k]
  ------------------
  113|  1.04k|            result_n3 = number;
  114|  1.36k|          else if (result_n4 < 0)
  ------------------
  |  Branch (114:20): [True: 853, False: 511]
  ------------------
  115|    853|            result_n4 = number;
  116|  6.22k|        } /* anything else is noise, "+1GMT" for example */
  117|  10.2k|      }
  118|  10.6k|    }
  119|  11.1k|  }
  120|  49.7k|  if ((result_n1 >= 0) && (result_mm >= 0) && (result_dd >= 0) &&
  ------------------
  |  Branch (120:7): [True: 1.28k, False: 48.4k]
  |  Branch (120:27): [True: 415, False: 871]
  |  Branch (120:47): [True: 415, False: 0]
  ------------------
  121|    415|      (result_n2 >= 0) && (result_n3 >= 0) && (result_n4 >= 0)) {
  ------------------
  |  Branch (121:7): [True: 374, False: 41]
  |  Branch (121:27): [True: 342, False: 32]
  |  Branch (121:47): [True: 313, False: 29]
  ------------------
  122|    313|    if (result_n4 >= 1000) { /* Sun Nov  6 08:49:37 1994 */
  ------------------
  |  Branch (122:9): [True: 85, False: 228]
  ------------------
  123|     85|      result->tm_year = result_n4 - 1900;
  124|     85|      result->tm_hour = result_n1;
  125|     85|      result->tm_min = result_n2;
  126|     85|      result->tm_sec = result_n3 > 0 ? result_n3 : 0;
  ------------------
  |  Branch (126:24): [True: 68, False: 17]
  ------------------
  127|    228|    } else { /* Sun, 06 Nov 1994 08:49:37 GMT or Sunday, 06-Nov-94 08:49:37 GMT
  128|       |              */
  129|    228|      result->tm_hour = result_n2;
  130|    228|      result->tm_min = result_n3;
  131|    228|      result->tm_sec = result_n4 > 0 ? result_n4 : 0;
  ------------------
  |  Branch (131:24): [True: 180, False: 48]
  ------------------
  132|    228|      if (result_n1 <= pivot) /* 00 means 2000 */
  ------------------
  |  Branch (132:11): [True: 125, False: 103]
  ------------------
  133|    125|        result->tm_year = result_n1 + 100;
  134|    103|      else if (result_n1 < 1000) /* 99 means 1999 */
  ------------------
  |  Branch (134:16): [True: 44, False: 59]
  ------------------
  135|     44|        result->tm_year = result_n1;
  136|     59|      else /* 2000 */
  137|     59|        result->tm_year = result_n1 - 1900;
  138|    228|    }
  139|    313|    result->tm_isdst = 0; /* assume GMT */
  140|    313|    result->tm_yday = -1; /* don't know */
  141|    313|    result->tm_wday = -1; /* don't know */
  142|    313|    result->tm_mon = result_mm;
  143|    313|    result->tm_mday = result_dd;
  144|    313|    return result;
  145|    313|  }
  146|  49.4k|  return NULL;
  147|  49.7k|}
hts_utc_seconds:
  150|    257|int64_t hts_utc_seconds(const struct tm *tm) {
  151|       |  // days from the civil date, counting years from March (Howard Hinnant)
  152|    257|  int64_t y = (int64_t) tm->tm_year + 1900 + tm->tm_mon / 12;
  153|    257|  int64_t m = tm->tm_mon % 12;
  154|    257|  int64_t era, yoe, doy, days;
  155|       |
  156|    257|  if (m < 0) {
  ------------------
  |  Branch (156:7): [True: 10, False: 247]
  ------------------
  157|     10|    m += 12;
  158|     10|    y--;
  159|     10|  }
  160|    257|  if (m < 2)
  ------------------
  |  Branch (160:7): [True: 38, False: 219]
  ------------------
  161|     38|    y--;
  162|    257|  era = (y >= 0 ? y : y - 399) / 400;
  ------------------
  |  Branch (162:10): [True: 250, False: 7]
  ------------------
  163|    257|  yoe = y - era * 400;
  164|    257|  doy = (153 * ((m + 10) % 12) + 2) / 5 + (int64_t) tm->tm_mday - 1;
  165|    257|  days = era * 146097 + yoe * 365 + yoe / 4 - yoe / 100 + doy - 719468;
  166|    257|  return days * 86400 + (int64_t) tm->tm_hour * 3600 +
  167|    257|         (int64_t) tm->tm_min * 60 + tm->tm_sec;
  168|    257|}
hts_time_clip:
  171|    255|time_t hts_time_clip(int64_t t) {
  172|    255|  if (sizeof(time_t) < sizeof(int64_t)) {
  ------------------
  |  Branch (172:7): [Folded, False: 255]
  ------------------
  173|      0|    if (t > INT32_MAX)
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  ------------------
  174|      0|      return (time_t) INT32_MAX;
  175|      0|    if (t < INT32_MIN)
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|      return (time_t) INT32_MIN;
  177|      0|  }
  178|    255|  return (time_t) t;
  179|    255|}
hts_tm_filetime:
  192|    173|hts_boolean hts_tm_filetime(const struct tm *tm, time_t *out) {
  193|    173|  const int64_t t = hts_utc_seconds(tm);
  194|       |
  195|    173|  if (t == -1 || t == 0)
  ------------------
  |  Branch (195:7): [True: 1, False: 172]
  |  Branch (195:18): [True: 1, False: 171]
  ------------------
  196|      2|    return HTS_FALSE;
  ------------------
  |  |  380|      2|#define HTS_FALSE 0
  ------------------
  197|       |  // A date past what time_t holds stamps its last second, never 1901.
  198|    171|  *out = hts_time_clip(t);
  199|    171|  return HTS_TRUE;
  ------------------
  |  |  381|    171|#define HTS_TRUE 1
  ------------------
  200|    173|}

store.c:hts_fwrite_exact:
   65|  50.1k|                                                          FILE *fp) {
   66|  50.1k|  return fwrite(src, 1, size, fp) == size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  50.1k|#define HTS_TRUE 1
  ------------------
                return fwrite(src, 1, size, fp) == size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  |  Branch (66:10): [True: 50.1k, False: 0]
  ------------------
   67|  50.1k|}

store.c:hts_gmtime:
  310|  3.02k|                                                    struct tm *tmbuf) {
  311|       |#ifdef _WIN32
  312|       |  /* Microsoft's gmtime_s takes the destination first, unlike C11 Annex K. */
  313|       |  return gmtime_s(tmbuf, &t) == 0 ? HTS_TRUE : HTS_FALSE;
  314|       |#else
  315|  3.02k|  return gmtime_r(&t, tmbuf) != NULL ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  3.02k|#define HTS_TRUE 1
  ------------------
                return gmtime_r(&t, tmbuf) != NULL ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  |  Branch (315:10): [True: 3.02k, False: 0]
  ------------------
  316|  3.02k|#endif
  317|  3.02k|}
store.c:hts_effective_mime:
 1142|  99.4k|static HTS_INLINE HTS_UNUSED const char *hts_effective_mime(const char *m) {
 1143|  99.4k|  return hts_streq_ci(m, HTS_UNKNOWN_MIME) ? HTS_HYPERTEXT_DEFAULT_MIME : m;
  ------------------
  |  | 1138|  99.4k|#define HTS_UNKNOWN_MIME "unknown/unknown"
  ------------------
                return hts_streq_ci(m, HTS_UNKNOWN_MIME) ? HTS_HYPERTEXT_DEFAULT_MIME : m;
  ------------------
  |  | 1135|      0|#define HTS_HYPERTEXT_DEFAULT_MIME "text/html"
  ------------------
  |  Branch (1143:10): [True: 0, False: 99.4k]
  ------------------
 1144|  99.4k|}

hts_md5_init:
   48|    384|void hts_md5_init(struct MD5Context *ctx) {
   49|    384|  const int one = 1;
   50|    384|  const int little_endian = *(const char *) &one;
   51|       |
   52|       |  /* brokenEndian=1 skips MD5's byte swap, right on a little-endian host */
   53|    384|  MD5Init(ctx, little_endian);
   54|    384|}
hts_md5_hex:
   56|    384|void hts_md5_hex(const unsigned char bindigest[16], char hex[33]) {
   57|    384|  static const char digits[] = "0123456789abcdef";
   58|    384|  int i;
   59|       |
   60|  6.52k|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (60:15): [True: 6.14k, False: 384]
  ------------------
   61|  6.14k|    hex[2 * i] = digits[bindigest[i] >> 4];
   62|  6.14k|    hex[2 * i + 1] = digits[bindigest[i] & 0x0f];
   63|  6.14k|  }
   64|    384|  hex[32] = '\0';
   65|    384|}
domd5mem:
   67|    384|void domd5mem(hts_span data, hts_buf digest, hts_boolean asAscii) {
   68|    384|  unsigned char bindigest[16];
   69|    384|  struct MD5Context ctx;
   70|       |
   71|    384|  assertf(digest.size >= (asAscii ? 33 : 16));
  ------------------
  |  |  100|    384|#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   94|    384|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|    768|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (90:11): [True: 384, False: 0]
  |  |  |  |  |  |  |  Branch (90:12): [True: 384, False: 0]
  |  |  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   72|      0|  hts_md5_init(&ctx);
   73|    384|  MD5Update(&ctx, (const unsigned char *) data.p, (unsigned int) data.len);
   74|    384|  MD5Final(bindigest, &ctx);
   75|       |
   76|    384|  if (!asAscii) {
  ------------------
  |  Branch (76:7): [True: 0, False: 384]
  ------------------
   77|      0|    memcpy(digest.p, bindigest, 16);
   78|    384|  } else {
   79|    384|    hts_md5_hex(bindigest, digest.p);
   80|    384|  }
   81|    384|}

fuzz-arc.c:vslprintfbuff:
  564|      1|                  va_list args) {
  565|      1|  int ret;
  566|       |
  567|      1|  assertf(dest != NULL && size != 0);
  ------------------
  |  |  100|      1|#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   94|      1|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|      2|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (90:12): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (90:12): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|       |  /* a vsnprintf failing outright may write nothing at all, leaving whatever
  569|       |     the caller had on the stack for it to publish */
  570|      0|  dest[0] = '\0';
  571|      1|  ret = vsnprintf(dest, size, fmt, args);
  572|       |  /* pre-C99 runtimes (msvcrt _vsnprintf) return -1 and do not terminate */
  573|      1|  dest[size - 1] = '\0';
  574|      1|  return ret >= 0 && (size_t) ret < size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|      1|#define HTS_TRUE 1
  ------------------
                return ret >= 0 && (size_t) ret < size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  |  Branch (574:10): [True: 1, False: 0]
  |  Branch (574:22): [True: 1, False: 0]
  ------------------
  575|      1|}
store.c:strcpy_safe_:
  402|  96.2k|             const char *exp, const char *file, int line) {
  403|  96.2k|  assertf_(sizeof_dest != 0, file, line);
  ------------------
  |  |   94|  96.2k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|  96.2k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 96.2k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  404|      0|  dest[0] = '\0';
  405|  96.2k|  return strncat_safe_(dest, sizeof_dest, source, sizeof_source, (size_t) -1,
  406|  96.2k|                       exp, file, line);
  407|  96.2k|}
store.c:strncat_safe_:
  384|   151k|              const size_t n, const char *exp, const char *file, int line) {
  385|   151k|  const size_t source_len = strlen_safe_(source, sizeof_source, file, line);
  386|   151k|  const size_t dest_len = strlen_safe_(dest, sizeof_dest, file, line);
  387|       |  /* note: "size_t is an unsigned integral type" ((size_t) -1 is positive) */
  388|   151k|  const size_t source_copy = source_len <= n ? source_len : n;
  ------------------
  |  Branch (388:30): [True: 150k, False: 160]
  ------------------
  389|   151k|  const size_t dest_final_len = dest_len + source_copy;
  390|   151k|  assertf__(dest_final_len < sizeof_dest, exp, file, line);
  ------------------
  |  |   90|   151k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  ------------------
  |  |  |  Branch (90:11): [True: 151k, False: 0]
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  391|      0|  memcpy(dest + dest_len, source, source_copy);
  392|   151k|  dest[dest_final_len] = '\0';
  393|   151k|  return dest;
  394|   151k|}
store.c:strlen_safe_:
  367|   302k|                                                 const char *file, int line) {
  368|   302k|  size_t size;
  369|   302k|  assertf_(source != NULL, file, line);
  ------------------
  |  |   94|   302k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|   302k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 302k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|   302k|  size = sizeof_source != (size_t) -1 ? htssafe_strnlen_(source, sizeof_source)
  ------------------
  |  Branch (370:10): [True: 297k, False: 5.01k]
  ------------------
  371|   302k|                                      : strlen(source);
  372|   302k|  assertf_(size < sizeof_source, file, line);
  ------------------
  |  |   94|   302k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|   302k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 302k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|      0|  return size;
  374|   302k|}
store.c:htssafe_strnlen_:
  342|   297k|                                                     size_t maxlen) {
  343|   297k|#if (defined(_WIN32) || (defined(HAVE_STRNLEN) && !defined(__STRICT_ANSI__)))
  344|   297k|  return strnlen(s, maxlen);
  345|       |#else
  346|       |  size_t i;
  347|       |  for (i = 0; i < maxlen && s[i] != '\0'; i++)
  348|       |    ;
  349|       |  return i;
  350|       |#endif
  351|   297k|}
store.c:slprintfbuff:
  586|  2.93k|                 ...) {
  587|  2.93k|  va_list args;
  588|  2.93k|  hts_boolean ret;
  589|       |
  590|  2.93k|  va_start(args, fmt);
  591|  2.93k|  ret = vslprintfbuff(dest, size, fmt, args);
  592|       |  va_end(args);
  593|  2.93k|  return ret;
  594|  2.93k|}
store.c:vslprintfbuff:
  564|  55.6k|                  va_list args) {
  565|  55.6k|  int ret;
  566|       |
  567|  55.6k|  assertf(dest != NULL && size != 0);
  ------------------
  |  |  100|  55.6k|#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   94|  55.6k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|   111k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (90:12): [True: 55.6k, False: 0]
  |  |  |  |  |  |  |  Branch (90:12): [True: 55.6k, False: 0]
  |  |  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|       |  /* a vsnprintf failing outright may write nothing at all, leaving whatever
  569|       |     the caller had on the stack for it to publish */
  570|      0|  dest[0] = '\0';
  571|  55.6k|  ret = vsnprintf(dest, size, fmt, args);
  572|       |  /* pre-C99 runtimes (msvcrt _vsnprintf) return -1 and do not terminate */
  573|  55.6k|  dest[size - 1] = '\0';
  574|  55.6k|  return ret >= 0 && (size_t) ret < size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  55.5k|#define HTS_TRUE 1
  ------------------
                return ret >= 0 && (size_t) ret < size ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|     39|#define HTS_FALSE 0
  ------------------
  |  Branch (574:10): [True: 55.6k, False: 0]
  |  Branch (574:22): [True: 55.5k, False: 39]
  ------------------
  575|  55.6k|}
store.c:strclipbuff:
  501|  2.25k|                                                     const char *src) {
  502|  2.25k|  size_t len, copy;
  503|       |
  504|  2.25k|  assertf(dest != NULL && src != NULL && size != 0);
  ------------------
  |  |  100|  2.25k|#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   94|  2.25k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|  9.02k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (90:12): [True: 2.25k, False: 0]
  |  |  |  |  |  |  |  Branch (90:12): [True: 2.25k, False: 0]
  |  |  |  |  |  |  |  Branch (90:12): [True: 2.25k, False: 0]
  |  |  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  505|      0|  len = strlen(src);
  506|  2.25k|  copy = len < size ? len : size - 1;
  ------------------
  |  Branch (506:10): [True: 1.54k, False: 710]
  ------------------
  507|  2.25k|  memcpy(dest, src, copy);
  508|  2.25k|  dest[copy] = '\0';
  509|  2.25k|  return copy == len ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  1.54k|#define HTS_TRUE 1
  ------------------
                return copy == len ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|    710|#define HTS_FALSE 0
  ------------------
  |  Branch (509:10): [True: 1.54k, False: 710]
  ------------------
  510|  2.25k|}
store.c:hts_lastchar:
  665|  49.7k|static HTS_INLINE HTS_UNUSED char hts_lastchar(const char *s) {
  666|  49.7k|  const size_t len = strlen(s);
  667|       |
  668|  49.7k|  return len != 0 ? s[len - 1] : '\0';
  ------------------
  |  Branch (668:10): [True: 49.7k, False: 0]
  ------------------
  669|  49.7k|}
htsdate.c:strcpy_safe_:
  402|  49.7k|             const char *exp, const char *file, int line) {
  403|  49.7k|  assertf_(sizeof_dest != 0, file, line);
  ------------------
  |  |   94|  49.7k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|  49.7k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 49.7k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  404|      0|  dest[0] = '\0';
  405|  49.7k|  return strncat_safe_(dest, sizeof_dest, source, sizeof_source, (size_t) -1,
  406|  49.7k|                       exp, file, line);
  407|  49.7k|}
htsdate.c:strncat_safe_:
  384|  60.4k|              const size_t n, const char *exp, const char *file, int line) {
  385|  60.4k|  const size_t source_len = strlen_safe_(source, sizeof_source, file, line);
  386|  60.4k|  const size_t dest_len = strlen_safe_(dest, sizeof_dest, file, line);
  387|       |  /* note: "size_t is an unsigned integral type" ((size_t) -1 is positive) */
  388|  60.4k|  const size_t source_copy = source_len <= n ? source_len : n;
  ------------------
  |  Branch (388:30): [True: 50.8k, False: 9.59k]
  ------------------
  389|  60.4k|  const size_t dest_final_len = dest_len + source_copy;
  390|  60.4k|  assertf__(dest_final_len < sizeof_dest, exp, file, line);
  ------------------
  |  |   90|  60.4k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  ------------------
  |  |  |  Branch (90:11): [True: 60.4k, False: 0]
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  391|      0|  memcpy(dest + dest_len, source, source_copy);
  392|  60.4k|  dest[dest_final_len] = '\0';
  393|  60.4k|  return dest;
  394|  60.4k|}
htsdate.c:strlen_safe_:
  367|   120k|                                                 const char *file, int line) {
  368|   120k|  size_t size;
  369|   120k|  assertf_(source != NULL, file, line);
  ------------------
  |  |   94|   120k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|   120k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 120k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|   120k|  size = sizeof_source != (size_t) -1 ? htssafe_strnlen_(source, sizeof_source)
  ------------------
  |  Branch (370:10): [True: 60.4k, False: 60.4k]
  ------------------
  371|   120k|                                      : strlen(source);
  372|   120k|  assertf_(size < sizeof_source, file, line);
  ------------------
  |  |   94|   120k|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  ------------------
  |  |  |  |   90|   120k|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:11): [True: 120k, False: 0]
  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|      0|  return size;
  374|   120k|}
htsdate.c:htssafe_strnlen_:
  342|  60.4k|                                                     size_t maxlen) {
  343|  60.4k|#if (defined(_WIN32) || (defined(HAVE_STRNLEN) && !defined(__STRICT_ANSI__)))
  344|  60.4k|  return strnlen(s, maxlen);
  345|       |#else
  346|       |  size_t i;
  347|       |  for (i = 0; i < maxlen && s[i] != '\0'; i++)
  348|       |    ;
  349|       |  return i;
  350|       |#endif
  351|  60.4k|}

hts_shared_linput:
   45|  3.31M|int hts_shared_linput(FILE *fp, hts_buf s, int flags) {
   46|  3.31M|  int c = EOF;
   47|  3.31M|  size_t j = 0;
   48|       |
   49|  3.31M|  assertf(s.size > 1);
  ------------------
  |  |  100|  3.31M|#define assertf(exp) assertf_(exp, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   94|  3.31M|#define assertf_(exp, file, line) assertf__(exp, #exp, file, line)
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|  3.31M|  (void) ((exp) || (abortf_(sexp, file, line), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (90:11): [True: 3.31M, False: 0]
  |  |  |  |  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|  45.5M|  while (j + 1 < s.size) {
  ------------------
  |  Branch (50:10): [True: 45.5M, False: 928]
  ------------------
   51|  45.5M|    c = fgetc(fp);
   52|  45.5M|    if (c != EOF) {
  ------------------
  |  Branch (52:9): [True: 45.5M, False: 6.95k]
  ------------------
   53|  45.5M|      switch (c) {
   54|  71.9k|      case 13:
  ------------------
  |  Branch (54:7): [True: 71.9k, False: 45.4M]
  ------------------
   55|  71.9k|        break;
   56|  3.30M|      case 10:
  ------------------
  |  Branch (56:7): [True: 3.30M, False: 42.2M]
  ------------------
   57|  3.30M|        c = -1;
   58|  3.30M|        break;
   59|  3.13k|      case 9:
  ------------------
  |  Branch (59:7): [True: 3.13k, False: 45.5M]
  ------------------
   60|  75.0k|      case 12:
  ------------------
  |  Branch (60:7): [True: 71.9k, False: 45.4M]
  ------------------
   61|  75.0k|        break;
   62|  3.55M|      case 0:
  ------------------
  |  Branch (62:7): [True: 3.55M, False: 42.0M]
  ------------------
   63|  3.55M|        if ((flags & HTS_LINPUT_SKIP_NUL) != 0)
  ------------------
  |  |   54|  3.55M|#define HTS_LINPUT_SKIP_NUL 1
  ------------------
  |  Branch (63:13): [True: 3.55M, False: 0]
  ------------------
   64|  3.55M|          break;
   65|      0|        s.p[j++] = (char) c;
   66|      0|        break;
   67|  38.5M|      default:
  ------------------
  |  Branch (67:7): [True: 38.5M, False: 7.00M]
  ------------------
   68|  38.5M|        s.p[j++] = (char) c;
   69|  38.5M|        break;
   70|  45.5M|      }
   71|  45.5M|    }
   72|  45.5M|    if (c == EOF) /* end of file, or the newline set it */
  ------------------
  |  Branch (72:9): [True: 3.31M, False: 42.2M]
  ------------------
   73|  3.31M|      break;
   74|  45.5M|  }
   75|  3.31M|  if (j + 1 == s.size && c != EOF) {
  ------------------
  |  Branch (75:7): [True: 928, False: 3.31M]
  |  Branch (75:26): [True: 928, False: 0]
  ------------------
   76|       |    /* Stopped at the bound: consume the newline, or the next read returns "" */
   77|    928|    if ((flags & HTS_LINPUT_DROP_TAIL) != 0) {
  ------------------
  |  |   55|    928|#define HTS_LINPUT_DROP_TAIL 2
  ------------------
  |  Branch (77:9): [True: 0, False: 928]
  ------------------
   78|      0|      while ((c = fgetc(fp)) != 10 && c != EOF)
  ------------------
  |  Branch (78:14): [True: 0, False: 0]
  |  Branch (78:39): [True: 0, False: 0]
  ------------------
   79|      0|        ;
   80|    928|    } else {
   81|  1.28k|      while ((c = fgetc(fp)) == 13)
  ------------------
  |  Branch (81:14): [True: 361, False: 928]
  ------------------
   82|    361|        ;
   83|    928|      if (c != 10 && c != EOF)
  ------------------
  |  Branch (83:11): [True: 731, False: 197]
  |  Branch (83:22): [True: 719, False: 12]
  ------------------
   84|    719|        ungetc(c, fp);
   85|    928|    }
   86|    928|  }
   87|  3.31M|  s.p[j] = '\0';
   88|  3.31M|  return (int) j;
   89|  3.31M|}
hts_shared_link_has_authority:
   98|  52.6k|hts_boolean hts_shared_link_has_authority(const char *lien) {
   99|  52.6k|  const char *a = lien;
  100|       |
  101|  52.6k|  if (hts_isalpha((const unsigned char) *a)) {
  ------------------
  |  Branch (101:7): [True: 39.6k, False: 13.0k]
  ------------------
  102|   189k|    while (hts_isalpha((const unsigned char) *a))
  ------------------
  |  Branch (102:12): [True: 149k, False: 39.6k]
  ------------------
  103|   149k|      a++;
  104|  39.6k|    if (*a == ':')
  ------------------
  |  Branch (104:9): [True: 36.6k, False: 3.03k]
  ------------------
  105|  36.6k|      a++;
  106|  3.03k|    else
  107|  3.03k|      return HTS_FALSE;
  ------------------
  |  |  380|  3.03k|#define HTS_FALSE 0
  ------------------
  108|  39.6k|  }
  109|  49.6k|  return strncmp(a, "//", 2) == 0;
  110|  52.6k|}

store.c:StringClear_:
  256|   131k|HTS_STATIC void StringClear_(String *blk) {
  257|   131k|  blk->length_ = 0;
  258|   131k|  StringRoom_(blk, 0);
  259|   131k|  blk->buffer_[0] = '\0';
  260|   131k|}
store.c:StringRoom_:
  187|   512k|HTS_STATIC void StringRoom_(String *blk, const size_t size) {
  188|   512k|  StringRoomTotal_(blk, blk->length_ + size + 1);
  189|   512k|}
store.c:StringRoomTotal_:
  163|   512k|HTS_STATIC void StringRoomTotal_(String *blk, const size_t capacity) {
  164|   565k|  while (blk->buffer_ == NULL || blk->capacity_ < capacity) {
  ------------------
  |  Branch (164:10): [True: 26.4k, False: 539k]
  |  Branch (164:34): [True: 26.2k, False: 512k]
  ------------------
  165|  52.6k|    const size_t maxcap = (size_t) -1;
  166|  52.6k|    const size_t mincap = 16;
  167|  52.6k|    const size_t cur = blk->capacity_;
  168|       |    /* Past the halfway point cur*2 wraps below cur, which no further doubling
  169|       |       climbs back out of; ask for the requested total instead. */
  170|  52.6k|    const size_t newcap = cur < mincap       ? mincap
  ------------------
  |  Branch (170:27): [True: 26.4k, False: 26.2k]
  ------------------
  171|  52.6k|                          : cur > maxcap / 2 ? capacity
  ------------------
  |  Branch (171:29): [True: 0, False: 26.2k]
  ------------------
  172|  26.2k|                                             : cur * 2;
  173|  52.6k|    char *const buff = STRING_REALLOC(blk->buffer_, newcap);
  ------------------
  |  |   80|  52.6k|#define STRING_REALLOC(BUFF, SIZE) ((char *) realloc(BUFF, SIZE))
  ------------------
  174|       |
  175|  52.6k|    if (buff == NULL) {
  ------------------
  |  Branch (175:9): [True: 0, False: 52.6k]
  ------------------
  176|      0|      STRING_OOM(newcap);
  ------------------
  |  |  154|      0|#define STRING_OOM(SIZE) StringOom_(SIZE)
  ------------------
  177|      0|    }
  178|  52.6k|    blk->buffer_ = buff;
  179|  52.6k|    blk->capacity_ = newcap;
  180|  52.6k|  }
  181|   512k|}
store.c:StringMemcat_:
  307|   381k|HTS_STATIC void StringMemcat_(String *blk, const char *str, const size_t size) {
  308|   381k|  StringRoom_(blk, size);
  309|   381k|  if (size > 0) {
  ------------------
  |  Branch (309:7): [True: 381k, False: 0]
  ------------------
  310|   381k|    memcpy(blk->buffer_ + blk->length_, str, size);
  311|   381k|    blk->length_ += size;
  312|   381k|  }
  313|   381k|  blk->buffer_[blk->length_] = '\0';
  314|   381k|}
store.c:StringAcquire:
  338|  5.98k|HTS_STATIC char *StringAcquire(String *blk) {
  339|  5.98k|  char *buff = StringBuffRW(*blk);
  ------------------
  |  |   95|  5.98k|#define StringBuffRW(BLK) ((BLK).buffer_)
  ------------------
  340|       |
  341|  5.98k|  StringBuffRW(*blk) = NULL;
  ------------------
  |  |   95|  5.98k|#define StringBuffRW(BLK) ((BLK).buffer_)
  ------------------
  342|  5.98k|  StringCapacity(*blk) = 0;
  ------------------
  |  |  105|  5.98k|#define StringCapacity(BLK) ((BLK).capacity_)
  ------------------
  343|  5.98k|  StringLength(*blk) = 0;
  ------------------
  |  |   98|  5.98k|#define StringLength(BLK) ((BLK).length_)
  ------------------
  344|  5.98k|  return buff;
  345|  5.98k|}
store.c:StringFree_:
  279|  26.4k|HTS_STATIC void StringFree_(String *blk) {
  280|  26.4k|  if (blk->buffer_ != NULL) {
  ------------------
  |  Branch (280:7): [True: 20.4k, False: 5.98k]
  ------------------
  281|  20.4k|    STRING_FREE(blk->buffer_);
  ------------------
  |  |   82|  20.4k|#define STRING_FREE(BUFF) free(BUFF)
  ------------------
  282|       |    blk->buffer_ = NULL;
  283|  20.4k|  }
  284|  26.4k|  blk->capacity_ = 0;
  285|  26.4k|  blk->length_ = 0;
  286|  26.4k|}

hts_span_parse_llint:
   55|  10.2k|hts_boolean hts_span_parse_llint(hts_span s, LLint min, LLint max, LLint *out) {
   56|  10.2k|  LLint value = 0;
   57|  10.2k|  size_t i;
   58|       |
   59|  10.2k|  if (hts_span_empty(s))
  ------------------
  |  Branch (59:7): [True: 3.95k, False: 6.29k]
  ------------------
   60|  3.95k|    return HTS_FALSE;
  ------------------
  |  |  380|  3.95k|#define HTS_FALSE 0
  ------------------
   61|  21.3k|  for (i = 0; i < s.len; i++) {
  ------------------
  |  Branch (61:15): [True: 15.1k, False: 6.22k]
  ------------------
   62|  15.1k|    const int digit = s.p[i] - '0';
   63|       |
   64|       |    // Checked before the multiply, so value * 10 + digit never passes max.
   65|  15.1k|    if (!is_decimal_digit(s.p[i]) || digit > max || value > (max - digit) / 10)
  ------------------
  |  Branch (65:9): [True: 0, False: 15.1k]
  |  Branch (65:38): [True: 0, False: 15.1k]
  |  Branch (65:53): [True: 73, False: 15.0k]
  ------------------
   66|     73|      return HTS_FALSE;
  ------------------
  |  |  380|     73|#define HTS_FALSE 0
  ------------------
   67|  15.0k|    value = value * 10 + digit;
   68|  15.0k|  }
   69|  6.22k|  if (value < min)
  ------------------
  |  Branch (69:7): [True: 0, False: 6.22k]
  ------------------
   70|      0|    return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
   71|  6.22k|  *out = value;
   72|  6.22k|  return HTS_TRUE;
  ------------------
  |  |  381|  6.22k|#define HTS_TRUE 1
  ------------------
   73|  6.22k|}
hts_parse_llint:
   76|  10.2k|                            LLint max, LLint *out) {
   77|  10.2k|  const char *p = s;
   78|       |
   79|  25.6k|  while (is_decimal_digit(*p))
  ------------------
  |  Branch (79:10): [True: 15.3k, False: 10.2k]
  ------------------
   80|  15.3k|    p++;
   81|  10.2k|  if (end != NULL)
  ------------------
  |  Branch (81:7): [True: 10.2k, False: 0]
  ------------------
   82|  10.2k|    *end = p;
   83|  10.2k|  return hts_span_parse_llint(hts_span_between(s, p), min, max, out);
   84|  10.2k|}
hts_scan_llint:
   87|  10.2k|                               LLint *out) {
   88|  10.2k|  const char *p = *s;
   89|  10.2k|  const char *end;
   90|  10.2k|  LLint ignored;
   91|       |
   92|  10.2k|  while (hts_isspace((unsigned char) *p))
  ------------------
  |  Branch (92:10): [True: 0, False: 10.2k]
  ------------------
   93|      0|    p++;
   94|  10.2k|  if (hts_parse_llint(p, &end, min, max, out)) {
  ------------------
  |  Branch (94:7): [True: 6.22k, False: 4.02k]
  ------------------
   95|  6.22k|    *s = end;
   96|  6.22k|    return HTS_SCAN_OK;
   97|  6.22k|  }
   98|  4.02k|  if ((*p == '-' || *p == '+') && is_decimal_digit(p[1]))
  ------------------
  |  Branch (98:8): [True: 0, False: 4.02k]
  |  Branch (98:21): [True: 1.45k, False: 2.56k]
  |  Branch (98:35): [True: 0, False: 1.45k]
  ------------------
   99|      0|    (void) !hts_parse_llint(p + 1, &end, min, max,
  100|      0|                            &ignored); // only to skip the refused digits
  101|  4.02k|  if (end == p)
  ------------------
  |  Branch (101:7): [True: 3.95k, False: 73]
  ------------------
  102|  3.95k|    return HTS_SCAN_NONE;
  103|     73|  *s = end;
  104|     73|  return HTS_SCAN_REFUSED;
  105|  4.02k|}
hts_span_empty:
  130|  10.2k|hts_boolean hts_span_empty(hts_span s) {
  131|  10.2k|  return s.len == 0 ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  3.95k|#define HTS_TRUE 1
  ------------------
                return s.len == 0 ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|  6.29k|#define HTS_FALSE 0
  ------------------
  |  Branch (131:10): [True: 3.95k, False: 6.29k]
  ------------------
  132|  10.2k|}
hts_span_between:
  222|  87.4k|hts_span hts_span_between(const char *from, const char *to) {
  223|  87.4k|  return hts_span_at(from, (size_t) (to - from));
  224|  87.4k|}
htsurlport.c:is_decimal_digit:
   41|  42.2k|static hts_boolean is_decimal_digit(char c) { return c >= '0' && c <= '9'; }
  ------------------
  |  Branch (41:54): [True: 33.8k, False: 8.38k]
  |  Branch (41:66): [True: 30.5k, False: 3.33k]
  ------------------

store.c:hts_span_at:
   74|  2.13M|static HTS_INLINE HTS_UNUSED hts_span hts_span_at(const char *p, size_t len) {
   75|  2.13M|  hts_span r;
   76|       |
   77|  2.13M|  r.p = p;
   78|  2.13M|  r.len = len;
   79|  2.13M|  return r;
   80|  2.13M|}
htsurlport.c:hts_span_at:
   74|  87.4k|static HTS_INLINE HTS_UNUSED hts_span hts_span_at(const char *p, size_t len) {
   75|  87.4k|  hts_span r;
   76|       |
   77|  87.4k|  r.p = p;
   78|  87.4k|  r.len = len;
   79|  87.4k|  return r;
   80|  87.4k|}

MD5Init:
   54|    384|void MD5Init(struct MD5Context *ctx, int brokenEndian) {
   55|    384|  ctx->buf[0] = 0x67452301;
   56|    384|  ctx->buf[1] = 0xefcdab89;
   57|    384|  ctx->buf[2] = 0x98badcfe;
   58|    384|  ctx->buf[3] = 0x10325476;
   59|       |
   60|    384|  ctx->bits[0] = 0;
   61|    384|  ctx->bits[1] = 0;
   62|       |
   63|       |  /*#ifdef WORDS_BIGENDIAN */
   64|    384|  if (brokenEndian) {
  ------------------
  |  Branch (64:7): [True: 384, False: 0]
  ------------------
   65|    384|    ctx->doByteReverse = 0;
   66|    384|  } else {
   67|      0|    ctx->doByteReverse = 1;
   68|      0|  }
   69|       |  /*#else
   70|       |     ctx->doByteReverse = 0;
   71|       |     #endif
   72|       |   */
   73|    384|}
MD5Update:
   79|    384|void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) {
   80|    384|  uint32 t;
   81|       |
   82|       |  /* Update bitcount */
   83|       |
   84|    384|  t = ctx->bits[0];
   85|    384|  if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
  ------------------
  |  Branch (85:7): [True: 0, False: 384]
  ------------------
   86|      0|    ctx->bits[1]++;             /* Carry from low to high */
   87|    384|  ctx->bits[1] += len >> 29;
   88|       |
   89|    384|  t = (t >> 3) & 0x3f;          /* Bytes already in shsInfo->data */
   90|       |
   91|       |  /* Handle any leading odd-sized chunks */
   92|       |
   93|    384|  if (t) {
  ------------------
  |  Branch (93:7): [True: 0, False: 384]
  ------------------
   94|      0|    unsigned char *p = ctx->in.ui8 + t;
   95|       |
   96|      0|    t = 64 - t;
   97|      0|    if (len < t) {
  ------------------
  |  Branch (97:9): [True: 0, False: 0]
  ------------------
   98|      0|      memcpy(p, buf, len);
   99|      0|      return;
  100|      0|    }
  101|      0|    memcpy(p, buf, t);
  102|      0|    if (ctx->doByteReverse)
  ------------------
  |  Branch (102:9): [True: 0, False: 0]
  ------------------
  103|      0|      byteReverse(ctx->in.ui8, 16);
  104|      0|    MD5Transform(ctx->buf, ctx->in.ui32);
  105|      0|    buf += t;
  106|      0|    len -= t;
  107|      0|  }
  108|       |  /* Process data in 64-byte chunks */
  109|       |
  110|  57.0k|  while(len >= 64) {
  ------------------
  |  Branch (110:9): [True: 56.6k, False: 384]
  ------------------
  111|  56.6k|    memcpy(ctx->in.ui8, buf, 64);
  112|  56.6k|    if (ctx->doByteReverse)
  ------------------
  |  Branch (112:9): [True: 0, False: 56.6k]
  ------------------
  113|      0|      byteReverse(ctx->in.ui8, 16);
  114|  56.6k|    MD5Transform(ctx->buf, ctx->in.ui32);
  115|  56.6k|    buf += 64;
  116|  56.6k|    len -= 64;
  117|  56.6k|  }
  118|       |
  119|       |  /* Handle any remaining bytes of data. */
  120|       |
  121|    384|  memcpy(ctx->in.ui8, buf, len);
  122|    384|}
MD5Final:
  128|    384|void MD5Final(unsigned char digest[16], struct MD5Context *ctx) {
  129|    384|  unsigned count;
  130|    384|  unsigned char *p;
  131|       |
  132|       |  /* Compute number of bytes mod 64 */
  133|    384|  count = (ctx->bits[0] >> 3) & 0x3F;
  134|       |
  135|       |  /* Set the first char of padding to 0x80.  This is safe since there is
  136|       |     always at least one byte free */
  137|    384|  p = ctx->in.ui8 + count;
  138|    384|  *p++ = 0x80;
  139|       |
  140|       |  /* Bytes of padding needed to make 64 bytes */
  141|    384|  count = 64 - 1 - count;
  142|       |
  143|       |  /* Pad out to 56 mod 64 */
  144|    384|  if (count < 8) {
  ------------------
  |  Branch (144:7): [True: 49, False: 335]
  ------------------
  145|       |    /* Two lots of padding:  Pad the first block to 64 bytes */
  146|     49|    memset(p, 0, count);
  147|     49|    if (ctx->doByteReverse)
  ------------------
  |  Branch (147:9): [True: 0, False: 49]
  ------------------
  148|      0|      byteReverse(ctx->in.ui8, 16);
  149|     49|    MD5Transform(ctx->buf, ctx->in.ui32);
  150|       |
  151|       |    /* Now fill the next block with 56 bytes */
  152|     49|    memset(ctx->in.ui8, 0, 56);
  153|    335|  } else {
  154|       |    /* Pad block to 56 bytes */
  155|    335|    memset(p, 0, count - 8);
  156|    335|  }
  157|    384|  if (ctx->doByteReverse)
  ------------------
  |  Branch (157:7): [True: 0, False: 384]
  ------------------
  158|      0|    byteReverse(ctx->in.ui8, 14);
  159|       |
  160|       |  /* Append length in bits and transform */
  161|       |  /* Note: see patch for PAM from Tomas Mraz */
  162|    384|  ctx->in.ui32[14] = ctx->bits[0];
  163|    384|  ctx->in.ui32[15] = ctx->bits[1];
  164|       |  /*((uint32 *) ctx->in)[14] = ctx->bits[0];
  165|       |     ((uint32 *) ctx->in)[15] = ctx->bits[1];
  166|       |   */
  167|       |
  168|    384|  MD5Transform(ctx->buf, ctx->in.ui32);
  169|    384|  if (ctx->doByteReverse)
  ------------------
  |  Branch (169:7): [True: 0, False: 384]
  ------------------
  170|      0|    byteReverse((unsigned char *) ctx->buf, 4);
  171|    384|  memcpy(digest, ctx->buf, 16);
  172|    384|  memset(ctx, 0, sizeof(*ctx));  /* In case it's sensitive */
  173|    384|}
md5.c:MD5Transform:
  192|  57.0k|static void MD5Transform(uint32 buf[4], uint32 const in[16]) {
  193|  57.0k|  register uint32 a, b, c, d;
  194|       |
  195|  57.0k|  a = buf[0];
  196|  57.0k|  b = buf[1];
  197|  57.0k|  c = buf[2];
  198|  57.0k|  d = buf[3];
  199|       |
  200|  57.0k|  MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  200|  57.0k|  MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  57.0k|  MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  201|  57.0k|  MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|  57.0k|  MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  202|  57.0k|  MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|  57.0k|  MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  203|  57.0k|  MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  57.0k|  MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  204|  57.0k|  MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  57.0k|  MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  205|  57.0k|  MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|  57.0k|  MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  206|  57.0k|  MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  57.0k|  MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  207|  57.0k|  MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|  57.0k|  MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  208|  57.0k|  MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  57.0k|  MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  209|  57.0k|  MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  57.0k|  MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  210|  57.0k|  MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  57.0k|  MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  211|  57.0k|  MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|  57.0k|  MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  212|  57.0k|  MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|  57.0k|  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  213|  57.0k|  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  57.0k|  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  214|  57.0k|  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|  57.0k|  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  215|  57.0k|  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|       |
  217|  57.0k|  MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  217|  57.0k|  MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  57.0k|  MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  218|  57.0k|  MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|  57.0k|  MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  219|  57.0k|  MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  57.0k|  MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  220|  57.0k|  MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  57.0k|  MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  221|  57.0k|  MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  57.0k|  MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  222|  57.0k|  MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  57.0k|  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  223|  57.0k|  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  57.0k|  MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  224|  57.0k|  MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  57.0k|  MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  225|  57.0k|  MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  57.0k|  MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  226|  57.0k|  MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  57.0k|  MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  227|  57.0k|  MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  57.0k|  MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  228|  57.0k|  MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  57.0k|  MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  229|  57.0k|  MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|  57.0k|  MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  230|  57.0k|  MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  57.0k|  MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  231|  57.0k|  MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|  57.0k|  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  232|  57.0k|  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  57.0k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  178|  57.0k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|       |
  234|  57.0k|  MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  234|  57.0k|  MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  57.0k|  MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  235|  57.0k|  MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  57.0k|  MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  236|  57.0k|  MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  57.0k|  MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  237|  57.0k|  MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  57.0k|  MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  238|  57.0k|  MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  57.0k|  MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  239|  57.0k|  MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  57.0k|  MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  240|  57.0k|  MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  57.0k|  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  241|  57.0k|  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  57.0k|  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  242|  57.0k|  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  57.0k|  MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  243|  57.0k|  MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|  57.0k|  MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  244|  57.0k|  MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  57.0k|  MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  245|  57.0k|  MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|  57.0k|  MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  246|  57.0k|  MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  57.0k|  MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  247|  57.0k|  MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  57.0k|  MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  248|  57.0k|  MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  57.0k|  MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  249|  57.0k|  MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  57.0k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|       |
  251|  57.0k|  MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  251|  57.0k|  MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  57.0k|  MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  252|  57.0k|  MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  57.0k|  MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  253|  57.0k|  MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  57.0k|  MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  254|  57.0k|  MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  57.0k|  MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  255|  57.0k|  MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  57.0k|  MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  256|  57.0k|  MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  57.0k|  MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  257|  57.0k|  MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|  57.0k|  MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  258|  57.0k|  MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|  57.0k|  MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  259|  57.0k|  MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  57.0k|  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  260|  57.0k|  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|  57.0k|  MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  261|  57.0k|  MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  57.0k|  MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  262|  57.0k|  MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  57.0k|  MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  263|  57.0k|  MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|  57.0k|  MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  264|  57.0k|  MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  57.0k|  MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  265|  57.0k|  MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|  57.0k|  MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
  ------------------
  |  |  184|  57.0k|#define MD5STEP(f, w, x, y, z, data, s) \
  |  |  185|  57.0k|( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  266|  57.0k|  MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|  57.0k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|       |
  268|  57.0k|  buf[0] += a;
  269|  57.0k|  buf[1] += b;
  270|  57.0k|  buf[2] += c;
  271|  57.0k|  buf[3] += d;
  272|  57.0k|}

store.c:proxytrack_print_log:
   79|  4.23k|                                 ...) {
   80|  4.23k|  if (severity != NULL) {
  ------------------
  |  Branch (80:7): [True: 0, False: 4.23k]
  ------------------
   81|      0|    va_list args;
   82|       |
   83|      0|    va_start(args, format);
   84|      0|    proxytrack_vprint_log(severity, format, args);
   85|       |    va_end(args);
   86|      0|  }
   87|  4.23k|}
store.c:PT_GetTime:
  157|  3.02k|HTS_UNUSED static struct tm PT_GetTime(time_t t) {
  158|  3.02k|  struct tm tmbuf;
  159|       |
  160|  3.02k|  if (!hts_gmtime(t, &tmbuf)) {
  ------------------
  |  Branch (160:7): [True: 0, False: 3.02k]
  ------------------
  161|       |    /* An all-zero tm prints day "00" in the ARC date, so use the epoch */
  162|      0|    memset(&tmbuf, 0, sizeof(tmbuf));
  163|      0|    tmbuf.tm_year = 70;
  164|      0|    tmbuf.tm_mday = 1;
  165|      0|  }
  166|  3.02k|  return tmbuf;
  167|  3.02k|}
store.c:set_filetime_time_t:
  176|  2.93k|                                                           time_t t) {
  177|  2.93k|  if (t != (time_t) 0 && t != (time_t) - 1) {
  ------------------
  |  Branch (177:7): [True: 2.93k, False: 0]
  |  Branch (177:26): [True: 84, False: 2.85k]
  ------------------
  178|     84|    struct tm tm = PT_GetTime(t);
  179|       |
  180|     84|    return set_filetime(file, &tm);
  181|     84|  }
  182|  2.85k|  return -1;
  183|  2.93k|}
store.c:set_filetime:
  168|     84|HTS_UNUSED static int set_filetime(const char *file, struct tm *tm_time) {
  169|     84|  struct utimbuf tim;
  170|       |
  171|     84|  tim.actime = tim.modtime = hts_time_clip(hts_utc_seconds(tm_time));
  172|     84|  return utime(file, &tim);
  173|     84|}

PT_New:
  236|  4.23k|PT_Indexes PT_New(void) {
  237|  4.23k|  PT_Indexes index = (PT_Indexes) calloct(sizeof(_PT_Indexes), 1);
  ------------------
  |  |  740|  4.23k|#define calloct(A, B) calloc((A), (B))
  ------------------
  238|       |
  239|  4.23k|  index->cil = coucal_new(0);
  240|  4.23k|  coucal_set_name(index->cil, "index->cil");
  241|  4.23k|  index->index_size = 0;
  242|       |  index->index = NULL;
  243|  4.23k|  return index;
  244|  4.23k|}
PT_Delete:
  246|  4.23k|void PT_Delete(PT_Indexes index) {
  247|  4.23k|  if (index != NULL) {
  ------------------
  |  Branch (247:7): [True: 4.23k, False: 0]
  ------------------
  248|  4.23k|    int i;
  249|       |
  250|       |    /* PT_IndexMerge took ownership of each index, file handle included */
  251|  8.09k|    for (i = 0; i < index->index_size; i++) {
  ------------------
  |  Branch (251:17): [True: 3.85k, False: 4.23k]
  ------------------
  252|  3.85k|      PT_Index_Delete(&index->index[i]);
  253|  3.85k|    }
  254|  4.23k|    freet(index->index);
  ------------------
  |  |  747|  4.23k|  do {                                                                         \
  |  |  748|  4.23k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 3.85k, False: 383]
  |  |  ------------------
  |  |  749|  3.85k|      free(A);                                                                 \
  |  |  750|  3.85k|      (A) = NULL;                                                              \
  |  |  751|  3.85k|    }                                                                          \
  |  |  752|  4.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 4.23k]
  |  |  ------------------
  ------------------
  255|  4.23k|    coucal_delete(&index->cil);
  256|       |    freet(index);
  ------------------
  |  |  747|  4.23k|  do {                                                                         \
  |  |  748|  4.23k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 4.23k, False: 0]
  |  |  ------------------
  |  |  749|  4.23k|      free(A);                                                                 \
  |  |  750|  4.23k|      (A) = NULL;                                                              \
  |  |  751|  4.23k|    }                                                                          \
  |  |  752|  4.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 4.23k]
  |  |  ------------------
  ------------------
  257|  4.23k|  }
  258|  4.23k|}
PT_AddIndex:
  391|  4.23k|int PT_AddIndex(PT_Indexes indexes, const char *path) {
  392|  4.23k|  PT_Index index = PT_LoadCache(path);
  393|       |
  394|  4.23k|  if (index != NULL) {
  ------------------
  |  Branch (394:7): [True: 3.85k, False: 383]
  ------------------
  395|  3.85k|    int ret = PT_IndexMerge(indexes, &index);
  396|       |
  397|  3.85k|    if (index != NULL) {
  ------------------
  |  Branch (397:9): [True: 0, False: 3.85k]
  ------------------
  398|      0|      PT_Index_Delete(&index);
  399|      0|    }
  400|  3.85k|    return ret;
  401|  3.85k|  }
  402|    383|  return -1;
  403|  4.23k|}
PT_Enumerate:
  454|  8.81k|char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
  455|       |  // should be cached!
  456|  8.81k|  if (indexes != NULL && indexes->cil != NULL) {
  ------------------
  |  Branch (456:7): [True: 8.81k, False: 0]
  |  Branch (456:26): [True: 8.81k, False: 0]
  ------------------
  457|  8.81k|    unsigned int urlSize;
  458|  8.81k|    String list = STRING_EMPTY;
  ------------------
  |  |   87|  8.81k|#define STRING_EMPTY {(char *) NULL, 0, 0}
  ------------------
  459|  8.81k|    String listindexes = STRING_EMPTY;
  ------------------
  |  |   87|  8.81k|#define STRING_EMPTY {(char *) NULL, 0, 0}
  ------------------
  460|  8.81k|    String subitem = STRING_EMPTY;
  ------------------
  |  |   87|  8.81k|#define STRING_EMPTY {(char *) NULL, 0, 0}
  ------------------
  461|  8.81k|    unsigned int listCount = 0;
  462|  8.81k|    struct_coucal_enum en = coucal_enum_new(indexes->cil);
  463|  8.81k|    coucal_item *chain;
  464|  8.81k|    void *blk = NULL;
  465|       |    /* Always built, because coucal does not check for a NULL table. The
  466|       |       dedup below is skipped under subtree, where keys can reduce to one. */
  467|  8.81k|    coucal hdupes = coucal_new(0);
  468|       |
  469|  8.81k|    coucal_set_name(hdupes, "hdupes");
  470|  8.81k|    StringClear(list);
  ------------------
  |  |  254|  8.81k|#define StringClear(BLK) StringClear_(&(BLK))
  ------------------
  471|  8.81k|    StringClear(listindexes);
  ------------------
  |  |  254|  8.81k|#define StringClear(BLK) StringClear_(&(BLK))
  ------------------
  472|  8.81k|    StringClear(subitem);
  ------------------
  |  |  254|  8.81k|#define StringClear(BLK) StringClear_(&(BLK))
  ------------------
  473|  8.81k|    if (strncmp(url, "http://", 7) == 0)
  ------------------
  |  Branch (473:9): [True: 5.87k, False: 2.93k]
  ------------------
  474|  5.87k|      url += 7;
  475|  8.81k|    urlSize = (unsigned int) strlen(url);
  476|   158k|    while((chain = coucal_enum_next(&en))) {
  ------------------
  |  Branch (476:11): [True: 149k, False: 8.81k]
  ------------------
  477|   149k|      long int index = (long int) chain->value.intg;
  478|       |
  479|   149k|      if (urlSize == 0 || strncmp(chain->name, url, urlSize) == 0) {
  ------------------
  |  Branch (479:11): [True: 99.4k, False: 49.7k]
  |  Branch (479:27): [True: 5.56k, False: 44.1k]
  ------------------
  480|   105k|        if (index >= 0 && index < indexes->index_size) {
  ------------------
  |  Branch (480:13): [True: 105k, False: 0]
  |  Branch (480:27): [True: 105k, False: 0]
  ------------------
  481|   105k|          char *item = (char*) chain->name + urlSize;
  482|       |
  483|   105k|          if (*item == '/')
  ------------------
  |  Branch (483:15): [True: 1.20k, False: 103k]
  ------------------
  484|  1.20k|            item++;
  485|   105k|          {
  486|   105k|            char *pos = subtree ? 0 : strchr_stop(item, '/', '?');
  ------------------
  |  Branch (486:25): [True: 49.7k, False: 55.2k]
  ------------------
  487|   105k|            unsigned int len =
  488|   105k|              pos ? (unsigned int) (pos - item) : (unsigned int) strlen(item);
  ------------------
  |  Branch (488:15): [True: 35.7k, False: 69.2k]
  ------------------
  489|   105k|            if (len > 0 /* default document */  || *item == 0) {
  ------------------
  |  Branch (489:17): [True: 104k, False: 554]
  |  Branch (489:52): [True: 296, False: 258]
  ------------------
  490|   104k|              int isFolder = (item[len] == '/');
  491|       |
  492|   104k|              StringClear(subitem);
  ------------------
  |  |  254|   104k|#define StringClear(BLK) StringClear_(&(BLK))
  ------------------
  493|   104k|              if (len > 0)
  ------------------
  |  Branch (493:19): [True: 104k, False: 296]
  ------------------
  494|   104k|                StringMemcat(subitem, item, len);
  ------------------
  |  |  305|   104k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  ------------------
  495|   104k|              if (len == 0 || subtree ||
  ------------------
  |  Branch (495:19): [True: 296, False: 104k]
  |  Branch (495:31): [True: 49.6k, False: 54.8k]
  ------------------
  496|  83.6k|                  !coucal_exists(hdupes, StringBuff(subitem))) {
  ------------------
  |  |   91|  54.8k|#define StringBuff(BLK) ((const char *) ((BLK).buffer_))
  ------------------
  |  Branch (496:19): [True: 33.6k, False: 21.1k]
  ------------------
  497|  83.6k|                if (len > 0)
  ------------------
  |  Branch (497:21): [True: 83.3k, False: 296]
  ------------------
  498|  83.3k|                  StringCat(list, StringBuff(subitem));
  ------------------
  |  |  373|  83.3k|  do {                                                                         \
  |  |  374|  83.3k|    const char *const str__ = (STR);                                           \
  |  |  375|  83.3k|    if (str__ != NULL) {                                                       \
  |  |  ------------------
  |  |  |  Branch (375:9): [True: 83.3k, False: 0]
  |  |  ------------------
  |  |  376|  83.3k|      const size_t size__ = strlen(str__);                                     \
  |  |  377|  83.3k|      StringMemcat(BLK, str__, size__);                                        \
  |  |  ------------------
  |  |  |  |  305|  83.3k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  |  |  ------------------
  |  |  378|  83.3k|    }                                                                          \
  |  |  379|  83.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (379:12): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
  499|  83.6k|                if (isFolder)
  ------------------
  |  Branch (499:21): [True: 14.7k, False: 68.8k]
  ------------------
  500|  14.7k|                  StringCat(list, "/");
  ------------------
  |  |  373|  14.7k|  do {                                                                         \
  |  |  374|  14.7k|    const char *const str__ = (STR);                                           \
  |  |  375|  14.7k|    if (str__ != NULL) {                                                       \
  |  |  ------------------
  |  |  |  Branch (375:9): [True: 14.7k, Folded]
  |  |  ------------------
  |  |  376|  14.7k|      const size_t size__ = strlen(str__);                                     \
  |  |  377|  14.7k|      StringMemcat(BLK, str__, size__);                                        \
  |  |  ------------------
  |  |  |  |  305|  14.7k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  |  |  ------------------
  |  |  378|  14.7k|    }                                                                          \
  |  |  379|  14.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (379:12): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  501|  83.6k|                StringMemcat(list, "\0", 1); /* NULL terminated strings */
  ------------------
  |  |  305|  83.6k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  ------------------
  502|  83.6k|                listCount++;
  503|  83.6k|                coucal_write(hdupes, StringBuff(subitem), 0);
  ------------------
  |  |   91|  83.6k|#define StringBuff(BLK) ((const char *) ((BLK).buffer_))
  ------------------
  504|  83.6k|              }
  505|   104k|            }
  506|   105k|          }
  507|   105k|        } else {
  508|      0|          proxytrack_print_log(CRITICAL,
  ------------------
  |  |   89|      0|#define CRITICAL "critical"
  ------------------
  509|      0|                               "PT_Enumerate:Corrupted central index locator");
  510|      0|        }
  511|   105k|      }
  512|   149k|    }
  513|  8.81k|    StringFree(subitem);
  ------------------
  |  |  277|  8.81k|#define StringFree(BLK) StringFree_(&(BLK))
  ------------------
  514|  8.81k|    coucal_delete(&hdupes);
  515|  8.81k|    if (listCount > 0) {
  ------------------
  |  Branch (515:9): [True: 5.98k, False: 2.83k]
  ------------------
  516|       |      /* One slot per URL plus the NULL that ends the array. */
  517|  5.98k|      const size_t slots = (size_t) listCount + 1;
  518|  5.98k|      char *nullPointer = NULL;
  519|  5.98k|      char *str;
  520|  5.98k|      size_t i;
  521|       |
  522|       |      /* The array of references first, then the strings it points into. */
  523|  95.5k|      for (i = 0; i < slots; i++)
  ------------------
  |  Branch (523:19): [True: 89.5k, False: 5.98k]
  ------------------
  524|  89.5k|        StringMemcat(listindexes, (char *) &nullPointer, sizeof(nullPointer));
  ------------------
  |  |  305|  89.5k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  ------------------
  525|  5.98k|      StringMemcat(listindexes, StringBuff(list), StringLength(list));
  ------------------
  |  |  305|  5.98k|#define StringMemcat(BLK, STR, SIZE) StringMemcat_(&(BLK), STR, (size_t) (SIZE))
  ------------------
  526|       |      /* ---- no reallocation beyond this point (fixed addresses) ---- */
  527|       |      /* The enumeration loop appended one NUL-terminated name per count,
  528|       |         in this order, so walking them fills the slots. The last stays NULL. */
  529|  5.98k|      str = StringBuffRW(listindexes) + slots * sizeof(char *);
  ------------------
  |  |   95|  5.98k|#define StringBuffRW(BLK) ((BLK).buffer_)
  ------------------
  530|  89.5k|      for(i = 0; i < listCount; i++) {
  ------------------
  |  Branch (530:18): [True: 83.6k, False: 5.98k]
  ------------------
  531|       |        /* memcpy, because a char* buffer is not aligned for a char** store. */
  532|  83.6k|        memcpy(&StringBuffRW(listindexes)[i * sizeof(char *)], &str,
  ------------------
  |  |   95|  83.6k|#define StringBuffRW(BLK) ((BLK).buffer_)
  ------------------
  533|  83.6k|               sizeof(str));
  534|  83.6k|        str += strlen(str) + 1;
  535|  83.6k|      }
  536|  5.98k|      blk = StringAcquire(&listindexes);
  537|  5.98k|    }
  538|  8.81k|    StringFree(list);
  ------------------
  |  |  277|  8.81k|#define StringFree(BLK) StringFree_(&(BLK))
  ------------------
  539|  8.81k|    StringFree(listindexes);
  ------------------
  |  |  277|  8.81k|#define StringFree(BLK) StringFree_(&(BLK))
  ------------------
  540|  8.81k|    return (char **) blk;
  541|  8.81k|  }
  542|      0|  return NULL;
  543|  8.81k|}
PT_Enumerate_Delete:
  545|  12.7k|void PT_Enumerate_Delete(char ***plist) {
  546|  12.7k|  if (plist != NULL && *plist != NULL) {
  ------------------
  |  Branch (546:7): [True: 12.7k, False: 0]
  |  Branch (546:24): [True: 5.98k, False: 6.73k]
  ------------------
  547|  5.98k|    freet(*plist);
  ------------------
  |  |  747|  5.98k|  do {                                                                         \
  |  |  748|  5.98k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 5.98k, False: 0]
  |  |  ------------------
  |  |  749|  5.98k|      free(A);                                                                 \
  |  |  750|  5.98k|      (A) = NULL;                                                              \
  |  |  751|  5.98k|    }                                                                          \
  |  |  752|  5.98k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 5.98k]
  |  |  ------------------
  ------------------
  548|       |    *plist = NULL;
  549|  5.98k|  }
  550|  12.7k|}
PT_SaveCache:
  687|  2.93k|int PT_SaveCache(PT_Indexes indexes, const char *filename) {
  688|  2.93k|  int type = PT_GetType(filename);
  689|       |
  690|  2.93k|  if (type != PT_CACHE_UNDEFINED) {
  ------------------
  |  Branch (690:7): [True: 2.93k, False: 0]
  ------------------
  691|  2.93k|    if (_IndexFuncts[type].PT_SaveCache != NULL) {
  ------------------
  |  Branch (691:9): [True: 2.93k, False: 0]
  ------------------
  692|  2.93k|      int ret = _IndexFuncts[type].PT_SaveCache(indexes, filename);
  693|       |
  694|  2.93k|      if (ret == 0) {
  ------------------
  |  Branch (694:11): [True: 2.93k, False: 0]
  ------------------
  695|       |        /* a failure only dates the saved cache as new */
  696|  2.93k|        (void) !set_filetime_time_t(filename, PT_GetTimeIndex(indexes));
  697|  2.93k|        return 0;
  698|  2.93k|      }
  699|  2.93k|    }
  700|  2.93k|  }
  701|      0|  return -1;
  702|  2.93k|}
PT_Element_Delete:
  786|  49.7k|void PT_Element_Delete(PT_Element * pentry) {
  787|  49.7k|  if (pentry != NULL) {
  ------------------
  |  Branch (787:7): [True: 49.7k, False: 0]
  ------------------
  788|  49.7k|    PT_Element entry = *pentry;
  789|       |
  790|  49.7k|    if (entry != NULL) {
  ------------------
  |  Branch (790:9): [True: 49.7k, False: 0]
  ------------------
  791|  49.7k|      if (entry->adr != NULL) {
  ------------------
  |  Branch (791:11): [True: 1.15k, False: 48.5k]
  ------------------
  792|  1.15k|        freet(entry->adr);
  ------------------
  |  |  747|  1.15k|  do {                                                                         \
  |  |  748|  1.15k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 1.15k, False: 0]
  |  |  ------------------
  |  |  749|  1.15k|      free(A);                                                                 \
  |  |  750|  1.15k|      (A) = NULL;                                                              \
  |  |  751|  1.15k|    }                                                                          \
  |  |  752|  1.15k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 1.15k]
  |  |  ------------------
  ------------------
  793|  1.15k|        entry->adr = NULL;
  794|  1.15k|      }
  795|  49.7k|      if (entry->headers != NULL) {
  ------------------
  |  Branch (795:11): [True: 563, False: 49.1k]
  ------------------
  796|    563|        freet(entry->headers);
  ------------------
  |  |  747|    563|  do {                                                                         \
  |  |  748|    563|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 563, False: 0]
  |  |  ------------------
  |  |  749|    563|      free(A);                                                                 \
  |  |  750|    563|      (A) = NULL;                                                              \
  |  |  751|    563|    }                                                                          \
  |  |  752|    563|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 563]
  |  |  ------------------
  ------------------
  797|    563|        entry->headers = NULL;
  798|    563|      }
  799|  49.7k|      if (entry->location != NULL) {
  ------------------
  |  Branch (799:11): [True: 0, False: 49.7k]
  ------------------
  800|      0|        freet(entry->location);
  ------------------
  |  |  747|      0|  do {                                                                         \
  |  |  748|      0|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  749|      0|      free(A);                                                                 \
  |  |  750|      0|      (A) = NULL;                                                              \
  |  |  751|      0|    }                                                                          \
  |  |  752|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  801|      0|        entry->location = NULL;
  802|      0|      }
  803|  49.7k|      freet(entry);
  ------------------
  |  |  747|  49.7k|  do {                                                                         \
  |  |  748|  49.7k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 49.7k, False: 0]
  |  |  ------------------
  |  |  749|  49.7k|      free(A);                                                                 \
  |  |  750|  49.7k|      (A) = NULL;                                                              \
  |  |  751|  49.7k|    }                                                                          \
  |  |  752|  49.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
  804|  49.7k|    }
  805|       |    *pentry = NULL;
  806|  49.7k|  }
  807|  49.7k|}
PT_ElementNew:
  881|  49.7k|PT_Element PT_ElementNew(void) {
  882|  49.7k|  PT_Element r = NULL;
  883|       |
  884|  49.7k|  if ((r = calloct(sizeof(_PT_Element), 1)) == NULL)
  ------------------
  |  |  740|  49.7k|#define calloct(A, B) calloc((A), (B))
  ------------------
  |  Branch (884:7): [True: 0, False: 49.7k]
  ------------------
  885|      0|    return NULL;
  886|  49.7k|  r->statuscode = STATUSCODE_INVALID;
  887|  49.7k|  r->indexId = -1;
  888|  49.7k|  return r;
  889|  49.7k|}
store.c:PT_Index_Delete:
  329|  4.23k|static void PT_Index_Delete(PT_Index *pindex) {
  330|  4.23k|  if (pindex != NULL && (*pindex) != NULL) {
  ------------------
  |  Branch (330:7): [True: 4.23k, False: 0]
  |  Branch (330:25): [True: 4.23k, False: 0]
  ------------------
  331|  4.23k|    PT_Index index = *pindex;
  332|       |
  333|  4.23k|    if (SAFE_INDEX(index)) {
  ------------------
  |  |  310|  4.23k|#define SAFE_INDEX(index) PT_Index_Check__(index, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (310:27): [True: 4.23k, False: 0]
  |  |  ------------------
  ------------------
  334|  4.23k|      _IndexFuncts[index->type].PT_Index_Delete(pindex);
  335|  4.23k|    }
  336|  4.23k|    freet(index);
  ------------------
  |  |  747|  4.23k|  do {                                                                         \
  |  |  748|  4.23k|    if ((A) != NULL) {                                                         \
  |  |  ------------------
  |  |  |  Branch (748:9): [True: 4.23k, False: 0]
  |  |  ------------------
  |  |  749|  4.23k|      free(A);                                                                 \
  |  |  750|  4.23k|      (A) = NULL;                                                              \
  |  |  751|  4.23k|    }                                                                          \
  |  |  752|  4.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (752:12): [Folded, False: 4.23k]
  |  |  ------------------
  ------------------
  337|       |    *pindex = NULL;
  338|  4.23k|  }
  339|  4.23k|}
store.c:PT_Index_Check__:
  300|  53.9k|                                    int line) {
  301|  53.9k|  if (index == NULL)
  ------------------
  |  Branch (301:7): [True: 0, False: 53.9k]
  ------------------
  302|      0|    return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  303|  53.9k|  if (index->type >= PT_CACHE_MIN && index->type <= PT_CACHE_MAX)
  ------------------
  |  Branch (303:7): [True: 53.9k, False: 0]
  |  Branch (303:38): [True: 53.9k, False: 0]
  ------------------
  304|  53.9k|    return HTS_TRUE;
  ------------------
  |  |  381|  53.9k|#define HTS_TRUE 1
  ------------------
  305|      0|  proxytrack_print_log(CRITICAL, "index corrupted in memory at %s:%d", file,
  ------------------
  |  |   89|      0|#define CRITICAL "critical"
  ------------------
  306|      0|                       line);
  307|      0|  return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
  308|  53.9k|}
store.c:strchr_stop:
  447|  55.2k|static char *strchr_stop(char *str, char c, char stop) {
  448|  2.75M|  for(; *str != 0 && *str != stop && *str != c; str++) ;
  ------------------
  |  Branch (448:9): [True: 2.73M, False: 17.9k]
  |  Branch (448:22): [True: 2.73M, False: 1.59k]
  |  Branch (448:38): [True: 2.69M, False: 35.7k]
  ------------------
  449|  55.2k|  if (*str == c)
  ------------------
  |  Branch (449:7): [True: 35.7k, False: 19.5k]
  ------------------
  450|  35.7k|    return str;
  451|  19.5k|  return NULL;
  452|  55.2k|}
store.c:PT_LoadCache:
  568|  4.23k|static PT_Index PT_LoadCache(const char *filename) {
  569|  4.23k|  int type = PT_GetType(filename);
  570|       |
  571|  4.23k|  if (type != PT_CACHE_UNDEFINED) {
  ------------------
  |  Branch (571:7): [True: 4.23k, False: 0]
  ------------------
  572|  4.23k|    PT_Index index = calloct(sizeof(_PT_Index), 1);
  ------------------
  |  |  740|  4.23k|#define calloct(A, B) calloc((A), (B))
  ------------------
  573|       |
  574|  4.23k|    if (index != NULL) {
  ------------------
  |  Branch (574:9): [True: 4.23k, False: 0]
  ------------------
  575|  4.23k|      index->type = type;
  576|  4.23k|      index->slots.common.timestamp = (time_t) time(NULL);
  577|  4.23k|      index->slots.common.startUrl[0] = '\0';
  578|  4.23k|      index->slots.common.hash = coucal_new(0);
  579|  4.23k|      coucal_set_name(index->slots.common.hash, "index->slots.common.hash");
  580|  4.23k|      if (!_IndexFuncts[type].PT_LoadCache(index, filename)) {
  ------------------
  |  Branch (580:11): [True: 383, False: 3.85k]
  ------------------
  581|    383|        proxytrack_print_log(DEBUG,
  ------------------
  |  |   95|    383|#define DEBUG NULL
  ------------------
  582|    383|                             "reading httrack cache (format #%d) %s : error",
  583|    383|                             type, filename);
  584|       |        /* the loader may already hold a file handle and entries */
  585|    383|        PT_Index_Delete(&index);
  586|    383|        return NULL;
  587|  3.85k|      } else {
  588|  3.85k|        proxytrack_print_log(DEBUG,
  ------------------
  |  |   95|  3.85k|#define DEBUG NULL
  ------------------
  589|  3.85k|                             "reading httrack cache (format #%d) %s : success",
  590|  3.85k|                             type, filename);
  591|  3.85k|      }
  592|       |      /* default starting URL is the first hash entry */
  593|  3.85k|      if (index->slots.common.startUrl[0] == '\0') {
  ------------------
  |  Branch (593:11): [True: 3.85k, False: 0]
  ------------------
  594|  3.85k|        struct_coucal_enum en = coucal_enum_new(index->slots.common.hash);
  595|  3.85k|        coucal_item *chain;
  596|       |
  597|  3.85k|        chain = coucal_enum_next(&en);
  598|  3.85k|        if (chain != NULL && strstr(chain->name, "/robots.txt") != NULL) {
  ------------------
  |  Branch (598:13): [True: 2.93k, False: 917]
  |  Branch (598:30): [True: 1, False: 2.93k]
  ------------------
  599|      1|          chain = coucal_enum_next(&en);
  600|      1|        }
  601|  3.85k|        if (chain != NULL) {
  ------------------
  |  Branch (601:13): [True: 2.93k, False: 918]
  ------------------
  602|  2.93k|          const char *scheme =
  603|  2.93k|              hts_shared_link_has_authority(chain->name) ? "" : "http://";
  ------------------
  |  Branch (603:15): [True: 165, False: 2.77k]
  ------------------
  604|       |
  605|       |          /* Drop a URL too long to fit. Empty reads as "unset" */
  606|  2.93k|          if (!sprintfbuff(index->slots.common.startUrl, "%s%s", scheme,
  ------------------
  |  |  658|  2.93k|  slprintfbuff((ARR), sizeof(ARR) + htsbuff_must_be_array_(ARR), __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  141|  2.93k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  142|  2.93k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  143|  2.93k|   1)
  |  |  ------------------
  ------------------
  |  Branch (606:15): [True: 39, False: 2.89k]
  ------------------
  607|  2.93k|                           (const char *) chain->name))
  608|     39|            index->slots.common.startUrl[0] = '\0';
  609|  2.93k|        }
  610|  3.85k|      }
  611|  3.85k|    }
  612|  3.85k|    return index;
  613|  4.23k|  }
  614|      0|  return NULL;
  615|  4.23k|}
store.c:PT_GetType:
  552|  7.17k|static int PT_GetType(const char *filename) {
  553|  7.17k|  char *dot = strrchr(filename, '.');
  554|       |
  555|  7.17k|  if (dot != NULL) {
  ------------------
  |  Branch (555:7): [True: 7.17k, False: 0]
  ------------------
  556|  7.17k|    if (hts_strcasecmp(dot, ".zip") == 0) {
  ------------------
  |  Branch (556:9): [True: 0, False: 7.17k]
  ------------------
  557|      0|      return PT_CACHE__NEW;
  558|  7.17k|    } else if (hts_strcasecmp(dot, ".ndx") == 0 ||
  ------------------
  |  Branch (558:16): [True: 0, False: 7.17k]
  ------------------
  559|  7.17k|               hts_strcasecmp(dot, ".dat") == 0) {
  ------------------
  |  Branch (559:16): [True: 0, False: 7.17k]
  ------------------
  560|      0|      return PT_CACHE__OLD;
  561|  7.17k|    } else if (hts_strcasecmp(dot, ".arc") == 0) {
  ------------------
  |  Branch (561:16): [True: 7.17k, False: 0]
  ------------------
  562|  7.17k|      return PT_CACHE__ARC;
  563|  7.17k|    }
  564|  7.17k|  }
  565|      0|  return PT_CACHE_UNDEFINED;
  566|  7.17k|}
store.c:file_timestamp:
  286|  4.23k|static time_t file_timestamp(const char *file) {
  287|  4.23k|  struct stat buf;
  288|       |
  289|  4.23k|  if (stat(file, &buf) == 0) {
  ------------------
  |  Branch (289:7): [True: 4.23k, False: 0]
  ------------------
  290|  4.23k|    time_t tt = buf.st_mtime;
  291|       |
  292|  4.23k|    if (tt != (time_t) 0 && tt != (time_t) - 1) {
  ------------------
  |  Branch (292:9): [True: 4.23k, False: 0]
  |  Branch (292:29): [True: 4.23k, False: 0]
  ------------------
  293|  4.23k|      return tt;
  294|  4.23k|    }
  295|  4.23k|  }
  296|      0|  return (time_t) 0;
  297|  4.23k|}
store.c:MutexInit:
  111|  4.23k|static void MutexInit(PT_Mutex *pMutex) {
  112|  4.23k|  (void) pthread_mutex_init(pMutex, 0);
  113|  4.23k|}
store.c:MutexFree:
  119|  4.23k|static void MutexFree(PT_Mutex *pMutex) { pthread_mutex_destroy(pMutex); }
store.c:PT_AppendHeader:
 1115|  3.03M|                            const char *name, const char *value) {
 1116|  3.03M|  const size_t nameLen = strlen(name);
 1117|  3.03M|  const size_t valueLen = strlen(value);
 1118|  3.03M|  const size_t need = nameLen + valueLen + sizeof(": \r\n"); /* NUL included */
 1119|       |
 1120|  3.03M|  if (need > *cap - *len) {
  ------------------
  |  Branch (1120:7): [True: 2.62k, False: 3.03M]
  ------------------
 1121|  2.62k|    const size_t want = (*cap > SIZE_MAX / 2 - need) ? 0 : *cap * 2 + need;
  ------------------
  |  Branch (1121:25): [True: 0, False: 2.62k]
  ------------------
 1122|  2.62k|    char *const grown = want != 0 ? realloct(*headers, want) : NULL;
  ------------------
  |  |  768|  2.62k|#define realloct(A, B) realloc(A, B)
  ------------------
  |  Branch (1122:25): [True: 2.62k, False: 0]
  ------------------
 1123|       |
 1124|  2.62k|    if (grown == NULL)
  ------------------
  |  Branch (1124:9): [True: 0, False: 2.62k]
  ------------------
 1125|      0|      return;
 1126|  2.62k|    *headers = grown;
 1127|  2.62k|    *cap = want;
 1128|  2.62k|  }
 1129|  3.03M|  memcpy(*headers + *len, name, nameLen);
 1130|  3.03M|  memcpy(*headers + *len + nameLen, ": ", 2);
 1131|  3.03M|  memcpy(*headers + *len + nameLen + 2, value, valueLen);
 1132|  3.03M|  memcpy(*headers + *len + nameLen + 2 + valueLen, "\r\n", 3);
 1133|  3.03M|  *len += nameLen + 2 + valueLen + 2;
 1134|  3.03M|}
store.c:PT_EnumCache:
  706|  2.93k|                        void *arg) {
  707|  2.93k|  if (indexes != NULL && indexes->cil != NULL) {
  ------------------
  |  Branch (707:7): [True: 2.93k, False: 0]
  |  Branch (707:26): [True: 2.93k, False: 0]
  ------------------
  708|  2.93k|    struct_coucal_enum en = coucal_enum_new(indexes->cil);
  709|  2.93k|    coucal_item *chain;
  710|       |
  711|  52.6k|    while((chain = coucal_enum_next(&en))) {
  ------------------
  |  Branch (711:11): [True: 49.7k, False: 2.93k]
  ------------------
  712|  49.7k|      const long int index_id = (long int) chain->value.intg;
  713|  49.7k|      const char *const url = chain->name;
  714|       |
  715|  49.7k|      if (index_id >= 0 && index_id < indexes->index_size) {
  ------------------
  |  Branch (715:11): [True: 49.7k, False: 0]
  |  Branch (715:28): [True: 49.7k, False: 0]
  ------------------
  716|  49.7k|        PT_Element item =
  717|  49.7k|          PT_ReadCache(indexes->index[index_id], url,
  718|  49.7k|                       FETCH_HEADERS | FETCH_BODY);
  719|  49.7k|        if (item != NULL) {
  ------------------
  |  Branch (719:13): [True: 49.7k, False: 0]
  ------------------
  720|  49.7k|          int ret = callback(arg, url, item);
  721|       |
  722|  49.7k|          PT_Element_Delete(&item);
  723|  49.7k|          if (ret != 0)
  ------------------
  |  Branch (723:15): [True: 0, False: 49.7k]
  ------------------
  724|      0|            return ret;
  725|  49.7k|        }
  726|  49.7k|      } else {
  727|      0|        proxytrack_print_log(CRITICAL,
  ------------------
  |  |   89|      0|#define CRITICAL "critical"
  ------------------
  728|      0|                             "PT_ReadCache:Corrupted central index locator");
  729|      0|        return -1;
  730|      0|      }
  731|  49.7k|    }
  732|  2.93k|  }
  733|  2.93k|  return 0;
  734|  2.93k|}
store.c:PT_Element_BodySize:
 1362|  49.7k|static size_t PT_Element_BodySize(const PT_Element element) {
 1363|  49.7k|  return element->adr != NULL ? element->size : 0;
  ------------------
  |  Branch (1363:10): [True: 1.15k, False: 48.5k]
  ------------------
 1364|  49.7k|}
store.c:PT_LoadCache__Arc:
 2254|  4.23k|hts_boolean PT_LoadCache__Arc(PT_Index index_, const char *filename) {
 2255|  4.23k|  if (index_ != NULL && filename != NULL) {
  ------------------
  |  Branch (2255:7): [True: 4.23k, False: 0]
  |  Branch (2255:25): [True: 4.23k, False: 0]
  ------------------
 2256|  4.23k|    PT_Index__Arc index = &index_->slots.formatArc;
 2257|       |
 2258|  4.23k|    index->timestamp = file_timestamp(filename);
 2259|  4.23k|    MutexInit(&index->fileLock);
 2260|  4.23k|    index->file = fopen(filename, "rb");
 2261|       |
 2262|       |    // Opened ?
 2263|  4.23k|    if (index->file != NULL) {
  ------------------
  |  Branch (2263:9): [True: 4.23k, False: 0]
  ------------------
 2264|  4.23k|      coucal hashtable = index->hash;
 2265|       |
 2266|       |      /* past LONG_MAX a 32-bit ftell cannot answer; keep serving the records
 2267|       |         it can still reach, with the bound no longer constraining */
 2268|  4.23k|      if (fseek(index->file, 0, SEEK_END) != 0 ||
  ------------------
  |  Branch (2268:11): [True: 0, False: 4.23k]
  ------------------
 2269|  4.23k|          (index->fileSize = ftell(index->file)) < 0) {
  ------------------
  |  Branch (2269:11): [True: 0, False: 4.23k]
  ------------------
 2270|      0|        index->fileSize = LONG_MAX;
 2271|      0|      }
 2272|  4.23k|      rewind(index->file);
 2273|  4.23k|      if (readArcURLRecord(index) == 0) {
  ------------------
  |  Branch (2273:11): [True: 4.21k, False: 29]
  ------------------
 2274|  4.21k|        int entries = 0;
 2275|       |
 2276|       |        /* Read first line */
 2277|  4.21k|        if (strncmp(index->line, "filedesc://", sizeof("filedesc://") - 1) != 0) {
  ------------------
  |  Branch (2277:13): [True: 118, False: 4.09k]
  ------------------
 2278|    118|          fprintf(stderr, "Unexpected bad signature #%s" LF, index->line);
  ------------------
  |  |  366|    118|#define LF "\x0a"
  ------------------
 2279|    118|          fclose(index->file);
 2280|    118|          index->file = NULL;
 2281|    118|          return HTS_FALSE;
  ------------------
  |  |  380|    118|#define HTS_FALSE 0
  ------------------
 2282|    118|        }
 2283|       |        /* Timestamp */
 2284|  4.09k|        index->timestamp = getArcTimestamp(index->line);
 2285|       |        /* Skip the version block, leaving the record loop its own separator */
 2286|  4.09k|        if (skipArcData(index->file, index->line) != 0 ||
  ------------------
  |  Branch (2286:13): [True: 147, False: 3.94k]
  ------------------
 2287|  3.94k|            skipArcVersionNl(index->file) != 0) {
  ------------------
  |  Branch (2287:13): [True: 89, False: 3.85k]
  ------------------
 2288|    236|          fprintf(stderr, "Unexpected bad data offset size first entry" LF);
  ------------------
  |  |  366|    236|#define LF "\x0a"
  ------------------
 2289|    236|          fclose(index->file);
 2290|    236|          index->file = NULL;
 2291|    236|          return HTS_FALSE;
  ------------------
  |  |  380|    236|#define HTS_FALSE 0
  ------------------
 2292|    236|        }
 2293|       |        /* Read all meta-entries (not data) */
 2294|  81.0k|        while(!feof(index->file)) {
  ------------------
  |  Branch (2294:15): [True: 81.0k, False: 25]
  ------------------
 2295|  81.0k|          unsigned long int fpos = ftell(index->file);
 2296|       |
 2297|  81.0k|          if (skipArcNl(index->file) == 0 && readArcURLRecord(index) == 0) {
  ------------------
  |  Branch (2297:15): [True: 77.4k, False: 3.58k]
  |  Branch (2297:46): [True: 77.4k, False: 26]
  ------------------
 2298|  77.4k|            int length = getArcLength(index->line);
 2299|       |
 2300|  77.4k|            if (length >= 0) {
  ------------------
  |  Branch (2300:17): [True: 77.2k, False: 216]
  ------------------
 2301|  77.2k|              const hts_buf fn =
 2302|  77.2k|                  HTS_BUF_N(index->filenameIndexBuff,
  ------------------
  |  |  196|  77.2k|  (HTS_COMPILE_ASSERT((N) <= sizeof(ARR)),                                     \
  |  |  ------------------
  |  |  |  |  399|  77.2k|#define HTS_COMPILE_ASSERT(cond) ((void) sizeof(char[(cond) ? 1 : -1]))
  |  |  ------------------
  |  |  197|  77.2k|   hts_buf_at((ARR), (N) + HTS_BUF_GUARD_(ARR)))
  |  |  ------------------
  |  |  |  |  190|  77.2k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  77.2k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  77.2k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  77.2k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2303|  77.2k|                            sizeof(index->filenameIndexBuff) - 1);
 2304|  77.2k|              const char *filenameIndex = copyArcField(index->line, 0, fn);
 2305|       |
 2306|  77.2k|              if (strncmp(filenameIndex, "http://", 7) == 0) {
  ------------------
  |  Branch (2306:19): [True: 21.5k, False: 55.6k]
  ------------------
 2307|  21.5k|                filenameIndex += 7;
 2308|  21.5k|              }
 2309|  77.2k|              if (*filenameIndex != 0) {
  ------------------
  |  Branch (2309:19): [True: 76.5k, False: 637]
  ------------------
 2310|  76.5k|                const long int dataStart = ftell(index->file);
 2311|  76.5k|                long int dataEnd;
 2312|       |
 2313|       |                /* the declared length is untrusted, so it stands alone here */
 2314|  76.5k|                if (dataStart < 0 || length > LONG_MAX - dataStart) {
  ------------------
  |  Branch (2314:21): [True: 0, False: 76.5k]
  |  Branch (2314:38): [True: 0, False: 76.5k]
  ------------------
 2315|      0|                  fprintf(stderr,
 2316|      0|                          "Corrupted cache data entry #%d (truncated file?), aborting read"
 2317|      0|                          LF, (int) entries);
  ------------------
  |  |  366|      0|#define LF "\x0a"
  ------------------
 2318|      0|                  break;
 2319|      0|                }
 2320|  76.5k|                dataEnd = dataStart + length;
 2321|  76.5k|                if (arcDataHoldsARecord(index, dataStart, dataEnd)) {
  ------------------
  |  Branch (2321:21): [True: 684, False: 75.8k]
  ------------------
 2322|    684|                  fprintf(stderr,
 2323|    684|                          "Cache data entry #%d reaches into the next record,"
 2324|    684|                          " skipped" LF,
  ------------------
  |  |  366|    684|#define LF "\x0a"
  ------------------
 2325|    684|                          (int) entries);
 2326|       |                  /* Skip only this record and resume at its end */
 2327|    684|                  if (fseek(index->file, dataEnd, SEEK_SET) != 0)
  ------------------
  |  Branch (2327:23): [True: 0, False: 684]
  ------------------
 2328|      0|                    break;
 2329|    684|                  continue;
 2330|    684|                }
 2331|  75.8k|                if (fseek(index->file, dataEnd, SEEK_SET) != 0) {
  ------------------
  |  Branch (2331:21): [True: 0, False: 75.8k]
  ------------------
 2332|      0|                  fprintf(stderr,
 2333|      0|                          "Corrupted cache data entry #%d (truncated file?), "
 2334|      0|                          "aborting read" LF,
  ------------------
  |  |  366|      0|#define LF "\x0a"
  ------------------
 2335|      0|                          (int) entries);
 2336|      0|                  break;
 2337|      0|                }
 2338|       |                /*fprintf(stdout, "adding %s [%d]\n", filenameIndex, (int)fpos); */
 2339|  75.8k|                if (PT_CompatibleScheme(index->filenameIndexBuff)) {
  ------------------
  |  Branch (2339:21): [True: 68.5k, False: 7.39k]
  ------------------
 2340|  68.5k|                  coucal_add(hashtable, filenameIndex, fpos);  /* position of meta-data */
 2341|  68.5k|                  entries++;
 2342|  68.5k|                }
 2343|  75.8k|              } else {
 2344|    637|                fprintf(stderr, "Corrupted cache meta entry #%d" LF,
  ------------------
  |  |  366|    637|#define LF "\x0a"
  ------------------
 2345|    637|                        (int) entries);
 2346|    637|              }
 2347|  77.2k|            } else {
 2348|    216|              fprintf(stderr,
 2349|    216|                      "Corrupted cache meta entry #%d, aborting read" LF,
  ------------------
  |  |  366|    216|#define LF "\x0a"
  ------------------
 2350|    216|                      (int) entries);
 2351|    216|              break;
 2352|    216|            }
 2353|  77.4k|          } else {
 2354|  3.61k|            break;
 2355|  3.61k|          }
 2356|  81.0k|        }
 2357|       |
 2358|       |        /* OK */
 2359|  3.85k|        return HTS_TRUE;
  ------------------
  |  |  381|  3.85k|#define HTS_TRUE 1
  ------------------
 2360|  4.09k|      } else {
 2361|     29|        fprintf(stderr, "Bad file (empty ?)" LF);
  ------------------
  |  |  366|     29|#define LF "\x0a"
  ------------------
 2362|     29|      }
 2363|  4.23k|    } else {
 2364|      0|      fprintf(stderr, "Unable to open file" LF);
  ------------------
  |  |  366|      0|#define LF "\x0a"
  ------------------
 2365|      0|      index = NULL;
 2366|      0|    }
 2367|  4.23k|  } else {
 2368|      0|    fprintf(stderr, "Bad arguments" LF);
  ------------------
  |  |  366|      0|#define LF "\x0a"
  ------------------
 2369|      0|  }
 2370|     29|  return HTS_FALSE;
  ------------------
  |  |  380|     29|#define HTS_FALSE 0
  ------------------
 2371|  4.23k|}
store.c:readArcURLRecord:
 2085|   130k|static int readArcURLRecord(PT_Index__Arc index) {
 2086|   130k|  index->line[0] = '\0';
 2087|   130k|  if (hts_shared_linput(index->file,
  ------------------
  |  Branch (2087:7): [True: 130k, False: 55]
  ------------------
 2088|   130k|                        HTS_BUF_N(index->line, sizeof(index->line) - 1),
  ------------------
  |  |  196|   130k|  (HTS_COMPILE_ASSERT((N) <= sizeof(ARR)),                                     \
  |  |  ------------------
  |  |  |  |  399|   130k|#define HTS_COMPILE_ASSERT(cond) ((void) sizeof(char[(cond) ? 1 : -1]))
  |  |  ------------------
  |  |  197|   130k|   hts_buf_at((ARR), (N) + HTS_BUF_GUARD_(ARR)))
  |  |  ------------------
  |  |  |  |  190|   130k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|   130k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|   130k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|   130k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2089|   130k|                        HTS_LINPUT_SKIP_NUL)) {
  ------------------
  |  |   54|   130k|#define HTS_LINPUT_SKIP_NUL 1
  ------------------
 2090|   130k|    return 0;
 2091|   130k|  }
 2092|     55|  return -1;
 2093|   130k|}
store.c:getArcTimestamp:
 2059|  4.09k|static time_t getArcTimestamp(const char *const line) {
 2060|  4.09k|  const char *pos;
 2061|       |
 2062|  4.09k|  if ((pos = getArcField(line, 2)) != NULL) {
  ------------------
  |  Branch (2062:7): [True: 4.07k, False: 20]
  ------------------
 2063|  4.07k|    int i;
 2064|       |
 2065|       |    /* date == YYYYMMDDhhmmss (Greenwich Mean Time) */
 2066|       |    /* example: 20050405154029  */
 2067|  16.8k|    for(i = 0; pos[i] >= '0' && pos[i] <= '9'; i++) ;
  ------------------
  |  Branch (2067:16): [True: 13.0k, False: 3.85k]
  |  Branch (2067:33): [True: 12.8k, False: 219]
  ------------------
 2068|  4.07k|    if (i == 14) {
  ------------------
  |  Branch (2068:9): [True: 173, False: 3.89k]
  ------------------
 2069|    173|      struct tm tm;
 2070|       |
 2071|    173|      memset(&tm, 0, sizeof(tm));
 2072|    173|      tm.tm_year = getDigit4(pos + 0) - 1900;   /* current year minus 1900 */
 2073|    173|      tm.tm_mon = getDigit2(pos + 4) - 1;       /* 0 – 11 */
 2074|    173|      tm.tm_mday = getDigit2(pos + 6);  /* 1 – 31 */
 2075|    173|      tm.tm_hour = getDigit2(pos + 8);  /* 0 – 23 */
 2076|    173|      tm.tm_min = getDigit2(pos + 10);  /* 0 – 59 */
 2077|    173|      tm.tm_sec = getDigit2(pos + 12);  /* 0 – 59 */
 2078|    173|      tm.tm_isdst = 0;
 2079|    173|      return getGMT(&tm);
 2080|    173|    }
 2081|  4.07k|  }
 2082|  3.91k|  return (time_t) - 1;
 2083|  4.09k|}
store.c:getArcField:
 1965|   501k|static const char *getArcField(const char *line, int pos) {
 1966|   501k|  int i;
 1967|       |
 1968|  48.8M|  for(i = 0; line[i] != '\0' && pos > 0; i++) {
  ------------------
  |  Branch (1968:14): [True: 48.5M, False: 270k]
  |  Branch (1968:33): [True: 48.3M, False: 231k]
  ------------------
 1969|  48.3M|    if (line[i] == ARC_SP)
  ------------------
  |  | 1963|  48.3M|#define ARC_SP ' '
  ------------------
  |  Branch (1969:9): [True: 890k, False: 47.4M]
  ------------------
 1970|   890k|      pos--;
 1971|  48.3M|  }
 1972|   501k|  if (pos == 0)
  ------------------
  |  Branch (1972:7): [True: 231k, False: 270k]
  ------------------
 1973|   231k|    return &line[i];
 1974|   270k|  return NULL;
 1975|   501k|}
store.c:getDigit4:
 2048|    173|static int getDigit4(const char *const pos) {
 2049|    173|  return getDigit(pos[0]) * 1000 + getDigit(pos[1]) * 100 +
 2050|    173|    getDigit(pos[2]) * 10 + getDigit(pos[3]);
 2051|    173|}
store.c:getDigit:
 2040|  2.42k|static int getDigit(const char digit) {
 2041|  2.42k|  return (int) (digit - '0');
 2042|  2.42k|}
store.c:getDigit2:
 2044|    865|static int getDigit2(const char *const pos) {
 2045|    865|  return getDigit(pos[0]) * 10 + getDigit(pos[1]);
 2046|    865|}
store.c:getGMT:
 2053|    173|static time_t getGMT(struct tm *tm) {
 2054|    173|  time_t t;
 2055|       |
 2056|    173|  return hts_tm_filetime(tm, &t) ? t : (time_t) -1;
  ------------------
  |  Branch (2056:10): [True: 171, False: 2]
  ------------------
 2057|    173|}
store.c:skipArcData:
 2029|  4.09k|static int skipArcData(FILE * file, const char *line) {
 2030|  4.09k|  int jump = getArcLength(line);
 2031|       |
 2032|  4.09k|  if (jump != -1) {
  ------------------
  |  Branch (2032:7): [True: 4.04k, False: 49]
  ------------------
 2033|  4.04k|    if (fseek(file, jump, SEEK_CUR) == 0 /* && skipArcNl(file) == 0 */ ) {
  ------------------
  |  Branch (2033:9): [True: 3.94k, False: 98]
  ------------------
 2034|  3.94k|      return 0;
 2035|  3.94k|    }
 2036|  4.04k|  }
 2037|    147|  return -1;
 2038|  4.09k|}
store.c:skipArcVersionNl:
 2017|  3.94k|static int skipArcVersionNl(FILE *file) {
 2018|  3.94k|  long int pos = ftell(file);
 2019|       |
 2020|  3.94k|  if (pos < 0 || fgetc(file) != 0x0a) {
  ------------------
  |  Branch (2020:7): [True: 0, False: 3.94k]
  |  Branch (2020:18): [True: 89, False: 3.85k]
  ------------------
 2021|     89|    return -1;
 2022|     89|  }
 2023|  3.85k|  if (fgetc(file) == 0x0a) { /* the blank line, when outside the length */
  ------------------
  |  Branch (2023:7): [True: 88, False: 3.76k]
  ------------------
 2024|     88|    pos++;
 2025|     88|  }
 2026|       |  return fseek(file, pos, SEEK_SET);
 2027|  3.94k|}
store.c:skipArcNl:
 2008|   130k|static int skipArcNl(FILE * file) {
 2009|   130k|  if (fgetc(file) == 0x0a) {
  ------------------
  |  Branch (2009:7): [True: 126k, False: 3.58k]
  ------------------
 2010|   126k|    return 0;
 2011|   126k|  }
 2012|  3.58k|  return -1;
 2013|   130k|}
store.c:getArcLength:
 1993|   133k|static int getArcLength(const char *line) {
 1994|   133k|  const char *pos;
 1995|       |
 1996|   133k|  if ((pos = getArcField(line, 9)) != NULL
  ------------------
  |  Branch (1996:7): [True: 507, False: 133k]
  ------------------
 1997|   133k|      || (pos = getArcField(line, 4)) != NULL
  ------------------
  |  Branch (1997:10): [True: 8.89k, False: 124k]
  ------------------
 1998|   131k|      || (pos = getArcField(line, 2)) != NULL) {
  ------------------
  |  Branch (1998:10): [True: 122k, False: 2.07k]
  ------------------
 1999|   131k|    int length;
 2000|       |
 2001|   131k|    if (sscanf(pos, "%d", &length) == 1) {
  ------------------
  |  Branch (2001:9): [True: 130k, False: 660]
  ------------------
 2002|   130k|      return length;
 2003|   130k|    }
 2004|   131k|  }
 2005|  2.73k|  return -1;
 2006|   133k|}
store.c:copyArcField:
 1977|  77.2k|static char *copyArcField(const char *line, int npos, hts_buf dest) {
 1978|  77.2k|  const char *pos;
 1979|       |
 1980|  77.2k|  if ((pos = getArcField(line, npos)) != NULL) {
  ------------------
  |  Branch (1980:7): [True: 77.2k, False: 0]
  ------------------
 1981|  77.2k|    const char *end = pos;
 1982|       |
 1983|  8.36M|    while (*end != '\0' && *end != ARC_SP)
  ------------------
  |  | 1963|  8.36M|#define ARC_SP ' '
  ------------------
  |  Branch (1983:12): [True: 8.36M, False: 0]
  |  Branch (1983:28): [True: 8.28M, False: 77.2k]
  ------------------
 1984|  8.28M|      end++;
 1985|       |    /* index->line, which holds the field, is no longer than dest */
 1986|  77.2k|    (void) !hts_buf_put_span_clip(dest, hts_span_between(pos, end));
 1987|  77.2k|    return dest.p;
 1988|  77.2k|  }
 1989|      0|  dest.p[0] = '\0';
 1990|       |  return NULL;
 1991|  77.2k|}
store.c:arcDataHoldsARecord:
 2205|  76.5k|                                       long int to) {
 2206|  76.5k|  char buffer[32768];
 2207|  76.5k|  char line[ARC_LINE_MAX + 1];
 2208|  76.5k|  long int base = from; /* offset buffer[0] was read from */
 2209|  76.5k|  size_t lineLen = 0;
 2210|       |
 2211|   108k|  while (base < to) {
  ------------------
  |  Branch (2211:10): [True: 35.5k, False: 73.3k]
  ------------------
 2212|  35.5k|    const long int left = to - base;
 2213|  35.5k|    size_t want =
 2214|  35.5k|        (left < (long int) sizeof(buffer)) ? (size_t) left : sizeof(buffer);
  ------------------
  |  Branch (2214:9): [True: 34.5k, False: 985]
  ------------------
 2215|  35.5k|    const size_t got = fread(buffer, 1, want, index->file);
 2216|  35.5k|    size_t i = 0;
 2217|       |
 2218|  2.14M|    while (i < got) {
  ------------------
  |  Branch (2218:12): [True: 2.12M, False: 22.4k]
  ------------------
 2219|  2.12M|      char *const nl = (char *) memchr(&buffer[i], 0x0a, got - i);
 2220|  2.12M|      const size_t chunk = (nl != NULL) ? (size_t) (nl - &buffer[i]) : got - i;
  ------------------
  |  Branch (2220:28): [True: 2.10M, False: 12.5k]
  ------------------
 2221|       |
 2222|  2.12M|      if (lineLen == 0 && nl != NULL) {
  ------------------
  |  Branch (2222:11): [True: 2.12M, False: 649]
  |  Branch (2222:27): [True: 2.10M, False: 12.4k]
  ------------------
 2223|       |        /* the whole line is in the buffer, so weigh it before copying it out */
 2224|  2.10M|        const hts_span raw = hts_span_at(&buffer[i], chunk);
 2225|       |
 2226|  2.10M|        if (arcMayOpenRecord(raw)) {
  ------------------
  |  Branch (2226:13): [True: 1.82M, False: 287k]
  ------------------
 2227|  1.82M|          (void) arcAppendLine(HTS_BUF(line), 0, raw);
  ------------------
  |  |  194|  1.82M|#define HTS_BUF(ARR) hts_buf_at((ARR), sizeof(ARR) + HTS_BUF_GUARD_(ARR))
  |  |  ------------------
  |  |  |  |  190|  1.82M|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  1.82M|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  1.82M|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  1.82M|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2228|  1.82M|          if (arcIsRecordLine(line))
  ------------------
  |  Branch (2228:15): [True: 600, False: 1.82M]
  ------------------
 2229|    600|            return HTS_TRUE;
  ------------------
  |  |  381|    600|#define HTS_TRUE 1
  ------------------
 2230|  1.82M|        }
 2231|  2.10M|      } else {
 2232|  13.1k|        lineLen = arcAppendLine(HTS_BUF(line), lineLen,
  ------------------
  |  |  194|  13.1k|#define HTS_BUF(ARR) hts_buf_at((ARR), sizeof(ARR) + HTS_BUF_GUARD_(ARR))
  |  |  ------------------
  |  |  |  |  190|  13.1k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  13.1k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  13.1k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  13.1k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|  13.1k|                                hts_span_at(&buffer[i], chunk));
 2234|  13.1k|        if (nl != NULL && arcMayOpenRecord(hts_span_at(line, lineLen)) &&
  ------------------
  |  Branch (2234:13): [True: 635, False: 12.5k]
  |  Branch (2234:27): [True: 354, False: 281]
  ------------------
 2235|    354|            arcIsRecordLine(line))
  ------------------
  |  Branch (2235:13): [True: 3, False: 351]
  ------------------
 2236|      3|          return HTS_TRUE;
  ------------------
  |  |  381|      3|#define HTS_TRUE 1
  ------------------
 2237|  13.1k|      }
 2238|  2.12M|      i += chunk;
 2239|  2.12M|      if (nl == NULL)
  ------------------
  |  Branch (2239:11): [True: 12.5k, False: 2.10M]
  ------------------
 2240|  12.5k|        break;
 2241|  2.10M|      i++;
 2242|  2.10M|      lineLen = 0;
 2243|  2.10M|    }
 2244|  34.9k|    base += (long int) got;
 2245|  34.9k|    if (got < want) /* short read: end of file */
  ------------------
  |  Branch (2245:9): [True: 2.64k, False: 32.3k]
  ------------------
 2246|  2.64k|      break;
 2247|  34.9k|  }
 2248|       |  /* Check the data's last line, which ends at the separator */
 2249|  75.9k|  if (lineLen != 0 && arcMayOpenRecord(hts_span_at(line, lineLen)))
  ------------------
  |  Branch (2249:7): [True: 11.7k, False: 64.2k]
  |  Branch (2249:23): [True: 1.74k, False: 9.99k]
  ------------------
 2250|  1.74k|    return arcIsRecordLine(line);
 2251|  74.2k|  return HTS_FALSE;
  ------------------
  |  |  380|  74.2k|#define HTS_FALSE 0
  ------------------
 2252|  75.9k|}
store.c:arcMayOpenRecord:
 2169|  2.12M|static hts_boolean arcMayOpenRecord(hts_span raw) {
 2170|  2.12M|  size_t i;
 2171|       |
 2172|  2.24M|  for (i = 0; i < raw.len && arcDroppedByte(raw.p[i]); i++)
  ------------------
  |  Branch (2172:15): [True: 2.23M, False: 17.2k]
  |  Branch (2172:30): [True: 127k, False: 2.10M]
  ------------------
 2173|   127k|    ;
 2174|  2.12M|  if (i == raw.len || !hts_isalpha((unsigned char) raw.p[i]))
  ------------------
  |  Branch (2174:7): [True: 17.2k, False: 2.10M]
  |  Branch (2174:23): [True: 97.8k, False: 2.00M]
  ------------------
 2175|   115k|    return HTS_FALSE;
  ------------------
  |  |  380|   115k|#define HTS_FALSE 0
  ------------------
 2176|  10.1M|  for (; i < raw.len; i++) {
  ------------------
  |  Branch (2176:10): [True: 10.1M, False: 37.1k]
  ------------------
 2177|  10.1M|    const char c = raw.p[i];
 2178|       |
 2179|  10.1M|    if (c == ':')
  ------------------
  |  Branch (2179:9): [True: 1.82M, False: 8.32M]
  ------------------
 2180|  1.82M|      return HTS_TRUE;
  ------------------
  |  |  381|  1.82M|#define HTS_TRUE 1
  ------------------
 2181|  8.32M|    if (arcDroppedByte(c))
  ------------------
  |  Branch (2181:9): [True: 90.0k, False: 8.23M]
  ------------------
 2182|  90.0k|      continue;
 2183|  8.23M|    if (!hts_isalnum((unsigned char) c) && c != '+' && c != '-' && c != '.')
  ------------------
  |  Branch (2183:9): [True: 293k, False: 7.93M]
  |  Branch (2183:44): [True: 198k, False: 95.3k]
  |  Branch (2183:56): [True: 173k, False: 24.4k]
  |  Branch (2183:68): [True: 145k, False: 27.7k]
  ------------------
 2184|   145k|      return HTS_FALSE;
  ------------------
  |  |  380|   145k|#define HTS_FALSE 0
  ------------------
 2185|  8.23M|  }
 2186|  37.1k|  return HTS_FALSE;
  ------------------
  |  |  380|  37.1k|#define HTS_FALSE 0
  ------------------
 2187|  2.00M|}
store.c:arcDroppedByte:
 2113|  24.2M|static hts_boolean arcDroppedByte(char c) {
 2114|  24.2M|  return (c == 0 || c == 9 || c == 12 || c == 13) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  1.71M|#define HTS_TRUE 1
  ------------------
                return (c == 0 || c == 9 || c == 12 || c == 13) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|  22.5M|#define HTS_FALSE 0
  ------------------
  |  Branch (2114:11): [True: 1.60M, False: 22.6M]
  |  Branch (2114:21): [True: 19.8k, False: 22.6M]
  |  Branch (2114:31): [True: 19.1k, False: 22.6M]
  |  Branch (2114:42): [True: 71.8k, False: 22.5M]
  ------------------
 2115|  24.2M|}
store.c:arcAppendLine:
 2191|  1.83M|static size_t arcAppendLine(hts_buf line, size_t len, hts_span raw) {
 2192|  1.83M|  size_t i;
 2193|       |
 2194|  15.5M|  for (i = 0; i < raw.len && len < line.size - 1; i++) {
  ------------------
  |  Branch (2194:15): [True: 13.7M, False: 1.83M]
  |  Branch (2194:30): [True: 13.7M, False: 393]
  ------------------
 2195|  13.7M|    if (!arcDroppedByte(raw.p[i]))
  ------------------
  |  Branch (2195:9): [True: 12.2M, False: 1.49M]
  ------------------
 2196|  12.2M|      line.p[len++] = raw.p[i];
 2197|  13.7M|  }
 2198|  1.83M|  line.p[len] = '\0';
 2199|  1.83M|  return len;
 2200|  1.83M|}
store.c:arcIsRecordLine:
 2160|  1.82M|static hts_boolean arcIsRecordLine(const char *line) {
 2161|  1.82M|  if (PT_CompatibleScheme(line) && getArcLength(line) >= 0)
  ------------------
  |  Branch (2161:7): [True: 2.84k, False: 1.82M]
  |  Branch (2161:36): [True: 278, False: 2.56k]
  ------------------
 2162|    278|    return HTS_TRUE;
  ------------------
  |  |  381|    278|#define HTS_TRUE 1
  ------------------
 2163|  1.82M|  return arcHasRecordShape(line);
 2164|  1.82M|}
store.c:arcHasRecordShape:
 2129|  1.82M|static hts_boolean arcHasRecordShape(const char *line) {
 2130|  1.82M|  const char *pos;
 2131|  1.82M|  int fields = 1;
 2132|  1.82M|  int last;
 2133|  1.82M|  int i;
 2134|       |
 2135|  1.82M|  if (!hts_isalpha((unsigned char) line[0]))
  ------------------
  |  Branch (2135:7): [True: 0, False: 1.82M]
  ------------------
 2136|      0|    return HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
 2137|  8.90M|  for (i = 0; line[i] != ':'; i++) {
  ------------------
  |  Branch (2137:15): [True: 7.08M, False: 1.82M]
  ------------------
 2138|  7.08M|    if (!hts_isalnum((unsigned char) line[i]) && line[i] != '+' &&
  ------------------
  |  Branch (2138:9): [True: 20.0k, False: 7.06M]
  |  Branch (2138:50): [True: 15.8k, False: 4.17k]
  ------------------
 2139|  15.8k|        line[i] != '-' && line[i] != '.')
  ------------------
  |  Branch (2139:9): [True: 2.79k, False: 13.0k]
  |  Branch (2139:27): [True: 198, False: 2.60k]
  ------------------
 2140|    198|      return HTS_FALSE;
  ------------------
  |  |  380|    198|#define HTS_FALSE 0
  ------------------
 2141|  7.08M|  }
 2142|  1.82M|  if (line[i + 1] == '\0' || line[i + 1] == ARC_SP)
  ------------------
  |  | 1963|  1.51M|#define ARC_SP ' '
  ------------------
  |  Branch (2142:7): [True: 312k, False: 1.51M]
  |  Branch (2142:30): [True: 59.0k, False: 1.45M]
  ------------------
 2143|   371k|    return HTS_FALSE;
  ------------------
  |  |  380|   371k|#define HTS_FALSE 0
  ------------------
 2144|  5.55M|  for (last = i; line[i] != '\0'; i++) {
  ------------------
  |  Branch (2144:18): [True: 4.10M, False: 1.45M]
  ------------------
 2145|  4.10M|    if (line[i] != ARC_SP)
  ------------------
  |  | 1963|  4.10M|#define ARC_SP ' '
  ------------------
  |  Branch (2145:9): [True: 4.03M, False: 67.2k]
  ------------------
 2146|  4.03M|      last = i;
 2147|  4.10M|  }
 2148|  10.2M|  for (i = 0; i < last; i++) {
  ------------------
  |  Branch (2148:15): [True: 8.78M, False: 1.45M]
  ------------------
 2149|  8.78M|    if (line[i] == ARC_SP)
  ------------------
  |  | 1963|  8.78M|#define ARC_SP ' '
  ------------------
  |  Branch (2149:9): [True: 62.1k, False: 8.71M]
  ------------------
 2150|  62.1k|      fields++;
 2151|  8.78M|  }
 2152|  1.45M|  if (fields != 5 && fields != 10)
  ------------------
  |  Branch (2152:7): [True: 1.45M, False: 1.16k]
  |  Branch (2152:22): [True: 1.44M, False: 2.46k]
  ------------------
 2153|  1.44M|    return HTS_FALSE;
  ------------------
  |  |  380|  1.44M|#define HTS_FALSE 0
  ------------------
 2154|  3.62k|  pos = getArcField(line, fields - 1);
 2155|  3.62k|  return (pos != NULL && arcDigitField(pos) > 0) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|    406|#define HTS_TRUE 1
  ------------------
                return (pos != NULL && arcDigitField(pos) > 0) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|  3.22k|#define HTS_FALSE 0
  ------------------
  |  Branch (2155:11): [True: 3.62k, False: 0]
  |  Branch (2155:26): [True: 406, False: 3.22k]
  ------------------
 2156|  1.45M|}
store.c:arcDigitField:
 2118|  3.62k|static int arcDigitField(const char *pos) {
 2119|  3.62k|  int i;
 2120|       |
 2121|  6.42k|  for (i = 0; pos[i] >= '0' && pos[i] <= '9'; i++)
  ------------------
  |  Branch (2121:15): [True: 5.25k, False: 1.17k]
  |  Branch (2121:32): [True: 2.80k, False: 2.45k]
  ------------------
 2122|  2.80k|    ;
 2123|  3.62k|  return (pos[i] == '\0' || pos[i] == ARC_SP) ? i : -1;
  ------------------
  |  | 1963|  3.41k|#define ARC_SP ' '
  ------------------
  |  Branch (2123:11): [True: 212, False: 3.41k]
  |  Branch (2123:29): [True: 194, False: 3.22k]
  ------------------
 2124|  3.62k|}
store.c:PT_CompatibleScheme:
 2096|  1.89M|static int PT_CompatibleScheme(const char *url) {
 2097|  1.89M|  return (str_begins(url, "http:")
  ------------------
  |  | 2095|  3.79M|#define str_begins(str, sstr) ( strncmp(str, sstr, sizeof(sstr) - 1) == 0 )
  |  |  ------------------
  |  |  |  Branch (2095:31): [True: 59.3k, False: 1.83M]
  |  |  ------------------
  ------------------
 2098|  1.83M|          || str_begins(url, "https:")
  ------------------
  |  | 2095|  3.73M|#define str_begins(str, sstr) ( strncmp(str, sstr, sizeof(sstr) - 1) == 0 )
  |  |  ------------------
  |  |  |  Branch (2095:31): [True: 931, False: 1.83M]
  |  |  ------------------
  ------------------
 2099|  1.83M|          || str_begins(url, "ftp:")
  ------------------
  |  | 2095|  3.73M|#define str_begins(str, sstr) ( strncmp(str, sstr, sizeof(sstr) - 1) == 0 )
  |  |  ------------------
  |  |  |  Branch (2095:31): [True: 10.8k, False: 1.82M]
  |  |  ------------------
  ------------------
 2100|  1.82M|          || str_begins(url, "file:"));
  ------------------
  |  | 2095|  1.82M|#define str_begins(str, sstr) ( strncmp(str, sstr, sizeof(sstr) - 1) == 0 )
  |  |  ------------------
  |  |  |  Branch (2095:31): [True: 188, False: 1.82M]
  |  |  ------------------
  ------------------
 2101|  1.89M|}
store.c:PT_Index_Delete__Arc:
  375|  4.23k|static void PT_Index_Delete__Arc(PT_Index * pindex) {
  376|  4.23k|  if (pindex != NULL && (*pindex) != NULL) {
  ------------------
  |  Branch (376:7): [True: 4.23k, False: 0]
  |  Branch (376:25): [True: 4.23k, False: 0]
  ------------------
  377|  4.23k|    PT_Index__Arc index = &(*pindex)->slots.formatArc;
  378|       |
  379|  4.23k|    if (index->file != NULL) {
  ------------------
  |  Branch (379:9): [True: 3.88k, False: 354]
  ------------------
  380|  3.88k|      fclose(index->file);
  381|  3.88k|      index->file = NULL;
  382|  3.88k|    }
  383|  4.23k|    if (index->hash != NULL) {
  ------------------
  |  Branch (383:9): [True: 4.23k, False: 0]
  ------------------
  384|  4.23k|      coucal_delete(&index->hash);
  385|       |      index->hash = NULL;
  386|  4.23k|    }
  387|  4.23k|    MutexFree(&index->fileLock);
  388|  4.23k|  }
  389|  4.23k|}
store.c:PT_ReadCache__Arc:
 2374|  49.7k|                                    int flags) {
 2375|  49.7k|  PT_Index__Arc index = (PT_Index__Arc) & index_->slots.formatArc;
 2376|  49.7k|  char location_default[HTS_URLMAXSIZE * 2];
 2377|  49.7k|  intptr_t hash_pos;
 2378|  49.7k|  int hash_pos_return;
 2379|  49.7k|  size_t headersLen = 0, headersCap = 0;
 2380|  49.7k|  PT_Element r = NULL;
 2381|       |
 2382|  49.7k|  if (index == NULL || index->hash == NULL || url == NULL || *url == 0)
  ------------------
  |  Branch (2382:7): [True: 0, False: 49.7k]
  |  Branch (2382:24): [True: 0, False: 49.7k]
  |  Branch (2382:47): [True: 0, False: 49.7k]
  |  Branch (2382:62): [True: 0, False: 49.7k]
  ------------------
 2383|      0|    return NULL;
 2384|  49.7k|  if ((r = PT_ElementNew()) == NULL)
  ------------------
  |  Branch (2384:7): [True: 0, False: 49.7k]
  ------------------
 2385|      0|    return NULL;
 2386|  49.7k|  location_default[0] = '\0';
 2387|  49.7k|  memset(r, 0, sizeof(_PT_Element));
 2388|  49.7k|  r->location = location_default;
 2389|  49.7k|  r->location[0] = '\0';
 2390|  49.7k|  if (strncmp(url, "http://", 7) == 0)
  ------------------
  |  Branch (2390:7): [True: 681, False: 49.0k]
  ------------------
 2391|    681|    url += 7;
 2392|  49.7k|  hash_pos_return = coucal_read(index->hash, url, &hash_pos);
 2393|       |
 2394|  49.7k|  if (hash_pos_return) {
  ------------------
  |  Branch (2394:7): [True: 49.2k, False: 463]
  ------------------
 2395|  49.2k|    if (fseek(index->file, (long) hash_pos, SEEK_SET) == 0) {
  ------------------
  |  Branch (2395:9): [True: 49.2k, False: 0]
  ------------------
 2396|  49.2k|      if (skipArcNl(index->file) == 0 && readArcURLRecord(index) == 0) {
  ------------------
  |  Branch (2396:11): [True: 49.2k, False: 0]
  |  Branch (2396:42): [True: 49.2k, False: 0]
  ------------------
 2397|  49.2k|        long int fposMeta = ftell(index->file);
 2398|  49.2k|        int dataLength = getArcLength(index->line);
 2399|       |        /* a line reaching past this belongs to the record stored after it */
 2400|  49.2k|        const long int fposEnd = dataLength >= 0 ? fposMeta + dataLength : -1;
  ------------------
  |  Branch (2400:34): [True: 49.2k, False: 0]
  ------------------
 2401|  49.2k|        const char *pos;
 2402|  49.2k|        const hts_buf lb = HTS_BUF_N(index->line, sizeof(index->line) - 1);
  ------------------
  |  |  196|  49.2k|  (HTS_COMPILE_ASSERT((N) <= sizeof(ARR)),                                     \
  |  |  ------------------
  |  |  |  |  399|  49.2k|#define HTS_COMPILE_ASSERT(cond) ((void) sizeof(char[(cond) ? 1 : -1]))
  |  |  ------------------
  |  |  197|  49.2k|   hts_buf_at((ARR), (N) + HTS_BUF_GUARD_(ARR)))
  |  |  ------------------
  |  |  |  |  190|  49.2k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  49.2k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  49.2k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  49.2k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2403|  49.2k|        LLint declaredLength = 0;
 2404|  49.2k|        const hts_cache_field fields[] = {
 2405|  49.2k|            {"Content-Length", HTS_CACHE_FIELD_LLINT, &declaredLength, 0},
 2406|  49.2k|            {"Content-Type", HTS_CACHE_FIELD_STRING, r->contenttype,
 2407|  49.2k|             sizeof(r->contenttype)},
 2408|  49.2k|            {"Last-Modified", HTS_CACHE_FIELD_STRING, r->lastmodified,
 2409|  49.2k|             sizeof(r->lastmodified)},
 2410|  49.2k|            {"Etag", HTS_CACHE_FIELD_STRING, r->etag, sizeof(r->etag)},
 2411|  49.2k|            {"Location", HTS_CACHE_FIELD_STRING, r->location,
 2412|  49.2k|             sizeof(location_default)},
 2413|  49.2k|            {"Content-Disposition", HTS_CACHE_FIELD_STRING, r->cdispo,
 2414|  49.2k|             sizeof(r->cdispo)},
 2415|  49.2k|        };
 2416|       |
 2417|       |        /* Read HTTP headers */
 2418|       |        /* HTTP/1.1 404 Not Found */
 2419|  49.2k|        if (hts_shared_linput(index->file, lb, HTS_LINPUT_SKIP_NUL) &&
  ------------------
  |  |   54|  49.2k|#define HTS_LINPUT_SKIP_NUL 1
  ------------------
  |  Branch (2419:13): [True: 14.7k, False: 34.5k]
  ------------------
 2420|  14.7k|            !arcPastRecordEnd(index->file, fposEnd)) {
  ------------------
  |  Branch (2420:13): [True: 12.8k, False: 1.86k]
  ------------------
 2421|  12.8k|          if ((pos = getArcField(index->line, 1)) != NULL) {
  ------------------
  |  Branch (2421:15): [True: 10.4k, False: 2.43k]
  ------------------
 2422|  10.4k|            if (sscanf(pos, "%d", &r->statuscode) != 1) {
  ------------------
  |  Branch (2422:17): [True: 1.65k, False: 8.79k]
  ------------------
 2423|  1.65k|              r->statuscode = STATUSCODE_INVALID;
 2424|  1.65k|            }
 2425|  10.4k|          }
 2426|  12.8k|          if ((pos = getArcField(index->line, 2)) != NULL) {
  ------------------
  |  Branch (2426:15): [True: 4.45k, False: 8.42k]
  ------------------
 2427|  4.45k|            r->msg[0] = '\0';
 2428|  4.45k|            strncatbuff(r->msg, pos, sizeof(r->msg) - 1);
  ------------------
  |  |  242|  4.45k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  4.45k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  243|  4.45k|                        strncat_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B), N,  \
  |  |  ------------------
  |  |  |  |  164|  4.45k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.45k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.45k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [True: 4.45k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  244|  4.45k|                                      "overflow while appending '" #B          \
  |  |  245|  4.45k|                                      "' to '" #A "'",                         \
  |  |  246|  4.45k|                                      __FILE__, __LINE__),                     \
  |  |  247|  4.45k|                        strncatbuff_ptr_((A), (B), (N)))
  ------------------
 2429|  4.45k|          }
 2430|  3.13M|          while (hts_shared_linput(index->file, lb, HTS_LINPUT_SKIP_NUL) &&
  ------------------
  |  |   54|  3.13M|#define HTS_LINPUT_SKIP_NUL 1
  ------------------
  |  Branch (2430:18): [True: 3.12M, False: 7.75k]
  ------------------
 2431|  3.12M|                 index->line[0] != '\0') {
  ------------------
  |  Branch (2431:18): [True: 3.12M, False: 0]
  ------------------
 2432|  3.12M|            char *const line = index->line;
 2433|  3.12M|            char *value = strchr(line, ':');
 2434|       |
 2435|  3.12M|            if (arcPastRecordEnd(index->file, fposEnd))
  ------------------
  |  Branch (2435:17): [True: 5.12k, False: 3.12M]
  ------------------
 2436|  5.12k|              break;
 2437|  3.12M|            if (value != NULL) {
  ------------------
  |  Branch (2437:17): [True: 3.05M, False: 64.7k]
  ------------------
 2438|  3.05M|              *value = '\0';
 2439|  3.11M|              for(value++; *value == ' ' || *value == '\t'; value++) ;
  ------------------
  |  Branch (2439:28): [True: 59.5k, False: 3.05M]
  |  Branch (2439:45): [True: 0, False: 3.05M]
  ------------------
 2440|  3.05M|              if (!hts_cache_store_field(fields,
  ------------------
  |  Branch (2440:19): [True: 3.05M, False: 4.72k]
  ------------------
 2441|  3.05M|                                         sizeof(fields) / sizeof(fields[0]),
 2442|  3.05M|                                         line, value) &&
 2443|  3.05M|                  line[0] != '\0') {
  ------------------
  |  Branch (2443:19): [True: 3.03M, False: 15.0k]
  ------------------
 2444|  3.03M|                PT_AppendHeader(&r->headers, &headersLen, &headersCap, line,
 2445|  3.03M|                                value);
 2446|  3.03M|              }
 2447|  3.05M|            }
 2448|  3.12M|          }
 2449|       |
 2450|       |          /* size_t is 32 bits on some targets, so narrow only what fits */
 2451|  12.8k|          r->size = declaredLength > 0 && (uint64_t) declaredLength <= SIZE_MAX
  ------------------
  |  Branch (2451:21): [True: 268, False: 12.6k]
  |  Branch (2451:43): [True: 268, False: 0]
  ------------------
 2452|  12.8k|                        ? (size_t) declaredLength
 2453|  12.8k|                        : 0;
 2454|       |
 2455|       |          /* FIXME charset */
 2456|  12.8k|          if (r->contenttype[0] != '\0') {
  ------------------
  |  Branch (2456:15): [True: 137, False: 12.7k]
  ------------------
 2457|    137|            char *pos = strchr(r->contenttype, ';');
 2458|       |
 2459|    137|            if (pos != NULL) {
  ------------------
  |  Branch (2459:17): [True: 51, False: 86]
  ------------------
 2460|     51|              *pos = 0;
 2461|     51|              if ((pos = strchr(r->contenttype, ' ')) != NULL) {
  ------------------
  |  Branch (2461:19): [True: 13, False: 38]
  ------------------
 2462|     13|                *pos = 0;
 2463|     13|              }
 2464|     51|            }
 2465|    137|          }
 2466|       |
 2467|       |          /* Read data */
 2468|  12.8k|          if (r->statuscode != STATUSCODE_INVALID) {    /* Can continue */
  ------------------
  |  Branch (2468:15): [True: 11.2k, False: 1.65k]
  ------------------
 2469|  11.2k|            if (flags & FETCH_BODY) {
  ------------------
  |  Branch (2469:17): [True: 11.2k, False: 0]
  ------------------
 2470|  11.2k|              long int fposCurrent = ftell(index->file);
 2471|  11.2k|              long int metaSize = fposCurrent - fposMeta;
 2472|  11.2k|              LLint fetchSize = declaredLength;
 2473|       |
 2474|  11.2k|              if (fetchSize <= 0) {
  ------------------
  |  Branch (2474:19): [True: 11.0k, False: 187]
  ------------------
 2475|  11.0k|                fetchSize = dataLength - metaSize;
 2476|  11.0k|              }
 2477|       |              /* the declared body may exceed the archive we allocate it from */
 2478|  11.2k|              if (fetchSize < 0 || fetchSize > dataLength - metaSize ||
  ------------------
  |  Branch (2478:19): [True: 8.52k, False: 2.70k]
  |  Branch (2478:36): [True: 139, False: 2.56k]
  ------------------
 2479|  10.0k|                  fetchSize > index->fileSize - fposCurrent) {
  ------------------
  |  Branch (2479:19): [True: 1.40k, False: 1.15k]
  ------------------
 2480|  10.0k|                r->statuscode = STATUSCODE_INVALID;
 2481|  10.0k|                strcpybuff(r->msg, "Cache Read Error : Truncated Data");
  ------------------
  |  |  293|  10.0k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  10.0k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|  10.0k|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|  10.0k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.0k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  10.0k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 10.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|  10.0k|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|  10.0k|                                     "'",                                      \
  |  |  297|  10.0k|                                     __FILE__, __LINE__),                      \
  |  |  298|  10.0k|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2482|  10.0k|              }
 2483|  11.2k|              r->size = 0;
 2484|  11.2k|              if (r->statuscode != STATUSCODE_INVALID) {
  ------------------
  |  Branch (2484:19): [True: 1.15k, False: 10.0k]
  ------------------
 2485|  1.15k|                r->adr = (char *) malloct((size_t) fetchSize);
  ------------------
  |  |  736|  1.15k|#define malloct(A) malloc(A)
  ------------------
 2486|  1.15k|                if (r->adr != NULL) {
  ------------------
  |  Branch (2486:21): [True: 1.15k, False: 0]
  ------------------
 2487|  1.15k|                  if (fetchSize > 0 &&
  ------------------
  |  Branch (2487:23): [True: 384, False: 775]
  ------------------
 2488|    384|                      (r->size = fread(r->adr, 1, (size_t) fetchSize,
  ------------------
  |  Branch (2488:23): [True: 0, False: 384]
  ------------------
 2489|    384|                                       index->file)) != (size_t) fetchSize) {
 2490|      0|                    int last_errno = errno;
 2491|       |
 2492|      0|                    r->statuscode = STATUSCODE_INVALID;
 2493|      0|                    PT_Element_failf(r, "Read error in cache disk data: %s",
  ------------------
  |  |  893|      0|  slprintfbuff_clip((R)->msg, sizeof((R)->msg), __VA_ARGS__)
  ------------------
 2494|      0|                                     strerror(last_errno));
 2495|      0|                  }
 2496|  1.15k|                } else {
 2497|      0|                  r->statuscode = STATUSCODE_INVALID;
 2498|      0|                  strcpybuff(r->msg,
  ------------------
  |  |  293|      0|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|      0|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|      0|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|      0|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|      0|                                     "'",                                      \
  |  |  297|      0|                                     __FILE__, __LINE__),                      \
  |  |  298|      0|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2499|      0|                             "Read error (memory exhausted) from cache");
 2500|      0|                }
 2501|  1.15k|              }
 2502|  11.2k|            }
 2503|  11.2k|          }
 2504|       |
 2505|  36.3k|        } else {
 2506|  36.3k|          r->statuscode = STATUSCODE_INVALID;
 2507|  36.3k|          strcpybuff(r->msg, "Cache Read Error : Read Header Error");
  ------------------
  |  |  293|  36.3k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  36.3k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|  36.3k|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|  36.3k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  36.3k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  36.3k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 36.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|  36.3k|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|  36.3k|                                     "'",                                      \
  |  |  297|  36.3k|                                     __FILE__, __LINE__),                      \
  |  |  298|  36.3k|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2508|  36.3k|        }
 2509|       |
 2510|  49.2k|      } else {
 2511|      0|        r->statuscode = STATUSCODE_INVALID;
 2512|      0|        strcpybuff(r->msg, "Cache Read Error : Read Header Error");
  ------------------
  |  |  293|      0|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|      0|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|      0|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|      0|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|      0|                                     "'",                                      \
  |  |  297|      0|                                     __FILE__, __LINE__),                      \
  |  |  298|      0|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2513|      0|      }
 2514|  49.2k|    } else {
 2515|      0|      r->statuscode = STATUSCODE_INVALID;
 2516|      0|      strcpybuff(r->msg, "Cache Read Error : Seek Error");
  ------------------
  |  |  293|      0|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|      0|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|      0|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|      0|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|      0|                                     "'",                                      \
  |  |  297|      0|                                     __FILE__, __LINE__),                      \
  |  |  298|      0|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2517|      0|    }
 2518|       |
 2519|  49.2k|  } else {
 2520|    463|    r->statuscode = STATUSCODE_INVALID;
 2521|    463|    strcpybuff(r->msg, "File Cache Entry Not Found");
  ------------------
  |  |  293|    463|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|    463|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|    463|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|    463|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    463|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|    463|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 463]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|    463|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|    463|                                     "'",                                      \
  |  |  297|    463|                                     __FILE__, __LINE__),                      \
  |  |  298|    463|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2522|    463|  }
 2523|  49.7k|  if (r->location[0] != '\0') {
  ------------------
  |  Branch (2523:7): [True: 0, False: 49.7k]
  ------------------
 2524|      0|    r->location = strdupt(r->location);
  ------------------
  |  |  756|      0|#define strdupt(A) strdup(A)
  ------------------
 2525|  49.7k|  } else {
 2526|       |    r->location = NULL;
 2527|  49.7k|  }
 2528|  49.7k|  return r;
 2529|  49.7k|}
store.c:arcPastRecordEnd:
 2103|  3.13M|static hts_boolean arcPastRecordEnd(FILE *file, long int end) {
 2104|  3.13M|  return (end >= 0 && ftell(file) > end) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|  6.98k|#define HTS_TRUE 1
  ------------------
                return (end >= 0 && ftell(file) > end) ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|  3.13M|#define HTS_FALSE 0
  ------------------
  |  Branch (2104:11): [True: 3.13M, False: 0]
  |  Branch (2104:23): [True: 6.98k, False: 3.13M]
  ------------------
 2105|  3.13M|}
store.c:PT_SaveCache__Arc:
 2646|  2.93k|static int PT_SaveCache__Arc(PT_Indexes indexes, const char *filename) {
 2647|  2.93k|  FILE *fp = fopen(filename, "wb");
 2648|       |
 2649|  2.93k|  if (fp != NULL) {
  ------------------
  |  Branch (2649:7): [True: 2.93k, False: 0]
  ------------------
 2650|  2.93k|    PT_SaveCache__Arc_t st;
 2651|  2.93k|    int ret;
 2652|  2.93k|    time_t t = PT_GetTimeIndex(indexes);
 2653|  2.93k|    struct tm tm = PT_GetTime(t);
 2654|       |
 2655|       |    /* version-2-block ==
 2656|       |       filedesc://<path><sp><ip_address><sp><date><sp>text/plain<sp>200<sp>-<sp>-<sp>0<sp><filename><sp><length><nl>
 2657|       |       2<sp><reserved><sp><origin-code><nl>
 2658|       |       URL<sp>IP-address<sp>Archive-date<sp>Content-type<sp>Result-code<sp>Checksum<sp>Location<sp> Offset<sp>Filename<sp>Archive-length<nl>
 2659|       |       <nl> */
 2660|  2.93k|    const char *prefix = "2 0 HTTrack Website Copier"
 2661|  2.93k|                         "\n"
 2662|  2.93k|                         "URL IP-address Archive-Date Content-Type Result-code "
 2663|  2.93k|                         "Checksum Location Offset Filename Archive-length"
 2664|  2.93k|                         "\n";
 2665|  2.93k|    hts_buf_printf_clip(HTS_BUF(st.filename), "httrack_%d.arc", (int) t);
  ------------------
  |  |  194|  2.93k|#define HTS_BUF(ARR) hts_buf_at((ARR), sizeof(ARR) + HTS_BUF_GUARD_(ARR))
  |  |  ------------------
  |  |  |  |  190|  2.93k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  2.93k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  2.93k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  2.93k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2666|  2.93k|    fprintf(fp,
 2667|  2.93k|            "filedesc://%s 0.0.0.0 %04d%02d%02d%02d%02d%02d text/plain 200 - - 0 %s %d"
 2668|  2.93k|            "\n" "%s", st.filename, tm.tm_year + 1900, tm.tm_mon + 1,
 2669|  2.93k|            tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, st.filename,
 2670|  2.93k|            (int) strlen(prefix), prefix);
 2671|       |    /* the blank line closing the version block is a separator, outside the
 2672|       |       declared length */
 2673|  2.93k|    fputc('\n', fp);
 2674|  2.93k|    st.fp = fp;
 2675|  2.93k|    st.indexes = indexes;
 2676|  2.93k|    st.t = t;
 2677|  2.93k|    ret = PT_EnumCache(indexes, PT_SaveCache__Arc_Fun, (void *) &st);
 2678|  2.93k|    fclose(fp);
 2679|  2.93k|    if (ret != 0)
  ------------------
  |  Branch (2679:9): [True: 0, False: 2.93k]
  ------------------
 2680|      0|      (void) unlink(filename);
 2681|  2.93k|    return ret;
 2682|  2.93k|  }
 2683|      0|  return -1;
 2684|  2.93k|}
store.c:PT_SaveCache__Arc_Fun:
 2554|  49.7k|static int PT_SaveCache__Arc_Fun(void *arg, const char *url, PT_Element element) {
 2555|  49.7k|  PT_SaveCache__Arc_t *st = (PT_SaveCache__Arc_t *) arg;
 2556|  49.7k|  FILE *const fp = st->fp;
 2557|  49.7k|  const size_t body_size = PT_Element_BodySize(element);
 2558|  49.7k|  struct tm *tm = convert_time_rfc822(&st->buff, element->lastmodified);
 2559|  49.7k|  struct tm unknown_date;
 2560|       |  /* the two strcatbuff calls closing the block rely on these 4 bytes */
 2561|  49.7k|  const hts_buf room = HTS_BUF_N(st->headers, sizeof(st->headers) - 4);
  ------------------
  |  |  196|  49.7k|  (HTS_COMPILE_ASSERT((N) <= sizeof(ARR)),                                     \
  |  |  ------------------
  |  |  |  |  399|  49.7k|#define HTS_COMPILE_ASSERT(cond) ((void) sizeof(char[(cond) ? 1 : -1]))
  |  |  ------------------
  |  |  197|  49.7k|   hts_buf_at((ARR), (N) + HTS_BUF_GUARD_(ARR)))
  |  |  ------------------
  |  |  |  |  190|  49.7k|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|  49.7k|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|  49.7k|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|  49.7k|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2562|  49.7k|  hts_boolean fit;
 2563|  49.7k|  int size_headers;
 2564|       |
 2565|  49.7k|  if (body_size != element->size) {
  ------------------
  |  Branch (2565:7): [True: 81, False: 49.6k]
  ------------------
 2566|     81|    fprintf(stderr, "Entry %s stored without its %lu-byte body" LF, url,
  ------------------
  |  |  366|     81|#define LF "\x0a"
  ------------------
 2567|     81|            (unsigned long) element->size);
 2568|     81|  }
 2569|       |
 2570|       |  /* a cached entry with no parseable Last-Modified must not take the writer
 2571|       |     down; the epoch is the conventional "date unknown" */
 2572|  49.7k|  if (tm == NULL) {
  ------------------
  |  Branch (2572:7): [True: 49.4k, False: 313]
  ------------------
 2573|  49.4k|    memset(&unknown_date, 0, sizeof(unknown_date));
 2574|  49.4k|    unknown_date.tm_year = 70;
 2575|  49.4k|    unknown_date.tm_mday = 1;
 2576|  49.4k|    tm = &unknown_date;
 2577|  49.4k|  }
 2578|       |
 2579|  49.7k|  fit = hts_buf_printf(room,
 2580|  49.7k|                       "HTTP/1.0 %d %s"
 2581|  49.7k|                       "\r\n"
 2582|  49.7k|                       "X-Server: ProxyTrack " PROXYTRACK_VERSION "\r\n"
 2583|  49.7k|                       "Content-type: %s%s%s%s"
 2584|  49.7k|                       "\r\n"
 2585|  49.7k|                       "Last-modified: %s"
 2586|  49.7k|                       "\r\n"
 2587|  49.7k|                       "Content-length: %d"
 2588|  49.7k|                       "\r\n",
 2589|  49.7k|                       element->statuscode, element->msg,
 2590|  49.7k|                       /**/ hts_effective_mime(element->contenttype),
 2591|  49.7k|                       (element->charset[0] ? "; charset=\"" : ""),
  ------------------
  |  Branch (2591:25): [True: 0, False: 49.7k]
  ------------------
 2592|  49.7k|                       (element->charset[0] ? element->charset : ""),
  ------------------
  |  Branch (2592:25): [True: 0, False: 49.7k]
  ------------------
 2593|  49.7k|                       (element->charset[0] ? "\"" : ""),
  ------------------
  |  Branch (2593:25): [True: 0, False: 49.7k]
  ------------------
 2594|  49.7k|                       /**/ element->lastmodified, (int) body_size);
 2595|  49.7k|  if (element->location != NULL && element->location[0] != '\0') {
  ------------------
  |  Branch (2595:7): [True: 0, False: 49.7k]
  |  Branch (2595:36): [True: 0, False: 0]
  ------------------
 2596|      0|    if (!arc_headers_cat(room, "Location: ") ||
  ------------------
  |  Branch (2596:9): [True: 0, False: 0]
  ------------------
 2597|      0|        !arc_headers_cat(room, element->location) ||
  ------------------
  |  Branch (2597:9): [True: 0, False: 0]
  ------------------
 2598|      0|        !arc_headers_cat(room, "\r\n")) {
  ------------------
  |  Branch (2598:9): [True: 0, False: 0]
  ------------------
 2599|      0|      fit = HTS_FALSE;
  ------------------
  |  |  380|      0|#define HTS_FALSE 0
  ------------------
 2600|      0|    }
 2601|      0|  }
 2602|  49.7k|  if (element->headers != NULL && !arc_headers_cat(room, element->headers)) {
  ------------------
  |  Branch (2602:7): [True: 563, False: 49.1k]
  |  Branch (2602:35): [True: 138, False: 425]
  ------------------
 2603|    138|    fit = HTS_FALSE;
  ------------------
  |  |  380|    138|#define HTS_FALSE 0
  ------------------
 2604|    138|  }
 2605|       |  /* a clip landing mid-line must still end it, or the body reads as a header */
 2606|  49.7k|  if (hts_lastchar(st->headers) != '\n') {
  ------------------
  |  Branch (2606:7): [True: 112, False: 49.6k]
  ------------------
 2607|    112|    strcatbuff(st->headers, "\r\n");
  ------------------
  |  |  267|    112|  __builtin_choose_expr(                                                       \
  |  |  268|    112|      HTS_IS_CHAR_BUFFER(A),                                                   \
  |  |  ------------------
  |  |  |  |  126|    112|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  269|    112|      strncat_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B), (size_t) -1,          \
  |  |  ------------------
  |  |  |  |  164|    112|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    112|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|    112|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 112]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  270|    112|                    "overflow while appending '" #B "' to '" #A "'", __FILE__, \
  |  |  271|       |                    __LINE__),                                                 \
  |  |  272|    112|      strcatbuff_ptr_((A), (B)))
  ------------------
 2608|    112|  }
 2609|  49.7k|  strcatbuff(st->headers, "\r\n");
  ------------------
  |  |  267|  49.7k|  __builtin_choose_expr(                                                       \
  |  |  268|  49.7k|      HTS_IS_CHAR_BUFFER(A),                                                   \
  |  |  ------------------
  |  |  |  |  126|  49.7k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  269|  49.7k|      strncat_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B), (size_t) -1,          \
  |  |  ------------------
  |  |  |  |  164|  49.7k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  49.7k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  49.7k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 49.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  270|  49.7k|                    "overflow while appending '" #B "' to '" #A "'", __FILE__, \
  |  |  271|       |                    __LINE__),                                                 \
  |  |  272|  49.7k|      strcatbuff_ptr_((A), (B)))
  ------------------
 2610|  49.7k|  size_headers = (int) strlen(st->headers);
 2611|  49.7k|  if (!fit) {
  ------------------
  |  Branch (2611:7): [True: 138, False: 49.5k]
  ------------------
 2612|    138|    fprintf(stderr, "Headers of %s clipped to %d bytes" LF, url, size_headers);
  ------------------
  |  |  366|    138|#define LF "\x0a"
  ------------------
 2613|    138|  }
 2614|       |
 2615|       |  /* doc == <nl><URL-record><nl><network_doc> */
 2616|       |
 2617|       |  /* Format: URL IP date mime result checksum location offset filename length */
 2618|  49.7k|  if (body_size != 0) {
  ------------------
  |  Branch (2618:7): [True: 384, False: 49.3k]
  ------------------
 2619|    384|    domd5mem(hts_span_at(element->adr, body_size), HTS_BUF(st->md5), HTS_TRUE);
  ------------------
  |  |  194|    384|#define HTS_BUF(ARR) hts_buf_at((ARR), sizeof(ARR) + HTS_BUF_GUARD_(ARR))
  |  |  ------------------
  |  |  |  |  190|    384|#define HTS_BUF_GUARD_(ARR) htsbuff_must_be_array_(ARR)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    384|  (sizeof(char[1 - 2 * !!__builtin_types_compatible_p(__typeof__(A),           \
  |  |  |  |  |  |  142|    384|                                                      __typeof__(&(A)[0]))]) - \
  |  |  |  |  |  |  143|    384|   1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  domd5mem(hts_span_at(element->adr, body_size), HTS_BUF(st->md5), HTS_TRUE);
  ------------------
  |  |  381|    384|#define HTS_TRUE 1
  ------------------
 2620|  49.3k|  } else {
 2621|  49.3k|    strcpybuff(st->md5, "-");
  ------------------
  |  |  293|  49.3k|  __builtin_choose_expr(HTS_IS_CHAR_BUFFER(A),                                 \
  |  |  ------------------
  |  |  |  |  126|  49.3k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  ------------------
  |  |  294|  49.3k|                        strcpy_safe_(A, sizeof(A), B, HTS_SIZEOF_SRC_(B),      \
  |  |  ------------------
  |  |  |  |  164|  49.3k|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  49.3k|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  49.3k|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [Folded, False: 49.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  295|  49.3k|                                     "overflow while copying '" #B "' to '" #A \
  |  |  296|  49.3k|                                     "'",                                      \
  |  |  297|  49.3k|                                     __FILE__, __LINE__),                      \
  |  |  298|  49.3k|                        strcpybuff_ptr_((A), (B)))
  ------------------
 2622|  49.3k|  }
 2623|  49.7k|  fprintf(fp,
 2624|       |          /* nl */
 2625|  49.7k|          "\n"
 2626|       |          /* URL-record */
 2627|  49.7k|          "%s%s %s %04d%02d%02d%02d%02d%02d %s %d %s %s %ld %s %ld"
 2628|       |          /* nl */
 2629|  49.7k|          "\n",
 2630|       |          /* args */
 2631|  49.7k|          (hts_shared_link_has_authority(url) ? "" : "http://"), url, "0.0.0.0",
  ------------------
  |  Branch (2631:12): [True: 1.74k, False: 47.9k]
  ------------------
 2632|  49.7k|          tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
 2633|  49.7k|          tm->tm_min, tm->tm_sec, hts_effective_mime(element->contenttype),
 2634|  49.7k|          element->statuscode, st->md5,
 2635|  49.7k|          (element->location ? element->location : "-"), (long int) ftell(fp),
  ------------------
  |  Branch (2635:12): [True: 0, False: 49.7k]
  ------------------
 2636|  49.7k|          st->filename, (long int) (size_headers + body_size));
 2637|       |  /* network_doc */
 2638|  49.7k|  if (!hts_fwrite_exact(st->headers, size_headers, fp) ||
  ------------------
  |  Branch (2638:7): [True: 0, False: 49.7k]
  ------------------
 2639|  49.7k|      (body_size != 0 && !hts_fwrite_exact(element->adr, body_size, fp))) {
  ------------------
  |  Branch (2639:8): [True: 384, False: 49.3k]
  |  Branch (2639:26): [True: 0, False: 384]
  ------------------
 2640|      0|    return 1;                   /* Error */
 2641|      0|  }
 2642|       |
 2643|  49.7k|  return 0;
 2644|  49.7k|}
store.c:arc_headers_cat:
 2544|    563|static hts_boolean arc_headers_cat(hts_buf headers, const char *src) {
 2545|    563|  const size_t used = strlen(headers.p);
 2546|    563|  const size_t left = used < headers.size - 1 ? headers.size - used - 1 : 0;
  ------------------
  |  Branch (2546:23): [True: 563, False: 0]
  ------------------
 2547|       |
 2548|    563|  if (left != 0) {
  ------------------
  |  Branch (2548:7): [True: 563, False: 0]
  ------------------
 2549|    563|    strlncatbuff(headers.p, src, headers.size, left);
  ------------------
  |  |  328|    563|  strncat_safe_(A, S, B, HTS_SIZEOF_SRC_(B), N,                                \
  |  |  ------------------
  |  |  |  |  164|    563|  (HTS_IS_NOT_CHAR_BUFFER(B) ? (size_t) -1 : sizeof(__typeof__(B)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    563|#define HTS_IS_NOT_CHAR_BUFFER(VAR) (!HTS_IS_CHAR_BUFFER(VAR))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|    563|  (__builtin_types_compatible_p(__typeof__(VAR), char[]))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:37): [True: 563, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  329|    563|                "overflow while appending '" #B "' to '" #A "'", __FILE__,     \
  |  |  330|       |                __LINE__)
  ------------------
 2550|    563|  }
 2551|    563|  return strlen(src) <= left ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  381|    425|#define HTS_TRUE 1
  ------------------
                return strlen(src) <= left ? HTS_TRUE : HTS_FALSE;
  ------------------
  |  |  380|    138|#define HTS_FALSE 0
  ------------------
  |  Branch (2551:10): [True: 425, False: 138]
  ------------------
 2552|    563|}
store.c:PT_IndexMerge:
  740|  3.85k|static int PT_IndexMerge(PT_Indexes indexes, PT_Index *pindex) {
  741|  3.85k|  if (pindex != NULL && *pindex != NULL && (*pindex)->slots.common.hash != NULL
  ------------------
  |  Branch (741:7): [True: 3.85k, False: 0]
  |  Branch (741:25): [True: 3.85k, False: 0]
  |  Branch (741:44): [True: 3.85k, False: 0]
  ------------------
  742|  3.85k|      && indexes != NULL) {
  ------------------
  |  Branch (742:10): [True: 3.85k, False: 0]
  ------------------
  743|  3.85k|    PT_Index index = *pindex;
  744|  3.85k|    struct_coucal_enum en = coucal_enum_new(index->slots.common.hash);
  745|  3.85k|    coucal_item *chain;
  746|       |    /* index_size counts a slot only once the array holds it, so a failed
  747|       |       realloc leaves neither a phantom entry nor a dropped array */
  748|  3.85k|    PT_Index *const grown = realloct(
  ------------------
  |  |  768|  3.85k|#define realloct(A, B) realloc(A, B)
  ------------------
  749|  3.85k|        indexes->index, sizeof(*indexes->index) * (indexes->index_size + 1));
  750|  3.85k|    int index_id;
  751|  3.85k|    int nMerged = 0;
  752|       |
  753|  3.85k|    if (grown != NULL) {
  ------------------
  |  Branch (753:9): [True: 3.85k, False: 0]
  ------------------
  754|  3.85k|      indexes->index = grown;
  755|  3.85k|      index_id = indexes->index_size++;
  756|  3.85k|      indexes->index[index_id] = index;
  757|  3.85k|      *pindex = NULL;
  758|  53.5k|      while((chain = coucal_enum_next(&en)) != NULL) {
  ------------------
  |  Branch (758:13): [True: 49.7k, False: 3.85k]
  ------------------
  759|  49.7k|        const char *url = chain->name;
  760|       |
  761|  49.7k|        if (url != NULL && url[0] != '\0') {
  ------------------
  |  Branch (761:13): [True: 49.7k, False: 0]
  |  Branch (761:28): [True: 49.7k, False: 0]
  ------------------
  762|  49.7k|          intptr_t previous_index_id = 0;
  763|       |
  764|  49.7k|          if (coucal_read(indexes->cil, url, &previous_index_id)) {
  ------------------
  |  Branch (764:15): [True: 0, False: 49.7k]
  ------------------
  765|      0|            if (previous_index_id >= 0
  ------------------
  |  Branch (765:17): [True: 0, False: 0]
  ------------------
  766|      0|                && previous_index_id < indexes->index_size) {
  ------------------
  |  Branch (766:20): [True: 0, False: 0]
  ------------------
  767|      0|              if (indexes->index[previous_index_id]->slots.common.timestamp > index->slots.common.timestamp)    // existing entry is newer
  ------------------
  |  Branch (767:19): [True: 0, False: 0]
  ------------------
  768|      0|                continue;
  769|      0|            } else {
  770|      0|              proxytrack_print_log(CRITICAL,
  ------------------
  |  |   89|      0|#define CRITICAL "critical"
  ------------------
  771|      0|                                   "PT_IndexMerge:Corrupted central index locator");
  772|      0|            }
  773|      0|          }
  774|  49.7k|          coucal_write(indexes->cil, chain->name, index_id);
  775|  49.7k|          nMerged++;
  776|  49.7k|        }
  777|  49.7k|      }
  778|  3.85k|    } else {
  779|      0|      proxytrack_print_log(CRITICAL, "PT_IndexMerge:Memory exhausted");
  ------------------
  |  |   89|      0|#define CRITICAL "critical"
  ------------------
  780|      0|    }
  781|  3.85k|    return nMerged;
  782|  3.85k|  }
  783|      0|  return -1;
  784|  3.85k|}
store.c:PT_GetTimeIndex:
  857|  5.87k|static time_t PT_GetTimeIndex(PT_Indexes indexes) {
  858|  5.87k|  if (indexes != NULL && indexes->index_size > 0) {
  ------------------
  |  Branch (858:7): [True: 5.87k, False: 0]
  |  Branch (858:26): [True: 5.87k, False: 0]
  ------------------
  859|  5.87k|    int i;
  860|  5.87k|    time_t maxt = indexes->index[0]->slots.common.timestamp;
  861|       |
  862|  5.87k|    for(i = 1; i < indexes->index_size; i++) {
  ------------------
  |  Branch (862:16): [True: 0, False: 5.87k]
  ------------------
  863|      0|      const time_t currt = indexes->index[i]->slots.common.timestamp;
  864|       |
  865|      0|      if (currt > maxt) {
  ------------------
  |  Branch (865:11): [True: 0, False: 0]
  ------------------
  866|      0|        maxt = currt;
  867|      0|      }
  868|      0|    }
  869|  5.87k|    return maxt;
  870|  5.87k|  }
  871|      0|  return (time_t) - 1;
  872|  5.87k|}
store.c:PT_ReadCache:
  895|  49.7k|static PT_Element PT_ReadCache(PT_Index index, const char *url, int flags) {
  896|  49.7k|  if (index != NULL && SAFE_INDEX(index)) {
  ------------------
  |  |  310|  49.7k|#define SAFE_INDEX(index) PT_Index_Check__(index, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (310:27): [True: 49.7k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (896:7): [True: 49.7k, False: 0]
  ------------------
  897|  49.7k|    PT_Mutex *const lock = PT_Index_Lock(index);
  898|  49.7k|    PT_Element r;
  899|       |
  900|  49.7k|    MutexLock(lock);
  901|  49.7k|    r = _IndexFuncts[index->type].PT_ReadCache(index, url, flags);
  902|  49.7k|    MutexUnlock(lock);
  903|  49.7k|    return r;
  904|  49.7k|  }
  905|      0|  return NULL;
  906|  49.7k|}
store.c:PT_Index_Lock:
  313|  49.7k|static PT_Mutex *PT_Index_Lock(PT_Index index) {
  314|  49.7k|  switch (index->type) {
  315|      0|  case PT_CACHE__NEW:
  ------------------
  |  Branch (315:3): [True: 0, False: 49.7k]
  ------------------
  316|      0|    return &index->slots.formatNew.zFileLock;
  317|      0|  case PT_CACHE__OLD:
  ------------------
  |  Branch (317:3): [True: 0, False: 49.7k]
  ------------------
  318|      0|    return &index->slots.formatOld.fileLock;
  319|  49.7k|  case PT_CACHE__ARC:
  ------------------
  |  Branch (319:3): [True: 49.7k, False: 0]
  ------------------
  320|  49.7k|  default:
  ------------------
  |  Branch (320:3): [True: 0, False: 49.7k]
  ------------------
  321|  49.7k|    return &index->slots.formatArc.fileLock;
  322|  49.7k|  }
  323|  49.7k|}
store.c:MutexLock:
  115|  49.7k|static void MutexLock(PT_Mutex *pMutex) { pthread_mutex_lock(pMutex); }
store.c:MutexUnlock:
  117|  49.7k|static void MutexUnlock(PT_Mutex *pMutex) { pthread_mutex_unlock(pMutex); }

