Curl_altsvc_cleanup:
  412|     54|{
  413|     54|  if(*asi) {
  ------------------
  |  Branch (413:6): [True: 0, False: 54]
  ------------------
  414|      0|    struct Curl_llist_node *e;
  415|      0|    struct Curl_llist_node *n;
  416|      0|    struct altsvcinfo *altsvc = *asi;
  417|      0|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (417:45): [True: 0, False: 0]
  ------------------
  418|      0|      struct altsvc *as = Curl_node_elem(e);
  419|      0|      n = Curl_node_next(e);
  420|      0|      altsvc_free(as);
  ------------------
  |  |   99|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  421|      0|    }
  422|      0|    curlx_free(altsvc->filename);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  423|      0|    curlx_free(altsvc);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  424|       |    *asi = NULL; /* clear the pointer */
  425|      0|  }
  426|     54|}
Curl_altsvc_save:
  433|     54|{
  434|     54|  CURLcode result = CURLE_OK;
  435|     54|  FILE *out;
  436|     54|  char *tempstore = NULL;
  437|       |
  438|     54|  if(!asi)
  ------------------
  |  Branch (438:6): [True: 54, False: 0]
  ------------------
  439|       |    /* no cache activated */
  440|     54|    return CURLE_OK;
  441|       |
  442|       |  /* if not new name is given, use the one we stored from the load */
  443|      0|  if(!file && asi->filename)
  ------------------
  |  Branch (443:6): [True: 0, False: 0]
  |  Branch (443:15): [True: 0, False: 0]
  ------------------
  444|      0|    file = asi->filename;
  445|       |
  446|      0|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1044|      0|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (446:6): [True: 0, False: 0]
  |  Branch (446:48): [True: 0, False: 0]
  |  Branch (446:57): [True: 0, False: 0]
  ------------------
  447|       |    /* marked as read-only, no file or zero length filename */
  448|      0|    return CURLE_OK;
  449|       |
  450|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  451|      0|  if(!result) {
  ------------------
  |  Branch (451:6): [True: 0, False: 0]
  ------------------
  452|      0|    struct Curl_llist_node *e;
  453|      0|    struct Curl_llist_node *n;
  454|      0|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  455|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  456|      0|          out);
  457|      0|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (457:42): [True: 0, False: 0]
  ------------------
  458|      0|      struct altsvc *as = Curl_node_elem(e);
  459|      0|      n = Curl_node_next(e);
  460|      0|      result = altsvc_out(as, out);
  461|      0|      if(result)
  ------------------
  |  Branch (461:10): [True: 0, False: 0]
  ------------------
  462|      0|        break;
  463|      0|    }
  464|      0|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (464:8): [True: 0, False: 0]
  |  Branch (464:23): [True: 0, False: 0]
  ------------------
  465|      0|      result = CURLE_WRITE_ERROR;
  466|      0|    if(curlx_fclose(out))
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  467|      0|      result = CURLE_WRITE_ERROR;
  468|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:19): [True: 0, False: 0]
  |  Branch (468:32): [True: 0, False: 0]
  ------------------
  469|      0|      result = CURLE_WRITE_ERROR;
  470|       |
  471|      0|    if(result && tempstore)
  ------------------
  |  Branch (471:8): [True: 0, False: 0]
  |  Branch (471:18): [True: 0, False: 0]
  ------------------
  472|      0|      unlink(tempstore);
  473|      0|  }
  474|      0|  curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  475|      0|  return result;
  476|      0|}

Curl_eapi_enter:
  189|     54|{
  190|     54|  struct Curl_easy *data = curl;
  191|     54|  const struct Curl_eapi_fn_props *fn_props;
  192|     54|  CURLcode result = CURLE_OK;
  193|       |
  194|     54|  guard->depth = 0;
  195|       |
  196|       |  /* Verify that we got an easy handle we can work with. */
  197|     54|  if(!GOOD_EASY_HANDLE(data) || data->state.internal) {
  ------------------
  |  |   34|    108|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|     54|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|     54|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 54, False: 0]
  |  |  |  Branch (34:12): [True: 54, False: 0]
  |  |  ------------------
  |  |   35|    108|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (197:6): [True: 0, False: 54]
  |  Branch (197:7): [True: 0, False: 0]
  |  Branch (197:7): [True: 0, False: 0]
  |  Branch (197:33): [True: 0, False: 54]
  ------------------
  198|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  199|      0|    goto out;
  200|      0|  }
  201|       |  /* verify that is either not added to a multi handle OR has a
  202|       |   * GOOD multi handle that knows `data` for `data->mid`. */
  203|     54|  if(data->mid != UINT32_MAX) {
  ------------------
  |  Branch (203:6): [True: 0, False: 54]
  ------------------
  204|      0|    if(GOOD_MULTI_HANDLE(data->multi)) {
  ------------------
  |  |   48|      0|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|      0|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:3): [True: 0, False: 0]
  |  |  |  Branch (48:5): [True: 0, False: 0]
  |  |  |  Branch (48:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (204:8): [True: 0, False: 0]
  |  Branch (204:8): [True: 0, False: 0]
  ------------------
  205|      0|      if(!Curl_multi_knows_easy(data->multi, data)) {
  ------------------
  |  Branch (205:10): [True: 0, False: 0]
  ------------------
  206|       |        /* But multi does not know it, something is fishy, better deny call */
  207|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (207:9): [Folded, False: 0]
  |  Branch (207:9): [Folded, False: 0]
  ------------------
  208|      0|        result = CURLE_BAD_FUNCTION_ARGUMENT;
  209|      0|        goto out;
  210|      0|      }
  211|      0|    }
  212|      0|    else {
  213|      0|      DEBUGASSERT(0); /* data needs to have a GOOD multi handle */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (213:7): [Folded, False: 0]
  |  Branch (213:7): [Folded, False: 0]
  ------------------
  214|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  215|      0|      goto out;
  216|      0|    }
  217|      0|  }
  218|     54|  else if(data->multi) {
  ------------------
  |  Branch (218:11): [True: 0, False: 54]
  ------------------
  219|      0|    DEBUGASSERT(0); /* data should not have a multi handle */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (219:5): [Folded, False: 0]
  |  Branch (219:5): [Folded, False: 0]
  ------------------
  220|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  221|      0|    goto out;
  222|      0|  }
  223|       |  /* verify that the call `fn` we're about to enter is known
  224|       |   * and check call properties to be admitting. */
  225|     54|  if(fn >= CURL_EAPI_FN_LAST) {
  ------------------
  |  Branch (225:6): [True: 0, False: 54]
  ------------------
  226|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  227|      0|    goto out;
  228|      0|  }
  229|     54|  fn_props = &eapi_fn_props[fn];
  230|     54|  DEBUGASSERT(fn_props->fn == fn);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (230:3): [True: 0, False: 54]
  |  Branch (230:3): [True: 54, False: 0]
  ------------------
  231|     54|  if(!fn_props->recurse) {
  ------------------
  |  Branch (231:6): [True: 54, False: 0]
  ------------------
  232|     54|    if(data->callstack.count) {
  ------------------
  |  Branch (232:8): [True: 0, False: 54]
  ------------------
  233|      0|#ifdef CURLVERBOSE
  234|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  235|      0|        "EAPI guard: calling %hu with call to %u ongoing\n", (uint16_t)fn,
  236|      0|        data->callstack.calls[data->callstack.count - 1]));
  237|      0|#endif
  238|      0|      result = CURLE_RECURSIVE_API_CALL;
  239|      0|      goto out;
  240|      0|    }
  241|     54|    if(data->multi && data->multi->callstack.count) {
  ------------------
  |  Branch (241:8): [True: 0, False: 54]
  |  Branch (241:23): [True: 0, False: 0]
  ------------------
  242|      0|#ifdef CURLVERBOSE
  243|       |
  244|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  245|      0|        "EAPI guard: calling %hu with multi call to %u ongoing\n",
  246|      0|        (uint16_t)fn,
  247|      0|        data->multi->callstack.calls[data->multi->callstack.count - 1]));
  248|      0|#endif
  249|      0|      result = CURLE_RECURSIVE_API_CALL;
  250|      0|      goto out;
  251|      0|    }
  252|     54|  }
  253|       |
  254|     54|  if(!fn_props->readonly && eapi_in_readonly_cb(data)) {
  ------------------
  |  Branch (254:6): [True: 54, False: 0]
  |  Branch (254:29): [True: 0, False: 54]
  ------------------
  255|       |    /* Not allowed to be invoked while an event cb is ongoing */
  256|      0|#ifdef CURLVERBOSE
  257|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  258|      0|        "EAPI guard: calling %hu in readonly enforcing callback\n",
  259|      0|        (uint16_t)fn));
  260|      0|#endif
  261|      0|    result = CURLE_RECURSIVE_API_CALL;
  262|      0|    goto out;
  263|      0|  }
  264|       |
  265|     54|#if defined(USE_SSL) && defined(USE_MUTEX)
  266|     54|  if(fn_props->no_scache_lock &&
  ------------------
  |  Branch (266:6): [True: 0, False: 54]
  ------------------
  267|      0|     Curl_ssl_scache_is_locked_by_current_thread(data)) {
  ------------------
  |  Branch (267:6): [True: 0, False: 0]
  ------------------
  268|      0|#ifdef CURLVERBOSE
  269|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  270|      0|        "EAPI guard: calling %hu while vtls_scache is locked by "
  271|      0|        "current thread\n", (uint16_t)fn));
  272|      0|#endif
  273|      0|    result = CURLE_RECURSIVE_API_CALL;
  274|      0|    goto out;
  275|      0|  }
  276|     54|#endif
  277|       |
  278|       |  /* all fine, add to data's callstack */
  279|     54|  if(data->callstack.count >= CURL_EAPI_MAX_RECURSION) {
  ------------------
  |  |  139|     54|#define CURL_EAPI_MAX_RECURSION       7
  ------------------
  |  Branch (279:6): [True: 0, False: 54]
  ------------------
  280|      0|    result = CURLE_RECURSIVE_API_CALL;
  281|      0|    goto out;
  282|      0|  }
  283|     54|  data->callstack.calls[data->callstack.count] = (uint16_t)fn;
  284|     54|  ++data->callstack.count;
  285|     54|  guard->depth = data->callstack.count;
  286|     54|  guard->data = fn_props->data_is_killed ? NULL : data;
  ------------------
  |  Branch (286:17): [True: 54, False: 0]
  ------------------
  287|       |
  288|     54|out:
  289|     54|  if(presult)
  ------------------
  |  Branch (289:6): [True: 0, False: 54]
  ------------------
  290|      0|    *presult = result;
  291|     54|  return guard->depth > 0;
  292|     54|}
Curl_eapi_leave:
  295|     54|{
  296|     54|  if(guard->depth) {
  ------------------
  |  Branch (296:6): [True: 54, False: 0]
  ------------------
  297|       |    /* guard->data is set when handle is supposed to stay alive during call */
  298|     54|    if(guard->data && GOOD_EASY_HANDLE(guard->data)) {
  ------------------
  |  |   34|      0|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|      0|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:3): [True: 0, False: 0]
  |  |  |  Branch (34:5): [True: 0, False: 0]
  |  |  |  Branch (34:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   35|      0|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (298:8): [True: 0, False: 54]
  |  Branch (298:23): [True: 0, False: 0]
  |  Branch (298:23): [True: 0, False: 0]
  ------------------
  299|      0|      if(guard->depth > guard->data->callstack.count) {
  ------------------
  |  Branch (299:10): [True: 0, False: 0]
  ------------------
  300|      0|        DEBUGASSERT(0); /* something very wrong */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (300:9): [Folded, False: 0]
  |  Branch (300:9): [Folded, False: 0]
  ------------------
  301|      0|      }
  302|      0|      else {
  303|      0|        if(guard->depth < guard->data->callstack.count) {
  ------------------
  |  Branch (303:12): [True: 0, False: 0]
  ------------------
  304|      0|          DEBUGASSERT(0); /* someone forgot to clean up */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (304:11): [Folded, False: 0]
  |  Branch (304:11): [Folded, False: 0]
  ------------------
  305|      0|        }
  306|       |        /* reset to depth the guard was entered in */
  307|      0|        guard->data->callstack.count = (uint16_t)(guard->depth - 1);
  308|      0|      }
  309|      0|    }
  310|     54|  }
  311|     54|}
api.c:eapi_in_readonly_cb:
  139|     54|{
  140|     54|  struct Curl_multi *multi = data->multi;
  141|     54|  if(multi && multi->callstack.count) {
  ------------------
  |  Branch (141:6): [True: 0, False: 54]
  |  Branch (141:15): [True: 0, False: 0]
  ------------------
  142|      0|    size_t i;
  143|      0|    for(i = 0; i < multi->callstack.count; ++i) {
  ------------------
  |  Branch (143:16): [True: 0, False: 0]
  ------------------
  144|      0|      if(multi->callstack.calls[i] >= CURL_CBAPI_FN_START) {
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  ------------------
  145|      0|        uint8_t fn = multi->callstack.calls[i];
  146|      0|        if((fn < CURL_CBAPI_FN_LAST) &&
  ------------------
  |  Branch (146:12): [True: 0, False: 0]
  ------------------
  147|      0|           cbapi_fn_props[fn - CURL_CBAPI_FN_START].set_readonly)
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (147:12): [True: 0, False: 0]
  ------------------
  148|      0|          return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  149|      0|      }
  150|      0|    }
  151|      0|  }
  152|     54|  return FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  153|     54|}

Curl_bufref_init:
   38|    108|{
   39|    108|  DEBUGASSERT(br);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (39:3): [True: 0, False: 108]
  |  Branch (39:3): [True: 108, False: 0]
  ------------------
   40|    108|  br->dtor = NULL;
   41|    108|  br->ptr = NULL;
   42|    108|  br->len = 0;
   43|       |
   44|    108|#ifdef DEBUGBUILD
   45|    108|  br->signature = SIGNATURE;
  ------------------
  |  |   31|    108|#define SIGNATURE 0x5c48e9b2    /* Random pattern. */
  ------------------
   46|    108|#endif
   47|    108|}
Curl_bufref_free:
   55|    162|{
   56|    162|  DEBUGASSERT(br);
  ------------------
  |  | 1016|    162|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 162]
  |  Branch (56:3): [True: 162, False: 0]
  ------------------
   57|    162|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1016|    162|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 162]
  |  Branch (57:3): [True: 162, False: 0]
  ------------------
   58|    162|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1016|    162|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 162, False: 0]
  |  Branch (58:3): [True: 0, False: 0]
  |  Branch (58:3): [True: 0, False: 162]
  |  Branch (58:3): [True: 162, False: 0]
  ------------------
   59|       |
   60|    162|  if(br->ptr && br->dtor)
  ------------------
  |  Branch (60:6): [True: 0, False: 162]
  |  Branch (60:17): [True: 0, False: 0]
  ------------------
   61|      0|    br->dtor(CURL_UNCONST(br->ptr));
  ------------------
  |  |  793|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   62|       |
   63|    162|  br->dtor = NULL;
   64|       |  br->ptr = NULL;
   65|    162|  br->len = 0;
   66|    162|}

Curl_cf_ip_happy_insert_after:
 1010|     54|{
 1011|     54|  struct Curl_cfilter *cf;
 1012|     54|  CURLcode result;
 1013|       |
 1014|       |  /* Need to be first */
 1015|     54|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1015:3): [True: 0, False: 54]
  |  Branch (1015:3): [True: 54, False: 0]
  ------------------
 1016|     54|  result = cf_ip_happy_create(&cf, data, origin, peer, transport_peer,
 1017|     54|                              CF_CONN(cf_at), tunnel_peer, tunnel_transport);
  ------------------
  |  |  260|     54|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1018|     54|  if(result)
  ------------------
  |  Branch (1018:6): [True: 0, False: 54]
  ------------------
 1019|      0|    return result;
 1020|       |
 1021|     54|  Curl_conn_cf_insert_after(cf_at, cf);
 1022|     54|  return CURLE_OK;
 1023|     54|}
cf-ip-happy.c:cf_ip_happy_destroy:
  938|     54|{
  939|     54|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  940|       |
  941|     54|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|     54|  do {                                          \
  |  |  154|     54|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     54|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    108|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 54, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 54]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    108|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     54|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     54|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  942|     54|  if(ctx) {
  ------------------
  |  Branch (942:6): [True: 54, False: 0]
  ------------------
  943|     54|    cf_ip_happy_ctx_clear(ctx, data);
  944|     54|    cf_ip_happy_ctx_destroy(ctx, data);
  945|     54|  }
  946|     54|}
cf-ip-happy.c:cf_ip_happy_ctx_clear:
  774|    108|{
  775|    108|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (775:3): [True: 0, False: 108]
  |  Branch (775:3): [True: 108, False: 0]
  ------------------
  776|    108|  if(ctx)
  ------------------
  |  Branch (776:6): [True: 108, False: 0]
  ------------------
  777|    108|    cf_ip_ballers_clear(data, &ctx->ballers);
  778|    108|}
cf-ip-happy.c:cf_ip_ballers_clear:
  301|    108|{
  302|    108|  while(bs->running) {
  ------------------
  |  Branch (302:9): [True: 0, False: 108]
  ------------------
  303|      0|    struct cf_ip_attempt *a = bs->running;
  304|      0|    bs->running = a->next;
  305|      0|    cf_ip_attempt_free(a, data);
  306|      0|  }
  307|    108|  bs->running_tail = &bs->running;
  308|    108|  cf_ip_attempt_free(bs->winner, data);
  309|       |  bs->winner = NULL;
  310|    108|  Curl_peer_unlink(&bs->origin);
  311|    108|  Curl_peer_unlink(&bs->peer);
  312|    108|  Curl_peer_unlink(&bs->tunnel_peer);
  313|    108|}
cf-ip-happy.c:cf_ip_attempt_free:
  176|    108|{
  177|    108|  if(a) {
  ------------------
  |  Branch (177:6): [True: 0, False: 108]
  ------------------
  178|      0|    Curl_cfchain_cleanup(&a->chain, data);
  179|      0|    Curl_peer_unlink(&a->origin);
  180|      0|    Curl_peer_unlink(&a->peer);
  181|      0|    Curl_peer_unlink(&a->tunnel_peer);
  182|      0|    curlx_free(a);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  183|      0|  }
  184|    108|}
cf-ip-happy.c:cf_ip_happy_ctx_destroy:
  782|     54|{
  783|     54|  if(ctx) {
  ------------------
  |  Branch (783:6): [True: 54, False: 0]
  ------------------
  784|     54|    cf_ip_happy_ctx_clear(ctx, data);
  785|     54|    curlx_free(ctx);
  ------------------
  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  786|     54|  }
  787|     54|}
cf-ip-happy.c:cf_ip_happy_shutdown:
  792|    751|{
  793|    751|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  794|    751|  CURLcode result = CURLE_OK;
  795|       |
  796|    751|  DEBUGASSERT(data);
  ------------------
  |  | 1016|    751|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (796:3): [True: 0, False: 751]
  |  Branch (796:3): [True: 751, False: 0]
  ------------------
  797|    751|  if(cf->connected) {
  ------------------
  |  Branch (797:6): [True: 0, False: 751]
  ------------------
  798|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  799|      0|    return CURLE_OK;
  800|      0|  }
  801|       |
  802|    751|  result = cf_ip_ballers_shutdown(&ctx->ballers, data, done);
  803|    751|  CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", (int)result, *done);
  ------------------
  |  |  153|    751|  do {                                          \
  |  |  154|    751|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    751|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.50k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 751, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 751]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.50k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    751|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    751|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    751|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 751]
  |  |  ------------------
  ------------------
  804|    751|  return result;
  805|    751|}
cf-ip-happy.c:cf_ip_ballers_shutdown:
  603|    751|{
  604|    751|  struct cf_ip_attempt *a;
  605|       |
  606|       |  /* shutdown all ballers that have not done so already. If one fails,
  607|       |   * continue shutting down others until all are shutdown. */
  608|    751|  *done = TRUE;
  ------------------
  |  |  986|    751|#define TRUE true
  ------------------
  609|    751|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (609:24): [True: 0, False: 751]
  ------------------
  610|      0|    bool bdone = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  611|      0|    if(a->shutdown || !a->chain.cf)
  ------------------
  |  Branch (611:8): [True: 0, False: 0]
  |  Branch (611:23): [True: 0, False: 0]
  ------------------
  612|      0|      continue;
  613|      0|    a->result = a->chain.cf->cft->do_shutdown(a->chain.cf, data, &bdone);
  614|      0|    if(a->result || bdone)
  ------------------
  |  Branch (614:8): [True: 0, False: 0]
  |  Branch (614:21): [True: 0, False: 0]
  ------------------
  615|      0|      a->shutdown = TRUE; /* treat a failed shutdown as done */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  616|      0|    else
  617|      0|      *done = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  618|      0|  }
  619|    751|  return CURLE_OK;
  620|    751|}
cf-ip-happy.c:cf_ip_happy_data_pending:
  904|    209|{
  905|    209|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  906|       |
  907|    209|  if(!cf->connected) {
  ------------------
  |  Branch (907:6): [True: 209, False: 0]
  ------------------
  908|    209|    return cf_ip_ballers_pending(&ctx->ballers, data);
  909|    209|  }
  910|      0|  return cf->next->cft->has_data_pending(cf->next, data);
  911|    209|}
cf-ip-happy.c:cf_ip_ballers_pending:
  638|    209|{
  639|    209|  struct cf_ip_attempt *a;
  640|       |
  641|    209|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (641:24): [True: 0, False: 209]
  ------------------
  642|      0|    if(a->result)
  ------------------
  |  Branch (642:8): [True: 0, False: 0]
  ------------------
  643|      0|      continue;
  644|      0|    if(a->chain.cf &&
  ------------------
  |  Branch (644:8): [True: 0, False: 0]
  ------------------
  645|      0|       a->chain.cf->cft->has_data_pending(a->chain.cf, data))
  ------------------
  |  Branch (645:8): [True: 0, False: 0]
  ------------------
  646|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  647|      0|  }
  648|    209|  return FALSE;
  ------------------
  |  |  989|    209|#define FALSE false
  ------------------
  649|    209|}
cf-ip-happy.c:cf_ip_happy_query:
  916|    229|{
  917|    229|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  918|       |
  919|    229|  if(!cf->connected) {
  ------------------
  |  Branch (919:6): [True: 229, False: 0]
  ------------------
  920|    229|    switch(query) {
  921|    229|    case CF_QUERY_CONNECT_REPLY_MS: {
  ------------------
  |  |  168|    229|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (921:5): [True: 229, False: 0]
  ------------------
  922|    229|      *pres1 = cf_ip_ballers_min_reply_ms(&ctx->ballers, data);
  923|    229|      CURL_TRC_CF(data, cf, "query connect reply: %dms", *pres1);
  ------------------
  |  |  153|    229|  do {                                          \
  |  |  154|    229|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    229|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    458|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 229, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 229]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    458|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    229|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    229|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    229|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 229]
  |  |  ------------------
  ------------------
  924|    229|      return CURLE_OK;
  925|      0|    }
  926|      0|    default:
  ------------------
  |  Branch (926:5): [True: 0, False: 229]
  ------------------
  927|      0|      break;
  928|    229|    }
  929|    229|  }
  930|       |
  931|      0|  return cf->next ?
  ------------------
  |  Branch (931:10): [True: 0, False: 0]
  ------------------
  932|      0|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  933|      0|    CURLE_UNKNOWN_OPTION;
  934|    229|}
cf-ip-happy.c:cf_ip_ballers_min_reply_ms:
  653|    229|{
  654|    229|  int reply_ms = -1, breply_ms;
  655|    229|  struct cf_ip_attempt *a;
  656|       |
  657|    229|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (657:24): [True: 0, False: 229]
  ------------------
  658|      0|    if(a->chain.cf &&
  ------------------
  |  Branch (658:8): [True: 0, False: 0]
  ------------------
  659|      0|       !a->chain.cf->cft->query(a->chain.cf, data,
  ------------------
  |  Branch (659:8): [True: 0, False: 0]
  ------------------
  660|      0|                                   CF_QUERY_CONNECT_REPLY_MS,
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  661|      0|                                   &breply_ms, NULL) &&
  662|      0|       breply_ms >= 0 && (reply_ms < 0 || breply_ms < reply_ms))
  ------------------
  |  Branch (662:8): [True: 0, False: 0]
  |  Branch (662:27): [True: 0, False: 0]
  |  Branch (662:43): [True: 0, False: 0]
  ------------------
  663|      0|      reply_ms = breply_ms;
  664|      0|  }
  665|    229|  return reply_ms;
  666|    229|}
cf-ip-happy.c:cf_ip_happy_create:
  973|     54|{
  974|     54|  struct cf_ip_happy_ctx *ctx = NULL;
  975|     54|  CURLcode result;
  976|       |
  977|     54|  (void)data;
  978|     54|  (void)conn;
  979|     54|  *pcf = NULL;
  980|     54|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|     54|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  981|     54|  if(!ctx) {
  ------------------
  |  Branch (981:6): [True: 0, False: 54]
  ------------------
  982|      0|    result = CURLE_OUT_OF_MEMORY;
  983|      0|    goto out;
  984|      0|  }
  985|     54|  result = cf_ip_ballers_init(&ctx->ballers, data,
  986|     54|                              origin, peer, transport_peer,
  987|     54|                              tunnel_peer, tunnel_transport,
  988|     54|                              data->set.happy_eyeballs_timeout,
  989|     54|                              IP_HE_MAX_CONCURRENT_ATTEMPTS);
  ------------------
  |  |  740|     54|#define IP_HE_MAX_CONCURRENT_ATTEMPTS     6
  ------------------
  990|     54|  if(result)
  ------------------
  |  Branch (990:6): [True: 0, False: 54]
  ------------------
  991|      0|    goto out;
  992|       |
  993|     54|  result = Curl_cf_create(pcf, &Curl_cft_ip_happy, ctx);
  994|       |
  995|     54|out:
  996|     54|  if(result) {
  ------------------
  |  Branch (996:6): [True: 0, False: 54]
  ------------------
  997|       |    curlx_safefree(*pcf);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  998|      0|    cf_ip_happy_ctx_destroy(ctx, data);
  999|      0|  }
 1000|     54|  return result;
 1001|     54|}
cf-ip-happy.c:cf_ip_ballers_init:
  324|     54|{
  325|     54|  memset(bs, 0, sizeof(*bs));
  326|     54|  bs->running_tail = &bs->running;
  327|     54|  bs->cf_create = get_cf_create(transport_peer, !!tunnel_peer);
  328|     54|  if(!bs->cf_create) {
  ------------------
  |  Branch (328:6): [True: 0, False: 54]
  ------------------
  329|      0|    failf(data, "unsupported transport type %u%s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  330|      0|          transport_peer, tunnel_peer ? " to proxy" : "");
  ------------------
  |  Branch (330:27): [True: 0, False: 0]
  ------------------
  331|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  332|      0|  }
  333|     54|  Curl_peer_link(&bs->origin, origin);
  334|     54|  Curl_peer_link(&bs->peer, peer);
  335|     54|  bs->transport_peer = transport_peer;
  336|     54|  Curl_peer_link(&bs->tunnel_peer, tunnel_peer);
  337|     54|  bs->tunnel_transport = tunnel_transport;
  338|     54|  bs->attempt_delay_ms = attempt_delay_ms;
  339|     54|  bs->max_concurrent = max_concurrent;
  340|       |  bs->last_attempt_ai_family = AF_INET; /* so AF_INET6 is next */
  341|     54|  return CURLE_OK;
  342|     54|}
cf-ip-happy.c:get_cf_create:
   88|     54|{
   89|     54|  size_t i;
   90|     99|  for(i = 0; i < CURL_ARRAYSIZE(transport_providers); ++i) {
  ------------------
  |  | 1326|     99|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (90:14): [True: 99, False: 0]
  ------------------
   91|     99|    if((transport == transport_providers[i].transport) &&
  ------------------
  |  Branch (91:8): [True: 69, False: 30]
  ------------------
   92|     69|       (tunnel == transport_providers[i].tunnel))
  ------------------
  |  Branch (92:8): [True: 54, False: 15]
  ------------------
   93|     54|      return transport_providers[i].cf_create;
   94|     99|  }
   95|      0|  return NULL;
   96|     54|}

Curl_conn_cf_discard_chain:
  177|     54|{
  178|     54|  struct Curl_cfilter *cfn, *cf = *pcf;
  179|       |
  180|     54|  if(cf) {
  ------------------
  |  Branch (180:6): [True: 54, False: 0]
  ------------------
  181|     54|    *pcf = NULL;
  182|    108|    while(cf) {
  ------------------
  |  Branch (182:11): [True: 54, False: 54]
  ------------------
  183|     54|      cfn = cf->next;
  184|       |      /* prevent destroying filter to mess with its sub-chain, since
  185|       |       * we have the reference now and will call destroy on it.
  186|       |       */
  187|     54|      cf->next = NULL;
  188|     54|      cf->cft->destroy(cf, data);
  189|     54|      curlx_free(cf);
  ------------------
  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  190|     54|      cf = cfn;
  191|     54|    }
  192|     54|  }
  193|     54|}
Curl_cf_create:
  297|     54|{
  298|     54|  struct Curl_cfilter *cf;
  299|     54|  CURLcode result = CURLE_OUT_OF_MEMORY;
  300|       |
  301|     54|  DEBUGASSERT(cft);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (301:3): [True: 0, False: 54]
  |  Branch (301:3): [True: 54, False: 0]
  ------------------
  302|     54|  cf = curlx_calloc(1, sizeof(*cf));
  ------------------
  |  | 1500|     54|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  303|     54|  if(!cf)
  ------------------
  |  Branch (303:6): [True: 0, False: 54]
  ------------------
  304|      0|    goto out;
  305|       |
  306|     54|  cf->cft = cft;
  307|     54|  cf->ctx = ctx;
  308|     54|  result = CURLE_OK;
  309|     54|out:
  310|     54|  *pcf = cf;
  311|     54|  return result;
  312|     54|}
Curl_cfchain_init:
  317|     54|{
  318|     54|  chain->cf = NULL;
  319|     54|  chain->parent = NULL;
  320|     54|  chain->conn = conn;
  321|     54|  chain->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|     54|#define CURL_SOCKET_BAD (-1)
  ------------------
  322|     54|  chain->shutdown_start_ms = -1;
  323|     54|  chain->primary = primary;
  324|       |  chain->ipv6 = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  325|     54|}
Curl_conn_cf_insert_after:
  390|     54|{
  391|     54|  struct Curl_cfilter *tail, **pnext;
  392|       |
  393|     54|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (393:3): [True: 0, False: 54]
  |  Branch (393:3): [True: 54, False: 0]
  ------------------
  394|     54|  DEBUGASSERT(cf_new);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 54]
  |  Branch (394:3): [True: 54, False: 0]
  ------------------
  395|     54|  DEBUGASSERT(!cf_new->chain);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (395:3): [True: 0, False: 54]
  |  Branch (395:3): [True: 54, False: 0]
  ------------------
  396|       |
  397|     54|  tail = cf_at->next;
  398|     54|  cf_at->next = cf_new;
  399|     54|  do {
  400|     54|    cf_new->chain = cf_at->chain;
  401|     54|    pnext = &cf_new->next;
  402|     54|    cf_new = cf_new->next;
  403|     54|  } while(cf_new);
  ------------------
  |  Branch (403:11): [True: 0, False: 54]
  ------------------
  404|     54|  *pnext = tail;
  405|     54|}

Curl_flush_cookies:
 1826|     54|{
 1827|     54|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1828|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1829|       |     set), as otherwise the cookies were not completely initialized and there
 1830|       |     might be cookie files that were not loaded so saving the file is the
 1831|       |     wrong thing. */
 1832|     54|  if(data->cookies) {
  ------------------
  |  Branch (1832:6): [True: 0, False: 54]
  ------------------
 1833|      0|    const char *cookiejar = CURL_EASY_STR(data, STRING_COOKIEJAR);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1834|      0|    if(cookiejar && data->cookies->running) {
  ------------------
  |  Branch (1834:8): [True: 0, False: 0]
  |  Branch (1834:21): [True: 0, False: 0]
  ------------------
 1835|       |      /* if we have a destination file for all the cookies to get dumped to */
 1836|      0|      CURLcode result = cookie_output(data, data->cookies, cookiejar);
 1837|      0|      if(result)
  ------------------
  |  Branch (1837:10): [True: 0, False: 0]
  ------------------
 1838|      0|        infof(data, "WARNING: failed to save cookies in %s: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1839|      0|              cookiejar, curl_easy_strerror(result));
 1840|      0|    }
 1841|       |
 1842|      0|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1842:8): [True: 0, False: 0]
  |  Branch (1842:20): [True: 0, False: 0]
  |  Branch (1842:36): [True: 0, False: 0]
  ------------------
 1843|      0|      Curl_cookie_cleanup(data->cookies);
 1844|       |      data->cookies = NULL;
 1845|      0|    }
 1846|      0|  }
 1847|     54|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1848|     54|}

Curl_creds_unlink:
  144|    162|{
  145|    162|  if(*pcreds) {
  ------------------
  |  Branch (145:6): [True: 0, False: 162]
  ------------------
  146|      0|    struct Curl_creds *creds = *pcreds;
  147|      0|    uint32_t newcount;
  148|       |
  149|      0|    *pcreds = NULL;
  150|       |
  151|      0|    newcount = Curl_refcount_decr(&creds->refcount);
  ------------------
  |  |   58|      0|  (atomic_fetch_sub_explicit(c, 1U, memory_order_acq_rel) - 1U)
  ------------------
  152|      0|    DEBUGASSERT(newcount < UINT32_MAX); /* wraparound check */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (152:5): [True: 0, False: 0]
  |  Branch (152:5): [True: 0, False: 0]
  ------------------
  153|       |
  154|      0|    if(!newcount) {
  ------------------
  |  Branch (154:8): [True: 0, False: 0]
  ------------------
  155|      0|      curlx_memzero(creds, sizeof(*creds) + creds->bufsize);
  156|      0|      curlx_free(creds);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  157|      0|    }
  158|      0|  }
  159|    162|}

Curl_looks_like_ipv6:
  464|     87|{
  465|     87|  const char *zonep = NULL;
  466|     87|  size_t i = 0, hlen = 0, zlen = 0;
  467|       |
  468|     87|  if(host)
  ------------------
  |  Branch (468:6): [True: 87, False: 0]
  ------------------
  469|     87|    memset(host, 0, sizeof(*host));
  470|     87|  if(zone)
  ------------------
  |  Branch (470:6): [True: 87, False: 0]
  ------------------
  471|     87|    memset(zone, 0, sizeof(*zone));
  472|       |
  473|     87|  for(i = 0; i < len; ++i, ++hlen) {
  ------------------
  |  Branch (473:14): [True: 87, False: 0]
  ------------------
  474|     87|    if(!s[i] || !(ISXDIGIT(s[i]) || (s[i] == ':') || (s[i] == '.')))
  ------------------
  |  |   37|    174|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|    174|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 87, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 87]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|    174|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 87, False: 0]
  |  |  |  |  |  Branch (27:43): [True: 0, False: 87]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|     87|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 87, False: 0]
  |  |  |  |  |  Branch (28:43): [True: 0, False: 87]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:8): [True: 0, False: 87]
  |  Branch (474:37): [True: 0, False: 87]
  |  Branch (474:54): [True: 0, False: 87]
  ------------------
  475|     87|      break;
  476|     87|  }
  477|       |
  478|     87|  if((i < len) && (s[i] == '%')) { /* address followed by a zone? */
  ------------------
  |  Branch (478:6): [True: 87, False: 0]
  |  Branch (478:19): [True: 0, False: 87]
  ------------------
  479|      0|    i += 1;
  480|      0|    if(maybe_url_encoded && !strncmp("25", s + i, 2))
  ------------------
  |  Branch (480:8): [True: 0, False: 0]
  |  Branch (480:29): [True: 0, False: 0]
  ------------------
  481|      0|      i += 2;
  482|      0|    zonep = s + i;
  483|      0|    for(; i < len; ++i, ++zlen) {
  ------------------
  |  Branch (483:11): [True: 0, False: 0]
  ------------------
  484|       |      /* Allow unreserved characters as defined in RFC 3986 */
  485|      0|      if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   36|      0|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|      0|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   40|      0|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (40:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   37|      0|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|      0|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (27:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|      0|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (28:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (485:10): [True: 0, False: 0]
  |  Branch (485:56): [True: 0, False: 0]
  ------------------
  486|      0|                    (s[i] == '.') || (s[i] == '_') || (s[i] == '~')))
  ------------------
  |  Branch (486:21): [True: 0, False: 0]
  |  Branch (486:38): [True: 0, False: 0]
  |  Branch (486:55): [True: 0, False: 0]
  ------------------
  487|      0|        break;
  488|      0|    }
  489|      0|  }
  490|       |
  491|     87|  if(i != len)
  ------------------
  |  Branch (491:6): [True: 87, False: 0]
  ------------------
  492|     87|    return FALSE; /* invalid chars in zone */
  ------------------
  |  |  989|     87|#define FALSE false
  ------------------
  493|      0|  if(host && hlen) {
  ------------------
  |  Branch (493:6): [True: 0, False: 0]
  |  Branch (493:14): [True: 0, False: 0]
  ------------------
  494|      0|    host->str = s;
  495|      0|    host->len = hlen;
  496|      0|  }
  497|      0|  if(zone && zlen) {
  ------------------
  |  Branch (497:6): [True: 0, False: 0]
  |  Branch (497:14): [True: 0, False: 0]
  ------------------
  498|      0|    zone->str = zonep;
  499|      0|    zone->len = zlen;
  500|      0|  }
  501|       |  return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  502|     87|}

Curl_share_lock_share:
  345|     54|{
  346|     54|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|     54|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 54]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  347|     54|    return CURLSHE_INVALID;
  348|       |
  349|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (349:6): [True: 0, False: 0]
  ------------------
  350|      0|     share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (350:6): [True: 0, False: 0]
  ------------------
  351|      0|    share->lockfunc(data, type, accesstype, share->clientdata);
  352|       |  /* else if we do not share this, pretend successful lock */
  353|       |
  354|      0|  return CURLSHE_OK;
  355|     54|}
Curl_share_lock:
  359|     54|{
  360|     54|  return Curl_share_lock_share(data->share, data, type, accesstype);
  361|     54|}
Curl_share_unlock_share:
  366|     54|{
  367|     54|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|     54|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 54]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  368|     54|    return CURLSHE_INVALID;
  369|       |
  370|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (370:6): [True: 0, False: 0]
  ------------------
  371|      0|     share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (371:6): [True: 0, False: 0]
  ------------------
  372|      0|    share->unlockfunc(data, type, share->clientdata);
  373|       |
  374|      0|  return CURLSHE_OK;
  375|     54|}
Curl_share_unlock:
  378|     54|{
  379|     54|  return Curl_share_unlock_share(data->share, data, type);
  380|     54|}
Curl_share_easy_unlink:
  383|     54|{
  384|     54|  struct Curl_share *share = data->share;
  385|       |
  386|     54|  if(share) {
  ------------------
  |  Branch (386:6): [True: 0, False: 54]
  ------------------
  387|      0|    bool locked;
  388|       |
  389|      0|    if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|      0|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 0]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  390|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  391|       |
  392|      0|    locked = share_lock_acquire(share, data);
  393|       |    /* If share caches connections, detach any existing connection and
  394|       |     * forget its identifier. */
  395|      0|    if((share->specifier & (1 << CURL_LOCK_DATA_CONNECT))) {
  ------------------
  |  Branch (395:8): [True: 0, False: 0]
  ------------------
  396|      0|      if(data->conn)
  ------------------
  |  Branch (396:10): [True: 0, False: 0]
  ------------------
  397|      0|        Curl_detach_connection(data);
  398|      0|      data->state.last_conn_id = -1;
  399|      0|      data->state.last_cpid = UINT32_MAX;
  400|      0|    }
  401|       |
  402|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  403|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (403:8): [True: 0, False: 0]
  ------------------
  404|      0|      data->cookies = NULL;
  405|      0|#endif
  406|       |
  407|      0|#ifndef CURL_DISABLE_HSTS
  408|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (408:8): [True: 0, False: 0]
  ------------------
  409|      0|      data->hsts = NULL;
  410|      0|#endif
  411|       |#ifdef USE_LIBPSL
  412|       |    if(&share->psl == data->psl)
  413|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  414|       |#endif
  415|       |
  416|      0|    share_lock_release(data->share, data, locked);
  417|      0|    share_unlink(&data->share);
  418|      0|  }
  419|     54|  return CURLE_OK;
  420|     54|}

Curl_trc_opt:
  676|      1|{
  677|      1|  CURLcode result = config ? trc_opt(config) : CURLE_OK;
  ------------------
  |  Branch (677:21): [True: 0, False: 1]
  ------------------
  678|      1|#ifdef DEBUGBUILD
  679|       |  /* CURL_DEBUG can override anything */
  680|      1|  if(!result) {
  ------------------
  |  Branch (680:6): [True: 1, False: 0]
  ------------------
  681|      1|    const char *dbg_config = getenv("CURL_DEBUG");
  682|      1|    if(dbg_config)
  ------------------
  |  Branch (682:8): [True: 0, False: 1]
  ------------------
  683|      0|      result = trc_opt(dbg_config);
  684|      1|  }
  685|      1|#endif /* DEBUGBUILD */
  686|      1|  return result;
  687|      1|}
Curl_trc_init:
  690|      1|{
  691|      1|#ifdef DEBUGBUILD
  692|      1|  return Curl_trc_opt(NULL);
  693|       |#else
  694|       |  return CURLE_OK;
  695|       |#endif
  696|      1|}

curlx_dyn_init:
   39|    108|{
   40|    108|  DEBUGASSERT(s);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 108]
  |  Branch (40:3): [True: 108, False: 0]
  ------------------
   41|    108|  DEBUGASSERT(toobig);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 108]
  |  Branch (41:3): [True: 108, False: 0]
  ------------------
   42|    108|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 108]
  |  Branch (42:3): [True: 108, False: 0]
  ------------------
   43|    108|  s->bufr = NULL;
   44|    108|  s->leng = 0;
   45|    108|  s->allc = 0;
   46|    108|  s->toobig = toobig;
   47|    108|#ifdef DEBUGBUILD
   48|    108|  s->init = DYNINIT;
  ------------------
  |  |   32|    108|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|    108|#endif
   50|    108|}
curlx_dyn_free:
   57|    108|{
   58|    108|  DEBUGASSERT(s);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 108]
  |  Branch (58:3): [True: 108, False: 0]
  ------------------
   59|    108|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 108]
  |  Branch (59:3): [True: 108, False: 0]
  ------------------
   60|    108|  curlx_safefree(s->bufr);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
   61|    108|  s->leng = s->allc = 0;
   62|    108|}

curlx_inet_pton:
  204|  5.70k|{
  205|  5.70k|  switch(af) {
  206|  2.89k|  case AF_INET:
  ------------------
  |  Branch (206:3): [True: 2.89k, False: 2.80k]
  ------------------
  207|  2.89k|    return inet_pton4(src, (unsigned char *)dst);
  208|  2.80k|  case AF_INET6:
  ------------------
  |  Branch (208:3): [True: 2.80k, False: 2.89k]
  ------------------
  209|  2.80k|    return inet_pton6(src, (unsigned char *)dst);
  210|      0|  default:
  ------------------
  |  Branch (210:3): [True: 0, False: 5.70k]
  ------------------
  211|      0|    return -1;
  212|  5.70k|  }
  213|       |  /* NOTREACHED */
  214|  5.70k|}
inet_pton.c:inet_pton4:
   63|  3.85k|{
   64|  3.85k|  int saw_digit, octets, ch;
   65|  3.85k|  unsigned char tmp[INADDRSZ], *tp;
   66|       |
   67|  3.85k|  saw_digit = 0;
   68|  3.85k|  octets = 0;
   69|  3.85k|  tp = tmp;
   70|  3.85k|  *tp = 0;
   71|  10.6k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (71:9): [True: 9.96k, False: 677]
  ------------------
   72|  9.96k|    if(ISDIGIT(ch)) {
  ------------------
  |  |   42|  9.96k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 7.44k, False: 2.51k]
  |  |  |  Branch (42:38): [True: 5.46k, False: 1.97k]
  |  |  ------------------
  ------------------
   73|  5.46k|      unsigned int val = (*tp * 10) + (ch - '0');
   74|       |
   75|  5.46k|      if(saw_digit && *tp == 0)
  ------------------
  |  Branch (75:10): [True: 2.35k, False: 3.11k]
  |  Branch (75:23): [True: 198, False: 2.16k]
  ------------------
   76|    198|        return 0;
   77|  5.27k|      if(val > 255)
  ------------------
  |  Branch (77:10): [True: 315, False: 4.95k]
  ------------------
   78|    315|        return 0;
   79|  4.95k|      *tp = (unsigned char)val;
   80|  4.95k|      if(!saw_digit) {
  ------------------
  |  Branch (80:10): [True: 3.11k, False: 1.84k]
  ------------------
   81|  3.11k|        if(++octets > 4)
  ------------------
  |  Branch (81:12): [True: 0, False: 3.11k]
  ------------------
   82|      0|          return 0;
   83|  3.11k|        saw_digit = 1;
   84|  3.11k|      }
   85|  4.95k|    }
   86|  4.49k|    else if(ch == '.' && saw_digit) {
  ------------------
  |  Branch (86:13): [True: 2.39k, False: 2.09k]
  |  Branch (86:26): [True: 1.97k, False: 414]
  ------------------
   87|  1.97k|      if(octets == 4)
  ------------------
  |  Branch (87:10): [True: 150, False: 1.82k]
  ------------------
   88|    150|        return 0;
   89|  1.82k|      *++tp = 0;
   90|  1.82k|      saw_digit = 0;
   91|  1.82k|    }
   92|  2.51k|    else
   93|  2.51k|      return 0;
   94|  9.96k|  }
   95|    677|  if(octets < 4)
  ------------------
  |  Branch (95:6): [True: 516, False: 161]
  ------------------
   96|    516|    return 0;
   97|    161|  memcpy(dst, tmp, INADDRSZ);
  ------------------
  |  |   36|    161|#define INADDRSZ         4
  ------------------
   98|    161|  return 1;
   99|    677|}
inet_pton.c:inet_pton6:
  114|  2.80k|{
  115|  2.80k|  unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
  116|  2.80k|  const char *curtok;
  117|  2.80k|  int ch, saw_xdigit;
  118|  2.80k|  size_t val;
  119|       |
  120|  2.80k|  memset((tp = tmp), 0, IN6ADDRSZ);
  ------------------
  |  |   35|  2.80k|#define IN6ADDRSZ       16
  ------------------
  121|  2.80k|  endp = tp + IN6ADDRSZ;
  ------------------
  |  |   35|  2.80k|#define IN6ADDRSZ       16
  ------------------
  122|  2.80k|  colonp = NULL;
  123|       |  /* Leading :: requires some special handling. */
  124|  2.80k|  if(*src == ':' && *++src != ':')
  ------------------
  |  Branch (124:6): [True: 536, False: 2.27k]
  |  Branch (124:21): [True: 159, False: 377]
  ------------------
  125|    159|    return 0;
  126|  2.64k|  curtok = src;
  127|  2.64k|  saw_xdigit = 0;
  128|  2.64k|  val = 0;
  129|  13.4k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (129:9): [True: 12.7k, False: 676]
  ------------------
  130|  12.7k|    if(ISXDIGIT(ch)) {
  ------------------
  |  |   37|  12.7k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  25.5k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 11.6k, False: 1.15k]
  |  |  |  |  |  Branch (42:38): [True: 2.55k, False: 9.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  22.9k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 1.97k, False: 8.23k]
  |  |  |  |  |  Branch (27:43): [True: 1.58k, False: 388]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  8.62k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 3.72k, False: 4.90k]
  |  |  |  |  |  Branch (28:43): [True: 3.25k, False: 461]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  7.39k|      val <<= 4;
  132|  7.39k|      val |= curlx_hexval(ch);
  ------------------
  |  |  113|  7.39k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  133|  7.39k|      if(++saw_xdigit > 4)
  ------------------
  |  Branch (133:10): [True: 133, False: 7.26k]
  ------------------
  134|    133|        return 0;
  135|  7.26k|      continue;
  136|  7.39k|    }
  137|  5.36k|    if(ch == ':') {
  ------------------
  |  Branch (137:8): [True: 3.73k, False: 1.62k]
  ------------------
  138|  3.73k|      curtok = src;
  139|  3.73k|      if(!saw_xdigit) {
  ------------------
  |  Branch (139:10): [True: 599, False: 3.13k]
  ------------------
  140|    599|        if(colonp)
  ------------------
  |  Branch (140:12): [True: 77, False: 522]
  ------------------
  141|     77|          return 0;
  142|    522|        colonp = tp;
  143|    522|        continue;
  144|    599|      }
  145|  3.13k|      if(!*src)
  ------------------
  |  Branch (145:10): [True: 67, False: 3.06k]
  ------------------
  146|     67|        return 0;
  147|  3.06k|      if(tp + INT16SZ > endp)
  ------------------
  |  |   37|  3.06k|#define INT16SZ          2
  ------------------
  |  Branch (147:10): [True: 68, False: 3.00k]
  ------------------
  148|     68|        return 0;
  149|  3.00k|      *tp++ = (unsigned char)((val >> 8) & 0xff);
  150|  3.00k|      *tp++ = (unsigned char)(val & 0xff);
  151|  3.00k|      saw_xdigit = 0;
  152|  3.00k|      val = 0;
  153|  3.00k|      continue;
  154|  3.06k|    }
  155|  1.62k|    if(ch == '.' && ((tp + INADDRSZ) <= endp) &&
  ------------------
  |  |   36|  1.03k|#define INADDRSZ         4
  ------------------
  |  Branch (155:8): [True: 1.03k, False: 589]
  |  Branch (155:21): [True: 957, False: 81]
  ------------------
  156|    957|       inet_pton4(curtok, tp) > 0) {
  ------------------
  |  Branch (156:8): [True: 73, False: 884]
  ------------------
  157|     73|      tp += INADDRSZ;
  ------------------
  |  |   36|     73|#define INADDRSZ         4
  ------------------
  158|     73|      saw_xdigit = 0;
  159|     73|      break;    /* '\0' was seen by inet_pton4(). */
  160|     73|    }
  161|  1.55k|    return 0;
  162|  1.62k|  }
  163|    749|  if(saw_xdigit) {
  ------------------
  |  Branch (163:6): [True: 610, False: 139]
  ------------------
  164|    610|    if(tp + INT16SZ > endp)
  ------------------
  |  |   37|    610|#define INT16SZ          2
  ------------------
  |  Branch (164:8): [True: 73, False: 537]
  ------------------
  165|     73|      return 0;
  166|    537|    *tp++ = (unsigned char)((val >> 8) & 0xff);
  167|    537|    *tp++ = (unsigned char)(val & 0xff);
  168|    537|  }
  169|    676|  if(colonp) {
  ------------------
  |  Branch (169:6): [True: 297, False: 379]
  ------------------
  170|       |    /*
  171|       |     * Since some memmove()'s erroneously fail to handle
  172|       |     * overlapping regions, we do the shift by hand.
  173|       |     */
  174|    297|    const ssize_t n = tp - colonp;
  175|    297|    ssize_t i;
  176|       |
  177|    297|    if(tp == endp)
  ------------------
  |  Branch (177:8): [True: 68, False: 229]
  ------------------
  178|     68|      return 0;
  179|    819|    for(i = 1; i <= n; i++) {
  ------------------
  |  Branch (179:16): [True: 590, False: 229]
  ------------------
  180|    590|      *(endp - i) = *(colonp + n - i);
  181|    590|      *(colonp + n - i) = 0;
  182|    590|    }
  183|    229|    tp = endp;
  184|    229|  }
  185|    608|  if(tp != endp)
  ------------------
  |  Branch (185:6): [True: 374, False: 234]
  ------------------
  186|    374|    return 0;
  187|    234|  memcpy(dst, tmp, IN6ADDRSZ);
  ------------------
  |  |   35|    234|#define IN6ADDRSZ       16
  ------------------
  188|    234|  return 1;
  189|    608|}

curlx_memzero:
  113|     54|{
  114|     54|  if(buf)
  ------------------
  |  Branch (114:6): [True: 54, False: 0]
  ------------------
  115|     54|    curlx_memzero_low(buf, size);
  ------------------
  |  | 1667|     54|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  116|     54|}

curlx_uztosi:
   69|      1|{
   70|      1|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT);
  ------------------
  |  | 1016|      1|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (70:3): [True: 0, False: 1]
  |  Branch (70:3): [True: 1, False: 0]
  ------------------
   71|      1|  return (int)(uznum & (size_t)CURL_MASK_SINT);
  ------------------
  |  |   44|      1|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|      1|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
   72|      1|}

Curl_dynhds_init:
   63|    701|{
   64|    701|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|    701|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (64:3): [True: 0, False: 701]
  |  Branch (64:3): [True: 701, False: 0]
  ------------------
   65|    701|  dynhds->hds = NULL;
   66|    701|  dynhds->hds_len = dynhds->hds_allc = dynhds->strs_len = 0;
   67|    701|  dynhds->max_entries = max_entries ? max_entries : UINT32_MAX;
  ------------------
  |  Branch (67:25): [True: 701, False: 0]
  ------------------
   68|    701|  dynhds->max_strs_size = max_strs_size ? max_strs_size : UINT32_MAX;
  ------------------
  |  Branch (68:27): [True: 701, False: 0]
  ------------------
   69|    701|  dynhds->opts = 0;
   70|    701|}
Curl_dynhds_reset:
   73|  1.23k|{
   74|  1.23k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|  1.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (74:3): [True: 0, False: 1.23k]
  |  Branch (74:3): [True: 1.23k, False: 0]
  ------------------
   75|  1.23k|  if(dynhds->hds_len) {
  ------------------
  |  Branch (75:6): [True: 681, False: 555]
  ------------------
   76|    681|    size_t i;
   77|    681|    DEBUGASSERT(dynhds->hds);
  ------------------
  |  | 1016|    681|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:5): [True: 0, False: 681]
  |  Branch (77:5): [True: 681, False: 0]
  ------------------
   78|  2.90k|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (78:16): [True: 2.22k, False: 681]
  ------------------
   79|  2.22k|      entry_free(dynhds->hds[i]);
   80|  2.22k|      dynhds->hds[i] = NULL;
   81|  2.22k|    }
   82|    681|  }
   83|  1.23k|  dynhds->hds_len = dynhds->strs_len = 0;
   84|  1.23k|}
Curl_dynhds_cleanup:
   87|    701|{
   88|    701|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|    701|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (88:3): [True: 0, False: 701]
  |  Branch (88:3): [True: 701, False: 0]
  ------------------
   89|    701|  Curl_dynhds_reset(dynhds);
   90|       |  curlx_safefree(dynhds->hds);
  ------------------
  |  | 1359|    701|  do {                      \
  |  | 1360|    701|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    701|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    701|    (ptr) = NULL;           \
  |  | 1362|    701|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 701]
  |  |  ------------------
  ------------------
   91|    701|  dynhds->hds_allc = 0;
   92|    701|}
Curl_dynhds_count:
   95|  17.1k|{
   96|  17.1k|  return dynhds->hds_len;
   97|  17.1k|}
Curl_dynhds_set_opts:
  100|    297|{
  101|    297|  dynhds->opts = opts;
  102|    297|}
Curl_dynhds_get:
  112|  2.10k|{
  113|  2.10k|  size_t i;
  114|  4.45k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (114:14): [True: 2.85k, False: 1.60k]
  ------------------
  115|  2.85k|    if(dynhds->hds[i]->namelen == namelen &&
  ------------------
  |  Branch (115:8): [True: 1.13k, False: 1.71k]
  ------------------
  116|  1.13k|       curl_strnequal(dynhds->hds[i]->name, name, namelen)) {
  ------------------
  |  Branch (116:8): [True: 501, False: 635]
  ------------------
  117|    501|      return dynhds->hds[i];
  118|    501|    }
  119|  2.85k|  }
  120|  1.60k|  return NULL;
  121|  2.10k|}
Curl_dynhds_add:
  131|  5.56k|{
  132|  5.56k|  struct dynhds_entry *entry = NULL;
  133|  5.56k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  134|  5.56k|  uint32_t nlen, vlen;
  135|       |
  136|       |  /* Accept NULL value with length 0, name must have length */
  137|  5.56k|  if(!dynhds || !name || !namelen || (!value && valuelen)) {
  ------------------
  |  Branch (137:6): [True: 0, False: 5.56k]
  |  Branch (137:17): [True: 0, False: 5.56k]
  |  Branch (137:26): [True: 0, False: 5.56k]
  |  Branch (137:39): [True: 0, False: 5.56k]
  |  Branch (137:49): [True: 0, False: 0]
  ------------------
  138|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:5): [Folded, False: 0]
  |  Branch (138:5): [Folded, False: 0]
  ------------------
  139|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  140|      0|  }
  141|  5.56k|  if((namelen > UINT32_MAX) || (valuelen > UINT32_MAX))
  ------------------
  |  Branch (141:6): [True: 0, False: 5.56k]
  |  Branch (141:32): [True: 0, False: 5.56k]
  ------------------
  142|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  143|  5.56k|  nlen = (uint32_t)namelen;
  144|  5.56k|  vlen = (uint32_t)valuelen;
  145|       |
  146|       |  /* Does the new header fit into the limits? */
  147|  5.56k|  if((dynhds->hds_len >= dynhds->max_entries) ||
  ------------------
  |  Branch (147:6): [True: 1.29k, False: 4.27k]
  ------------------
  148|  4.27k|     (dynhds->max_strs_size - dynhds->strs_len < nlen) ||
  ------------------
  |  Branch (148:6): [True: 554, False: 3.71k]
  ------------------
  149|  3.71k|     (dynhds->max_strs_size - dynhds->strs_len - nlen < vlen))
  ------------------
  |  Branch (149:6): [True: 423, False: 3.29k]
  ------------------
  150|  2.27k|    return CURLE_OUT_OF_MEMORY;
  151|       |
  152|  3.29k|  entry = entry_new(name, nlen, value, vlen, dynhds->opts);
  153|  3.29k|  if(!entry)
  ------------------
  |  Branch (153:6): [True: 0, False: 3.29k]
  ------------------
  154|      0|    goto out;
  155|       |
  156|  3.29k|  if((dynhds->hds_allc - dynhds->hds_len) < 1) {
  ------------------
  |  Branch (156:6): [True: 478, False: 2.81k]
  ------------------
  157|    478|    struct dynhds_entry **nhds;
  158|    478|    uint32_t nhds_allc;
  159|       |
  160|       |    /* start with room for 16 headers, then double, add max 512 new ones
  161|       |     * or what the limit still allows. */
  162|    478|    if(dynhds->hds_allc) {
  ------------------
  |  Branch (162:8): [True: 26, False: 452]
  ------------------
  163|     26|      uint32_t max_grow =
  164|     26|        CURLMIN(dynhds->max_entries - dynhds->hds_allc, 512);
  ------------------
  |  | 1315|     26|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 26, False: 0]
  |  |  ------------------
  ------------------
  165|     26|      nhds_allc = dynhds->hds_allc + CURLMIN(dynhds->hds_allc, max_grow);
  ------------------
  |  | 1315|     26|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 26]
  |  |  ------------------
  ------------------
  166|     26|    }
  167|    452|    else
  168|    452|      nhds_allc = 16;
  169|       |
  170|    478|    nhds = curlx_calloc(nhds_allc, sizeof(struct dynhds_entry *));
  ------------------
  |  | 1500|    478|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  171|    478|    if(!nhds)
  ------------------
  |  Branch (171:8): [True: 0, False: 478]
  ------------------
  172|      0|      goto out;
  173|    478|    if(dynhds->hds) {
  ------------------
  |  Branch (173:8): [True: 26, False: 452]
  ------------------
  174|     26|      memcpy(nhds, dynhds->hds,
  175|     26|             dynhds->hds_len * sizeof(struct dynhds_entry *));
  176|     26|      curlx_safefree(dynhds->hds);
  ------------------
  |  | 1359|     26|  do {                      \
  |  | 1360|     26|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     26|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     26|    (ptr) = NULL;           \
  |  | 1362|     26|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 26]
  |  |  ------------------
  ------------------
  177|     26|    }
  178|    478|    dynhds->hds = nhds;
  179|    478|    dynhds->hds_allc = nhds_allc;
  180|    478|  }
  181|  3.29k|  dynhds->hds[dynhds->hds_len++] = entry;
  182|  3.29k|  entry = NULL;
  183|  3.29k|  dynhds->strs_len += nlen + vlen;
  184|  3.29k|  result = CURLE_OK;
  185|       |
  186|  3.29k|out:
  187|  3.29k|  if(entry)
  ------------------
  |  Branch (187:6): [True: 0, False: 3.29k]
  ------------------
  188|      0|    entry_free(entry);
  189|  3.29k|  return result;
  190|  3.29k|}
Curl_dynhds_cadd:
  194|  2.26k|{
  195|  2.26k|  if(!name)
  ------------------
  |  Branch (195:6): [True: 0, False: 2.26k]
  ------------------
  196|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  197|  2.26k|  return Curl_dynhds_add(dynhds, name, strlen(name),
  198|  2.26k|                         value, value ? strlen(value) : 0);
  ------------------
  |  Branch (198:33): [True: 2.26k, False: 0]
  ------------------
  199|  2.26k|}
dynhds_contains:
  250|  2.10k|{
  251|  2.10k|  return !!Curl_dynhds_get(dynhds, name, namelen);
  252|  2.10k|}
dynhds_ccontains:
  257|  1.07k|{
  258|  1.07k|  return dynhds_contains(dynhds, name, strlen(name));
  259|  1.07k|}
dynhds_count_name:
  271|  2.01k|{
  272|  2.01k|  size_t n = 0;
  273|  2.01k|  if(dynhds->hds_len) {
  ------------------
  |  Branch (273:6): [True: 878, False: 1.13k]
  ------------------
  274|    878|    size_t i;
  275|  4.26k|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (275:16): [True: 3.39k, False: 878]
  ------------------
  276|  3.39k|      if((namelen == dynhds->hds[i]->namelen) &&
  ------------------
  |  Branch (276:10): [True: 1.04k, False: 2.34k]
  ------------------
  277|  1.04k|         curl_strnequal(name, dynhds->hds[i]->name, namelen))
  ------------------
  |  Branch (277:10): [True: 425, False: 618]
  ------------------
  278|    425|        ++n;
  279|  3.39k|    }
  280|    878|  }
  281|  2.01k|  return n;
  282|  2.01k|}
dynhds_ccount_name:
  294|    981|{
  295|    981|  return dynhds_count_name(dynhds, name, strlen(name));
  296|    981|}
dynhds_remove:
  308|  2.50k|{
  309|  2.50k|  size_t n = 0;
  310|  2.50k|  if(dynhds->hds_len) {
  ------------------
  |  Branch (310:6): [True: 1.33k, False: 1.17k]
  ------------------
  311|  1.33k|    size_t i, len;
  312|  5.19k|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (312:16): [True: 3.86k, False: 1.33k]
  ------------------
  313|  3.86k|      if((namelen == dynhds->hds[i]->namelen) &&
  ------------------
  |  Branch (313:10): [True: 2.78k, False: 1.07k]
  ------------------
  314|  2.78k|         curl_strnequal(name, dynhds->hds[i]->name, namelen)) {
  ------------------
  |  Branch (314:10): [True: 1.06k, False: 1.72k]
  ------------------
  315|  1.06k|        ++n;
  316|  1.06k|        --dynhds->hds_len;
  317|  1.06k|        dynhds->strs_len -= (dynhds->hds[i]->namelen +
  318|  1.06k|                             dynhds->hds[i]->valuelen);
  319|  1.06k|        entry_free(dynhds->hds[i]);
  320|  1.06k|        len = dynhds->hds_len - i; /* remaining entries */
  321|  1.06k|        if(len) {
  ------------------
  |  Branch (321:12): [True: 396, False: 673]
  ------------------
  322|    396|          memmove(&dynhds->hds[i], &dynhds->hds[i + 1],
  323|    396|                  len * sizeof(dynhds->hds[i]));
  324|    396|        }
  325|  1.06k|        --i; /* do this index again */
  326|  1.06k|      }
  327|  3.86k|    }
  328|  1.33k|  }
  329|  2.50k|  return n;
  330|  2.50k|}
dynhds_set:
  345|  1.36k|{
  346|  1.36k|  dynhds_remove(dynhds, name, namelen);
  347|  1.36k|  return Curl_dynhds_add(dynhds, name, namelen, value, valuelen);
  348|  1.36k|}
dynhds_cremove:
  353|    672|{
  354|    672|  return dynhds_remove(dynhds, name, strlen(name));
  355|    672|}
dynhds.c:entry_free:
   57|  3.29k|{
   58|  3.29k|  curlx_free(e);
  ------------------
  |  | 1503|  3.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   59|  3.29k|}
dynhds.c:entry_new:
   33|  3.29k|{
   34|  3.29k|  struct dynhds_entry *e;
   35|  3.29k|  char *p;
   36|       |
   37|       |  /* namelen + valuelen <= SIZE_MAX has already been checked by caller */
   38|  3.29k|  if((SIZE_MAX - namelen - valuelen) < (sizeof(*e) + 2))
  ------------------
  |  Branch (38:6): [True: 0, False: 3.29k]
  ------------------
   39|      0|    return NULL;
   40|  3.29k|  e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2);
  ------------------
  |  | 1500|  3.29k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   41|  3.29k|  if(!e)
  ------------------
  |  Branch (41:6): [True: 0, False: 3.29k]
  ------------------
   42|      0|    return NULL;
   43|  3.29k|  e->name = p = (char *)e + sizeof(*e);
   44|  3.29k|  memcpy(p, name, namelen);
   45|  3.29k|  e->namelen = namelen;
   46|  3.29k|  e->value = p += namelen + 1; /* leave a \0 at the end of name */
   47|  3.29k|  if(valuelen) {
  ------------------
  |  Branch (47:6): [True: 803, False: 2.49k]
  ------------------
   48|    803|    memcpy(p, value, valuelen);
   49|    803|    e->valuelen = valuelen;
   50|    803|  }
   51|  3.29k|  if(opts & DYNHDS_OPT_LOWERCASE)
  ------------------
  |  |   54|  3.29k|#define DYNHDS_OPT_LOWERCASE     (1U << 0)
  ------------------
  |  Branch (51:6): [True: 1.88k, False: 1.41k]
  ------------------
   52|  1.88k|    Curl_strntolower(e->name, e->name, e->namelen);
   53|  3.29k|  return e;
   54|  3.29k|}

curl_global_init:
  234|      1|{
  235|      1|  CURLcode result;
  236|      1|  global_init_lock();
  ------------------
  |  |   92|      1|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  237|       |
  238|      1|  result = global_init(flags, TRUE);
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  239|       |
  240|      1|  global_init_unlock();
  ------------------
  |  |   93|      1|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  241|       |
  242|      1|  return result;
  243|      1|}
curl_global_cleanup:
  290|      1|{
  291|      1|  global_init_lock();
  ------------------
  |  |   92|      1|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  292|       |
  293|      1|  if(!initialized) {
  ------------------
  |  Branch (293:6): [True: 0, False: 1]
  ------------------
  294|      0|    global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  295|      0|    return;
  296|      0|  }
  297|       |
  298|      1|  if(--initialized) {
  ------------------
  |  Branch (298:6): [True: 0, False: 1]
  ------------------
  299|      0|    global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  300|      0|    return;
  301|      0|  }
  302|       |
  303|      1|  Curl_ssh_cleanup();
  304|      1|  Curl_ssl_cleanup();
  305|      1|  Curl_vquic_cleanup();
  306|      1|  Curl_async_global_cleanup();
  307|      1|  Curl_amiga_cleanup();
  ------------------
  |  |   37|      1|#define Curl_amiga_cleanup() Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|      1|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|       |
  309|       |#ifdef USE_WINSOCK
  310|       |  if(winsock_initialized) {
  311|       |    WSACleanup();
  312|       |    winsock_initialized = FALSE;
  313|       |  }
  314|       |#endif
  315|       |
  316|       |#ifdef USE_WINDOWS_SSPI
  317|       |  Curl_sspi_global_cleanup();
  318|       |#endif
  319|       |
  320|      1|#ifdef DEBUGBUILD
  321|      1|  curlx_free(leakpointer);
  ------------------
  |  | 1503|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  322|      1|#endif
  323|       |
  324|      1|  global_init_unlock();
  ------------------
  |  |   93|      1|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  325|      1|}
curl_easy_init:
  369|     54|{
  370|     54|  CURLcode result;
  371|     54|  struct Curl_easy *data;
  372|       |
  373|       |  /* Make sure we inited the global SSL stuff */
  374|     54|  global_init_lock();
  ------------------
  |  |   92|     54|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  375|       |
  376|     54|  if(!initialized) {
  ------------------
  |  Branch (376:6): [True: 0, False: 54]
  ------------------
  377|      0|    result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 3049|      0|#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  |  |  ------------------
  |  |  |  | 3047|      0|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3044|      0|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3045|      0|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  378|      0|    if(result) {
  ------------------
  |  Branch (378:8): [True: 0, False: 0]
  ------------------
  379|       |      /* something in the global init failed, return nothing */
  380|      0|      DEBUGF(curl_mfprintf(stderr, "Error: curl_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  381|      0|      global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  382|      0|      return NULL;
  383|      0|    }
  384|      0|  }
  385|     54|  global_init_unlock();
  ------------------
  |  |   93|     54|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  386|       |
  387|       |  /* We use Curl_open() with undefined URL so far */
  388|     54|  result = Curl_open(&data);
  389|     54|  if(result) {
  ------------------
  |  Branch (389:6): [True: 0, False: 54]
  ------------------
  390|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  391|      0|    return NULL;
  392|      0|  }
  393|       |
  394|     54|  return data;
  395|     54|}
curl_easy_cleanup:
  884|     54|{
  885|     54|  struct Curl_eapi_guard guard;
  886|       |
  887|     54|  if(CURL_EAPI_ENTER(&guard, curl, easy_cleanup, NULL)) {
  ------------------
  |  |  163|     54|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 54, False: 0]
  |  |  |  Branch (163:53): [True: 54, False: 0]
  |  |  ------------------
  ------------------
  888|     54|    struct Curl_easy *data = curl;
  889|     54|    struct Curl_sigpipe_ctx sigpipe_ctx;
  890|     54|    sigpipe_ignore(data, &sigpipe_ctx);
  891|     54|    Curl_close(&data);
  892|     54|    sigpipe_restore(&sigpipe_ctx);
  893|     54|  }
  894|     54|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|     54|  Curl_eapi_leave(g)
  ------------------
  895|     54|}
easy.c:global_init:
  130|      1|{
  131|      1|  (void)flags;
  132|       |
  133|      1|  if(initialized++)
  ------------------
  |  Branch (133:6): [True: 0, False: 1]
  ------------------
  134|      0|    return CURLE_OK;
  135|       |
  136|      1|  if(memoryfuncs) {
  ------------------
  |  Branch (136:6): [True: 1, False: 0]
  ------------------
  137|       |    /* Setup the default memory functions here (again) */
  138|      1|    Curl_cmalloc = (curl_malloc_callback)malloc;
  139|      1|    Curl_cfree = (curl_free_callback)free;
  140|      1|    Curl_crealloc = (curl_realloc_callback)realloc;
  141|      1|    Curl_cstrdup = (curl_strdup_callback)CURLX_STRDUP_LOW;
  ------------------
  |  | 1492|      1|#define CURLX_STRDUP_LOW strdup
  ------------------
  142|      1|    Curl_ccalloc = (curl_calloc_callback)calloc;
  143|      1|  }
  144|       |
  145|       |#ifdef _WIN32
  146|       |  curlx_verify_windows_init();
  147|       |  curlx_now_init();
  148|       |#endif
  149|       |
  150|      1|  if(Curl_trc_init()) {
  ------------------
  |  Branch (150:6): [True: 0, False: 1]
  ------------------
  151|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_trc_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  152|      0|    goto fail;
  153|      0|  }
  154|       |
  155|       |#ifdef USE_WINDOWS_SSPI
  156|       |  if(Curl_sspi_global_init()) {
  157|       |    DEBUGF(curl_mfprintf(stderr, "Error: Curl_sspi_global_init() failed\n"));
  158|       |    goto fail;
  159|       |  }
  160|       |#endif
  161|       |
  162|       |#ifdef USE_WINSOCK
  163|       |  /* CURL_GLOBAL_WINSOCK controls the *optional* part of the Windows
  164|       |     initialization which is for the Windows sockets library (Winsock). */
  165|       |  if(flags & CURL_GLOBAL_WINSOCK) {
  166|       |    WSADATA wsa;
  167|       |    if(WSAStartup(MAKEWORD(2, 2), &wsa)) {
  168|       |      DEBUGF(curl_mfprintf(stderr, "Error: WSAStartup() failed\n"));
  169|       |      goto fail;
  170|       |    }
  171|       |    winsock_initialized = TRUE;
  172|       |  }
  173|       |#endif
  174|       |
  175|      1|  if(!Curl_ssl_init()) {
  ------------------
  |  Branch (175:6): [True: 0, False: 1]
  ------------------
  176|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  177|      0|    goto fail;
  178|      0|  }
  179|       |
  180|      1|  if(Curl_hash_global_init()) {
  ------------------
  |  Branch (180:6): [True: 0, False: 1]
  ------------------
  181|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_hash_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  182|      0|    goto fail;
  183|      0|  }
  184|       |
  185|      1|  if(!Curl_vquic_init()) {
  ------------------
  |  |   82|      1|#define Curl_vquic_init() 1
  ------------------
  |  Branch (185:6): [Folded, False: 1]
  ------------------
  186|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  187|      0|    goto fail;
  188|      0|  }
  189|       |
  190|      1|  if(Curl_amiga_init()) {
  ------------------
  |  |   36|      1|#define Curl_amiga_init()    CURLE_OK
  |  |  ------------------
  |  |  |  Branch (36:30): [Folded, False: 1]
  |  |  ------------------
  ------------------
  191|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_amiga_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  192|      0|    goto fail;
  193|      0|  }
  194|       |
  195|      1|  if(Curl_macos_init()) {
  ------------------
  |  |   31|      1|#define Curl_macos_init() CURLE_OK
  |  |  ------------------
  |  |  |  Branch (31:27): [Folded, False: 1]
  |  |  ------------------
  ------------------
  196|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_macos_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  197|      0|    goto fail;
  198|      0|  }
  199|       |
  200|      1|  if(Curl_async_global_init()) {
  ------------------
  |  Branch (200:6): [True: 0, False: 1]
  ------------------
  201|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_async_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  202|      0|    goto fail;
  203|      0|  }
  204|       |
  205|      1|  if(Curl_ssh_init()) {
  ------------------
  |  |  264|      1|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (264:25): [Folded, False: 1]
  |  |  ------------------
  ------------------
  206|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  207|      0|    goto fail;
  208|      0|  }
  209|       |
  210|      1|#ifdef DEBUGBUILD
  211|      1|  if(getenv("CURL_GLOBAL_INIT"))
  ------------------
  |  Branch (211:6): [True: 0, False: 1]
  ------------------
  212|       |    /* alloc data that will leak if *cleanup() is not called! */
  213|      0|    leakpointer = curlx_malloc(1);
  ------------------
  |  | 1498|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  214|      1|#endif
  215|       |
  216|      1|  return CURLE_OK;
  217|       |
  218|      0|fail:
  219|       |#ifdef USE_WINSOCK
  220|       |  if(winsock_initialized) {
  221|       |    WSACleanup();
  222|       |    winsock_initialized = FALSE;
  223|       |  }
  224|       |#endif
  225|      0|  initialized--; /* undo the increase */
  226|      0|  return CURLE_FAILED_INIT;
  227|      1|}

easy.c:curl_simple_lock_lock:
   64|     56|{
   65|     56|  for(;;) {
   66|     56|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 56, False: 0]
  ------------------
   67|     56|      break;
   68|       |    /* Reduce cache coherency traffic */
   69|      0|    while(atomic_load_explicit(lock, memory_order_relaxed)) {
  ------------------
  |  Branch (69:11): [True: 0, False: 0]
  ------------------
   70|       |      /* Reduce load (not mandatory) */
   71|      0|#ifdef HAVE_BUILTIN_IA32_PAUSE
   72|      0|      __builtin_ia32_pause();
   73|       |#elif defined(__aarch64__)
   74|       |      /* NOLINTNEXTLINE(portability-no-assembler) */
   75|       |      __asm__ volatile("yield" ::: "memory");
   76|       |#elif defined(HAVE_SCHED_YIELD)
   77|       |      sched_yield();
   78|       |#endif
   79|      0|    }
   80|      0|  }
   81|     56|}
easy.c:curl_simple_lock_unlock:
   84|     56|{
   85|     56|  atomic_store_explicit(lock, false, memory_order_release);
   86|     56|}

Curl_frzn_strs_safefree:
   34|    486|{
   35|       |  curlx_safefree(*pfstrs);
  ------------------
  |  | 1359|    486|  do {                      \
  |  | 1360|    486|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    486|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    486|    (ptr) = NULL;           \
  |  | 1362|    486|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 486]
  |  |  ------------------
  ------------------
   36|    486|}

Curl_wildcard_dtor:
  191|     54|{
  192|     54|  struct WildcardData *wc = *wcp;
  193|     54|  if(!wc)
  ------------------
  |  Branch (193:6): [True: 54, False: 0]
  ------------------
  194|     54|    return;
  195|       |
  196|      0|  if(wc->dtor) {
  ------------------
  |  Branch (196:6): [True: 0, False: 0]
  ------------------
  197|      0|    wc->dtor(wc->ftpwc);
  198|      0|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1174|      0|#define ZERO_NULL 0
  ------------------
  199|      0|    wc->ftpwc = NULL;
  200|      0|  }
  201|      0|  DEBUGASSERT(!wc->ftpwc);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 0]
  |  Branch (201:3): [True: 0, False: 0]
  ------------------
  202|       |
  203|      0|  Curl_llist_destroy(&wc->filelist, NULL);
  204|      0|  curlx_safefree(wc->path);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  205|      0|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  206|      0|  wc->state = CURLWC_INIT;
  207|      0|  curlx_free(wc);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  208|       |  *wcp = NULL;
  209|      0|}

Curl_initinfo:
   43|     54|{
   44|     54|  struct Progress *pro = &data->progress;
   45|     54|  struct PureInfo *info = &data->info;
   46|       |
   47|     54|  memset(&pro->delta, 0, sizeof(pro->delta));
   48|     54|  memset(&pro->total, 0, sizeof(pro->total));
   49|     54|  pro->startransfer_added = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
   50|       |
   51|     54|  info->httpcode = 0;
   52|     54|  info->httpproxycode = 0;
   53|     54|  info->httpversion = 0;
   54|     54|  info->filetime = -1; /* -1 is an illegal time and thus means unknown */
   55|     54|  info->timecond = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
   56|       |
   57|     54|  info->header_size = 0;
   58|     54|  info->request_size = 0;
   59|     54|  info->proxyauthavail = 0;
   60|     54|  info->httpauthavail = 0;
   61|     54|  info->proxyauthpicked = 0;
   62|     54|  info->httpauthpicked = 0;
   63|     54|  info->numconnects = 0;
   64|       |
   65|     54|  curlx_safefree(info->contenttype);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
   66|     54|  curlx_safefree(info->wouldredirect);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
   67|     54|  curlx_safefree(info->effective_url);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
   68|       |
   69|     54|  memset(&info->primary, 0, sizeof(info->primary));
   70|     54|  info->retry_after = 0;
   71|       |
   72|     54|  info->conn_scheme = 0;
   73|     54|  info->conn_protocol = 0;
   74|     54|  info->used_proxy = 0;
   75|       |
   76|     54|#ifdef USE_SSL
   77|     54|  Curl_ssl_free_certinfo(data);
   78|     54|#endif
   79|     54|}

Curl_hash_global_init:
   60|      1|{
   61|      1|  static bool seeded;
   62|      1|  unsigned char buf[sizeof(size_t)];
   63|      1|  size_t seed = 0;
   64|      1|  size_t i;
   65|      1|  CURLcode result;
   66|       |
   67|      1|  if(seeded)
  ------------------
  |  Branch (67:6): [True: 0, False: 1]
  ------------------
   68|      0|    return CURLE_OK;
   69|       |
   70|      1|  result = Curl_rand_bytes(NULL,
   71|      1|#ifdef DEBUGBUILD
   72|      1|                           FALSE,
  ------------------
  |  |  989|      1|#define FALSE false
  ------------------
   73|      1|#endif
   74|      1|                           buf, sizeof(buf));
   75|      1|  if(result)
  ------------------
  |  Branch (75:6): [True: 0, False: 1]
  ------------------
   76|      0|    return result;
   77|       |
   78|      9|  for(i = 0; i < sizeof(buf); i++)
  ------------------
  |  Branch (78:14): [True: 8, False: 1]
  ------------------
   79|      8|    seed = (seed << 8) | buf[i];
   80|       |
   81|      1|  hash_seed = seed ? seed : 1;
  ------------------
  |  Branch (81:15): [True: 1, False: 0]
  ------------------
   82|       |  seeded = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
   83|      1|  return CURLE_OK;
   84|      1|}
Curl_hash_init:
  257|     54|{
  258|     54|  DEBUGASSERT(h);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (258:3): [True: 0, False: 54]
  |  Branch (258:3): [True: 54, False: 0]
  ------------------
  259|     54|  DEBUGASSERT(slots);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (259:3): [True: 0, False: 54]
  |  Branch (259:3): [True: 54, False: 0]
  ------------------
  260|     54|  DEBUGASSERT((unsigned int)type < CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (260:3): [True: 0, False: 54]
  |  Branch (260:3): [True: 54, False: 0]
  ------------------
  261|     54|  DEBUGASSERT(dtor);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (261:3): [True: 0, False: 54]
  |  Branch (261:3): [True: 54, False: 0]
  ------------------
  262|       |
  263|     54|  h->table = NULL;
  264|     54|  h->dtor = dtor;
  265|     54|  h->size = 0;
  266|     54|  h->slots = slots;
  267|     54|  h->type = (uint8_t)type;
  268|     54|#ifdef DEBUGBUILD
  269|     54|  h->init = HASHINIT;
  ------------------
  |  |   33|     54|#define HASHINIT 0x7017e781
  ------------------
  270|     54|#endif
  271|     54|}
Curl_hash_destroy:
  450|     54|{
  451|     54|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (451:3): [True: 0, False: 54]
  |  Branch (451:3): [True: 54, False: 0]
  ------------------
  452|     54|  if(h->table) {
  ------------------
  |  Branch (452:6): [True: 0, False: 54]
  ------------------
  453|      0|    Curl_hash_clean(h);
  454|      0|    curlx_safefree(h->table);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  455|      0|  }
  456|     54|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (456:3): [True: 0, False: 54]
  |  Branch (456:3): [True: 54, False: 0]
  ------------------
  457|     54|  h->slots = 0;
  458|     54|}

Curl_headers_cleanup:
  471|     54|{
  472|     54|  struct Curl_llist_node *e;
  473|     54|  struct Curl_llist_node *n;
  474|       |
  475|     54|  for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) {
  ------------------
  |  Branch (475:51): [True: 0, False: 54]
  ------------------
  476|      0|    struct Curl_header_store *hs = Curl_node_elem(e);
  477|      0|    n = Curl_node_next(e);
  478|      0|    curlx_free(hs);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  479|      0|  }
  480|     54|  headers_reset(data);
  481|     54|  return CURLE_OK;
  482|     54|}
headers.c:headers_reset:
  403|     54|{
  404|       |  Curl_llist_init(&data->state.httphdrs, NULL);
  405|     54|  data->state.nh_count = 0;
  406|     54|  memset(data->state.headerout, 0, sizeof(data->state.headerout));
  407|     54|}

Curl_hsts_cleanup:
   80|     54|{
   81|     54|  struct hsts *h = *hp;
   82|     54|  if(h) {
  ------------------
  |  Branch (82:6): [True: 0, False: 54]
  ------------------
   83|      0|    struct Curl_llist_node *e;
   84|      0|    struct Curl_llist_node *n;
   85|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (85:40): [True: 0, False: 0]
  ------------------
   86|      0|      struct stsentry *sts = Curl_node_elem(e);
   87|      0|      n = Curl_node_next(e);
   88|      0|      hsts_free(sts);
  ------------------
  |  |   77|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   89|      0|    }
   90|      0|    curlx_free(h->filename);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|      0|    curlx_free(h);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   92|       |    *hp = NULL;
   93|      0|  }
   94|     54|}
Curl_hsts_save:
  385|     54|{
  386|     54|  struct Curl_llist_node *e;
  387|     54|  struct Curl_llist_node *n;
  388|     54|  CURLcode result = CURLE_OK;
  389|     54|  FILE *out;
  390|     54|  char *tempstore = NULL;
  391|       |
  392|     54|  if(!h)
  ------------------
  |  Branch (392:6): [True: 54, False: 0]
  ------------------
  393|       |    /* no cache activated */
  394|     54|    return CURLE_OK;
  395|       |
  396|       |  /* if no new name is given, use the one we stored from the load */
  397|      0|  if(!file && h->filename)
  ------------------
  |  Branch (397:6): [True: 0, False: 0]
  |  Branch (397:15): [True: 0, False: 0]
  ------------------
  398|      0|    file = h->filename;
  399|       |
  400|      0|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1084|      0|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (400:6): [True: 0, False: 0]
  |  Branch (400:44): [True: 0, False: 0]
  |  Branch (400:53): [True: 0, False: 0]
  ------------------
  401|       |    /* marked as read-only, no file or zero length filename */
  402|      0|    goto skipsave;
  403|       |
  404|      0|  result = Curl_fopen(data, file, &out, &tempstore);
  405|      0|  if(!result) {
  ------------------
  |  Branch (405:6): [True: 0, False: 0]
  ------------------
  406|      0|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  407|      0|          "# This file was generated by libcurl! Edit at your own risk.\n",
  408|      0|          out);
  409|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (409:40): [True: 0, False: 0]
  ------------------
  410|      0|      struct stsentry *sts = Curl_node_elem(e);
  411|      0|      n = Curl_node_next(e);
  412|      0|      hsts_out(sts, out);
  413|      0|    }
  414|      0|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (414:8): [True: 0, False: 0]
  |  Branch (414:23): [True: 0, False: 0]
  ------------------
  415|      0|      result = CURLE_WRITE_ERROR;
  416|      0|    if(curlx_fclose(out))
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  417|      0|      result = CURLE_WRITE_ERROR;
  418|      0|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (418:8): [True: 0, False: 0]
  |  Branch (418:19): [True: 0, False: 0]
  |  Branch (418:32): [True: 0, False: 0]
  ------------------
  419|      0|      result = CURLE_WRITE_ERROR;
  420|       |
  421|      0|    if(result && tempstore)
  ------------------
  |  Branch (421:8): [True: 0, False: 0]
  |  Branch (421:18): [True: 0, False: 0]
  ------------------
  422|      0|      unlink(tempstore);
  423|      0|  }
  424|      0|  curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  425|      0|skipsave:
  426|      0|  if(data->set.hsts_write) {
  ------------------
  |  Branch (426:6): [True: 0, False: 0]
  ------------------
  427|       |    /* if there is a write callback */
  428|      0|    struct curl_index i; /* count */
  429|      0|    i.total = Curl_llist_count(&h->list);
  430|      0|    i.index = 0;
  431|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (431:40): [True: 0, False: 0]
  ------------------
  432|      0|      struct stsentry *sts = Curl_node_elem(e);
  433|      0|      bool stop;
  434|      0|      n = Curl_node_next(e);
  435|      0|      result = hsts_push(data, &i, sts, &stop);
  436|      0|      if(result || stop)
  ------------------
  |  Branch (436:10): [True: 0, False: 0]
  |  Branch (436:20): [True: 0, False: 0]
  ------------------
  437|      0|        break;
  438|      0|      i.index++;
  439|      0|    }
  440|      0|  }
  441|      0|  return result;
  442|      0|}

Curl_http_auth_cleanup_digest:
  174|     54|{
  175|     54|  Curl_auth_digest_cleanup(&data->state.digest);
  176|     54|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  177|     54|}

Curl_is_ASCII_str:
  238|     87|{
  239|     87|  if(s && s->len) {
  ------------------
  |  Branch (239:6): [True: 87, False: 0]
  |  Branch (239:11): [True: 87, False: 0]
  ------------------
  240|     87|    const unsigned char *ch = (const unsigned char *)s->str;
  241|     87|    size_t i;
  242|  1.00k|    for(i = 0; i < s->len; ++i) {
  ------------------
  |  Branch (242:16): [True: 921, False: 87]
  ------------------
  243|    921|      if(ch[i] & 0x80)
  ------------------
  |  Branch (243:10): [True: 0, False: 921]
  ------------------
  244|      0|        return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  245|    921|    }
  246|     87|  }
  247|     87|  return TRUE;
  ------------------
  |  |  986|     87|#define TRUE true
  ------------------
  248|     87|}

Curl_llist_init:
   46|    108|{
   47|    108|  l->_size = 0;
   48|    108|  l->_dtor = dtor;
   49|    108|  l->_head = NULL;
   50|    108|  l->_tail = NULL;
   51|    108|#ifdef DEBUGBUILD
   52|    108|  l->_init = LLISTINIT;
  ------------------
  |  |   29|    108|#define LLISTINIT 0x100cc001 /* random pattern */
  ------------------
   53|    108|#endif
   54|    108|}
Curl_llist_head:
  207|     54|{
  208|     54|  DEBUGASSERT(list);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (208:3): [True: 0, False: 54]
  |  Branch (208:3): [True: 54, False: 0]
  ------------------
  209|     54|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 54]
  |  Branch (209:3): [True: 54, False: 0]
  ------------------
  210|     54|  return VERIFYNODE(list->_head);
  ------------------
  |  |   33|     54|#define VERIFYNODE(x) verifynode(x)
  ------------------
  211|     54|}
llist.c:verifynode:
   35|     54|{
   36|     54|  DEBUGASSERT(!n || (n->_init == NODEINIT));
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (36:3): [True: 54, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  |  Branch (36:3): [True: 54, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  ------------------
   37|     54|  return n;
   38|     54|}

curl_dbg_calloc:
  241|  7.17k|{
  242|  7.17k|  struct memdebug *mem;
  243|  7.17k|  size_t size, user_size;
  244|       |
  245|  7.17k|  DEBUGASSERT(wanted_elements != 0);
  ------------------
  |  | 1016|  7.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (245:3): [True: 0, False: 7.17k]
  |  Branch (245:3): [True: 7.17k, False: 0]
  ------------------
  246|  7.17k|  DEBUGASSERT(wanted_size != 0);
  ------------------
  |  | 1016|  7.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (246:3): [True: 0, False: 7.17k]
  |  Branch (246:3): [True: 7.17k, False: 0]
  ------------------
  247|       |
  248|  7.17k|  if(countcheck("calloc", line, source))
  ------------------
  |  Branch (248:6): [True: 0, False: 7.17k]
  ------------------
  249|      0|    return NULL;
  250|       |
  251|       |  /* alloc at least 64 bytes */
  252|  7.17k|  user_size = wanted_size * wanted_elements;
  253|  7.17k|  size = sizeof(struct memdebug) + user_size;
  254|       |
  255|  7.17k|  mem = Curl_ccalloc(1, size);
  256|  7.17k|  if(mem)
  ------------------
  |  Branch (256:6): [True: 7.17k, False: 0]
  ------------------
  257|  7.17k|    mem->size = user_size;
  258|       |
  259|  7.17k|  if(source)
  ------------------
  |  Branch (259:6): [True: 7.17k, False: 0]
  ------------------
  260|  7.17k|    curl_dbg_log("MEM %s:%d calloc(%zu,%zu) = %p\n",
  261|  7.17k|                 source, line, wanted_elements, wanted_size,
  262|  7.17k|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (262:18): [True: 7.17k, False: 0]
  ------------------
  263|       |
  264|  7.17k|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (264:10): [True: 7.17k, False: 0]
  ------------------
  265|  7.17k|}
curl_dbg_free:
  366|  12.6k|{
  367|  12.6k|  if(ptr) {
  ------------------
  |  Branch (367:6): [True: 7.17k, False: 5.47k]
  ------------------
  368|  7.17k|    struct memdebug *mem;
  369|       |
  370|  7.17k|    if(source)
  ------------------
  |  Branch (370:8): [True: 7.17k, False: 0]
  ------------------
  371|  7.17k|      curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
  372|       |
  373|       |#ifdef __INTEL_COMPILER
  374|       |#  pragma warning(push)
  375|       |#  pragma warning(disable:1684)
  376|       |   /* 1684: conversion from pointer to same-sized integral type */
  377|       |#endif
  378|       |
  379|  7.17k|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  380|       |
  381|       |#ifdef __INTEL_COMPILER
  382|       |#  pragma warning(pop)
  383|       |#endif
  384|       |
  385|       |    /* free for real */
  386|  7.17k|    Curl_cfree(mem);
  387|  7.17k|  }
  388|  12.6k|}
curl_dbg_socketpair:
  412|  1.09k|{
  413|       |  /* !checksrc! disable BANNEDFUNC 1 */
  414|  1.09k|  int res = socketpair(domain, type, protocol, socket_vector);
  415|       |
  416|  1.09k|  if(source && (res == 0))
  ------------------
  |  Branch (416:6): [True: 271, False: 820]
  |  Branch (416:16): [True: 271, False: 0]
  ------------------
  417|    271|    curl_dbg_log("FD %s:%d socketpair() = "
  418|    271|                 "%" FMT_SOCKET_T " %" FMT_SOCKET_T "\n",
  419|    271|                 source, line, socket_vector[0], socket_vector[1]);
  420|       |
  421|  1.09k|  return res;
  422|  1.09k|}
curl_dbg_accept:
  427|  1.43k|{
  428|  1.43k|  struct sockaddr *addr = (struct sockaddr *)saddr;
  429|  1.43k|  curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen;
  430|       |
  431|       |  /* !checksrc! disable BANNEDFUNC 1 */
  432|  1.43k|  curl_socket_t sockfd = accept(s, addr, addrlen);
  433|       |
  434|  1.43k|  if(source && (sockfd != CURL_SOCKET_BAD))
  ------------------
  |  |  147|    428|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (434:6): [True: 428, False: 1.01k]
  |  Branch (434:16): [True: 0, False: 428]
  ------------------
  435|      0|    curl_dbg_log("FD %s:%d accept() = %" FMT_SOCKET_T "\n",
  436|      0|                 source, line, sockfd);
  437|       |
  438|  1.43k|  return sockfd;
  439|  1.43k|}
curl_dbg_mark_sclose:
  462|  2.18k|{
  463|  2.18k|  if(source)
  ------------------
  |  Branch (463:6): [True: 0, False: 2.18k]
  ------------------
  464|      0|    curl_dbg_log("FD %s:%d sclose(%" FMT_SOCKET_T ")\n",
  465|      0|                 source, line, sockfd);
  466|  2.18k|}
curl_dbg_sclose:
  470|  2.18k|{
  471|  2.18k|  curl_dbg_mark_sclose(sockfd, line, source);
  472|  2.18k|  return CURL_SCLOSE(sockfd);
  ------------------
  |  |  926|  2.18k|#  define CURL_SCLOSE(x)  close(x)
  ------------------
  473|  2.18k|}
curl_dbg_fopen:
  478|    649|{
  479|    649|  FILE *res = CURLX_FOPEN_LOW(file, mode);
  ------------------
  |  |   68|    649|#define CURLX_FOPEN_LOW         fopen
  ------------------
  480|    649|  if(source)
  ------------------
  |  Branch (480:6): [True: 424, False: 225]
  ------------------
  481|    424|    curl_dbg_log("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
  482|    424|                 source, line, file, mode, (void *)res);
  483|       |
  484|    649|  return res;
  485|    649|}
curl_dbg_freopen:
  490|    649|{
  491|    649|  FILE *res = CURLX_FREOPEN_LOW(file, mode, fh);
  ------------------
  |  |   69|    649|#define CURLX_FREOPEN_LOW       freopen
  ------------------
  492|    649|  if(source)
  ------------------
  |  Branch (492:6): [True: 424, False: 225]
  ------------------
  493|    424|    curl_dbg_log("FILE %s:%d freopen(\"%s\",\"%s\",%p) = %p\n",
  494|    424|                 source, line, file, mode, (void *)fh, (void *)res);
  495|       |
  496|    649|  return res;
  497|    649|}
curl_dbg_fdopen:
  502|    548|{
  503|    548|  FILE *res = CURLX_FDOPEN_LOW(filedes, mode);
  ------------------
  |  |   70|    548|#define CURLX_FDOPEN_LOW        fdopen
  ------------------
  504|    548|  if(source)
  ------------------
  |  Branch (504:6): [True: 242, False: 306]
  ------------------
  505|    242|    curl_dbg_log("FILE %s:%d fdopen(\"%d\",\"%s\") = %p\n",
  506|    242|                 source, line, filedes, mode, (void *)res);
  507|    548|  return res;
  508|    548|}
curl_dbg_fclose:
  511|  1.19k|{
  512|  1.19k|  int res;
  513|       |
  514|  1.19k|  DEBUGASSERT(file);
  ------------------
  |  | 1016|  1.19k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (514:3): [True: 0, False: 1.19k]
  |  Branch (514:3): [True: 1.19k, False: 0]
  ------------------
  515|       |
  516|  1.19k|  if(source)
  ------------------
  |  Branch (516:6): [True: 666, False: 531]
  ------------------
  517|    666|    curl_dbg_log("FILE %s:%d fclose(%p)\n", source, line, (void *)file);
  518|       |
  519|       |  /* !checksrc! disable BANNEDFUNC 1 */
  520|  1.19k|  res = fclose(file);
  521|       |
  522|  1.19k|  return res;
  523|  1.19k|}
curl_dbg_log:
  566|  16.3k|{
  567|  16.3k|  bool was_locked;
  568|  16.3k|  va_list ap;
  569|       |
  570|  16.3k|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (570:6): [True: 16.3k, False: 0]
  ------------------
  571|  16.3k|    return;
  572|       |
  573|      0|  was_locked = curl_dbg_lock();
  574|      0|  va_start(ap, format);
  575|      0|  curl_dbg_vlog(format, ap);
  576|       |  va_end(ap);
  577|      0|  curl_dbg_unlock(was_locked);
  578|      0|}
memdebug.c:countcheck:
  188|  7.17k|{
  189|       |  /* if source is NULL, then the call is made internally and this check
  190|       |     should not be made */
  191|  7.17k|  if(memlimit && source) {
  ------------------
  |  Branch (191:6): [True: 0, False: 7.17k]
  |  Branch (191:18): [True: 0, False: 0]
  ------------------
  192|      0|    if(!memsize) {
  ------------------
  |  Branch (192:8): [True: 0, False: 0]
  ------------------
  193|       |      /* log to file */
  194|      0|      curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", source, line, func);
  195|       |      /* log to stderr also */
  196|      0|      curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
  197|      0|                    source, line, func);
  198|      0|      dump_bt();
  199|      0|      fflush(curl_dbg_logfile); /* because it might crash now */
  200|       |      /* !checksrc! disable ERRNOVAR 1 */
  201|      0|      errno = ENOMEM;
  202|      0|      return TRUE; /* RETURN ERROR! */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  203|      0|    }
  204|      0|    else
  205|      0|      memsize--; /* countdown */
  206|      0|  }
  207|       |
  208|  7.17k|  return FALSE; /* allow this */
  ------------------
  |  |  989|  7.17k|#define FALSE false
  ------------------
  209|  7.17k|}

Curl_mime_cleanpart:
 1086|    108|{
 1087|    108|  if(part) {
  ------------------
  |  Branch (1087:6): [True: 0, False: 108]
  ------------------
 1088|      0|    cleanup_part_content(part);
 1089|      0|    curl_slist_free_all(part->curlheaders);
 1090|      0|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1090:8): [True: 0, False: 0]
  ------------------
 1091|      0|      curl_slist_free_all(part->userheaders);
 1092|      0|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1093|      0|    curlx_safefree(part->name);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1094|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1095|      0|    Curl_mime_initpart(part);
 1096|      0|  }
 1097|    108|}

Curl_detach_connection:
  923|     54|{
  924|     54|  struct connectdata *conn = data->conn;
  925|     54|  if(conn) {
  ------------------
  |  Branch (925:6): [True: 0, False: 54]
  ------------------
  926|       |    /* this should never happen, prevent underflow */
  927|      0|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (927:5): [True: 0, False: 0]
  |  Branch (927:5): [True: 0, False: 0]
  ------------------
  928|      0|    if(conn->attached_xfers) {
  ------------------
  |  Branch (928:8): [True: 0, False: 0]
  ------------------
  929|      0|      conn->attached_xfers--;
  930|      0|      if(!conn->attached_xfers)
  ------------------
  |  Branch (930:10): [True: 0, False: 0]
  ------------------
  931|      0|        conn->attached_multi = NULL;
  932|      0|    }
  933|      0|  }
  934|     54|  data->conn = NULL;
  935|     54|}
Curl_expire_clear_all:
 3914|     54|{
 3915|     54|  struct Curl_multi *multi = data->multi;
 3916|       |
 3917|       |  /* this is only interesting while there is still an associated multi struct
 3918|       |     remaining! */
 3919|     54|  if(!multi)
  ------------------
  |  Branch (3919:6): [True: 54, False: 0]
  ------------------
 3920|     54|    return;
 3921|       |
 3922|      0|  if(Curl_timeouts_remove(&multi->timeouts, data)) {
  ------------------
  |  Branch (3922:6): [True: 0, False: 0]
  ------------------
 3923|       |    /* Since this is an cleared time, we must remove the previous entry from
 3924|       |       the splay tree */
 3925|      0|    multi_timeouts_init(data);
 3926|       |
 3927|      0|    if(data->id >= 0)
  ------------------
  |  Branch (3927:8): [True: 0, False: 0]
  ------------------
 3928|      0|      CURL_TRC_M(data, "[TIMEOUT] all cleared");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3929|      0|  }
 3930|      0|}

Curl_netrc_init:
  669|     54|{
  670|     54|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|     54|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  671|     54|  store->loaded = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  672|       |  store->filename = NULL;
  673|     54|}
Curl_netrc_cleanup:
  675|     54|{
  676|     54|  curlx_dyn_free(&store->filebuf);
  677|     54|  curlx_safefree(store->filename);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  678|       |  store->loaded = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  679|     54|}

Curl_peer_create:
  251|     87|{
  252|     87|  struct peer_parse pp;
  253|     87|  CURLcode result;
  254|       |
  255|     87|  Curl_peer_unlink(ppeer);
  256|     87|  memset(&pp, 0, sizeof(pp));
  257|     87|  pp.scheme = scheme;
  258|     87|  pp.host_user.str = hostname;
  259|     87|  pp.host_user.len = strlen(hostname);
  260|     87|  pp.port = port;
  261|       |
  262|     87|  result = peer_parse_host(data, &pp, TRUE);
  ------------------
  |  |  986|     87|#define TRUE true
  ------------------
  263|     87|  if(!result)
  ------------------
  |  Branch (263:6): [True: 87, False: 0]
  ------------------
  264|     87|    result = peer_create(&pp, ppeer);
  265|       |
  266|     87|  peer_parse_clear(&pp);
  267|     87|  return result;
  268|     87|}
Curl_peer_link:
  300|    162|{
  301|    162|  if(*pdest != src) {
  ------------------
  |  Branch (301:6): [True: 123, False: 39]
  ------------------
  302|    123|    Curl_peer_unlink(pdest);
  303|    123|    *pdest = src;
  304|    123|    if(src) {
  ------------------
  |  Branch (304:8): [True: 123, False: 0]
  ------------------
  305|    123|      uint32_t newcount = Curl_refcount_incr(&src->refcount);
  ------------------
  |  |   56|    123|  (atomic_fetch_add_explicit(c, 1U, memory_order_relaxed) + 1U)
  ------------------
  306|    123|      (void)newcount;
  307|       |      DEBUGASSERT(newcount < UINT32_MAX);
  ------------------
  |  | 1016|    123|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (307:7): [True: 0, False: 123]
  |  Branch (307:7): [True: 123, False: 0]
  ------------------
  308|    123|    }
  309|    123|  }
  310|    162|}
Curl_peer_unlink:
  313|    966|{
  314|    966|  if(*ppeer) {
  ------------------
  |  Branch (314:6): [True: 210, False: 756]
  ------------------
  315|    210|    struct Curl_peer *peer = *ppeer;
  316|    210|    uint32_t newcount;
  317|       |
  318|    210|    *ppeer = NULL;
  319|       |
  320|    210|    newcount = Curl_refcount_decr(&peer->refcount);
  ------------------
  |  |   58|    210|  (atomic_fetch_sub_explicit(c, 1U, memory_order_acq_rel) - 1U)
  ------------------
  321|    210|    DEBUGASSERT(newcount < UINT32_MAX); /* wraparound check */
  ------------------
  |  | 1016|    210|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (321:5): [True: 0, False: 210]
  |  Branch (321:5): [True: 210, False: 0]
  ------------------
  322|       |
  323|    210|    if(!newcount)
  ------------------
  |  Branch (323:8): [True: 87, False: 123]
  ------------------
  324|     87|      curlx_free(peer);
  ------------------
  |  | 1503|     87|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  325|    210|  }
  326|    966|}
peer.c:peer_parse_host:
  186|     87|{
  187|     87|  if(!pp || !pp->host_user.str || !pp->host_user.len)
  ------------------
  |  Branch (187:6): [True: 0, False: 87]
  |  Branch (187:13): [True: 0, False: 87]
  |  Branch (187:35): [True: 0, False: 87]
  ------------------
  188|      0|    return CURLE_FAILED_INIT;
  189|       |
  190|     87|  if(pp->host_user.str[0] == '[') {
  ------------------
  |  Branch (190:6): [True: 0, False: 87]
  ------------------
  191|      0|    const char *s = pp->host_user.str + 1;
  192|      0|    struct Curl_str tmp;
  193|      0|    if(curlx_str_until(&s, &tmp, pp->host_user.len - 1, ']'))
  ------------------
  |  Branch (193:8): [True: 0, False: 0]
  ------------------
  194|      0|      return CURLE_URL_MALFORMAT;
  195|       |
  196|      0|    if(!Curl_looks_like_ipv6(tmp.str, tmp.len, TRUE,
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  |  Branch (196:8): [True: 0, False: 0]
  ------------------
  197|      0|                             &pp->host, &pp->zoneid)) {
  198|      0|      failf(data, "Invalid IPv6 address format in '%.*s'",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  199|      0|            (int)pp->host_user.len, pp->host_user.str);
  200|      0|      return CURLE_URL_MALFORMAT;
  201|      0|    }
  202|      0|    pp->ipv6 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  203|      0|  }
  204|     87|  else {
  205|     87|#ifdef USE_IDN
  206|     87|    if(!Curl_is_ASCII_str(&pp->host_user)) {
  ------------------
  |  Branch (206:8): [True: 0, False: 87]
  ------------------
  207|      0|      CURLcode result;
  208|      0|      if(!pp->tmp_host_user) {
  ------------------
  |  Branch (208:10): [True: 0, False: 0]
  ------------------
  209|       |        /* need a null-terminated string for IDN */
  210|      0|        pp->tmp_host_user = curlx_memdup0(pp->host_user.str,
  211|      0|                                          pp->host_user.len);
  212|      0|        if(!pp->tmp_host_user)
  ------------------
  |  Branch (212:12): [True: 0, False: 0]
  ------------------
  213|      0|          return CURLE_OUT_OF_MEMORY;
  214|      0|      }
  215|      0|      result = Curl_idn_decode(pp->tmp_host_user, &pp->tmp_host);
  216|      0|      if(!result &&
  ------------------
  |  Branch (216:10): [True: 0, False: 0]
  ------------------
  217|      0|         Curl_hostname_check(pp->tmp_host, strlen(pp->tmp_host))) {
  ------------------
  |  Branch (217:10): [True: 0, False: 0]
  ------------------
  218|      0|        failf(data, "Illegal hostname: %s", pp->tmp_host);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  219|      0|        result = CURLE_URL_MALFORMAT;
  220|      0|      }
  221|      0|      if(result)
  ------------------
  |  Branch (221:10): [True: 0, False: 0]
  ------------------
  222|      0|        return result;
  223|      0|      pp->host.str = pp->tmp_host;
  224|      0|      pp->host.len = strlen(pp->host.str);
  225|      0|    }
  226|     87|    else
  227|     87|#endif
  228|     87|    if(scan_for_ipv6 &&
  ------------------
  |  Branch (228:8): [True: 87, False: 0]
  ------------------
  229|     87|       Curl_looks_like_ipv6(pp->host_user.str, pp->host_user.len, TRUE,
  ------------------
  |  |  986|     87|#define TRUE true
  ------------------
  |  Branch (229:8): [True: 0, False: 87]
  ------------------
  230|     87|                            &pp->host, &pp->zoneid)) {
  231|      0|      if(pp->host_user.len < MAX_IPADR_LEN) {
  ------------------
  |  |   41|      0|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  |  Branch (231:10): [True: 0, False: 0]
  ------------------
  232|      0|        char tmp[MAX_IPADR_LEN];
  233|      0|        memcpy(tmp, pp->host_user.str, pp->host_user.len);
  234|      0|        tmp[pp->host_user.len] = 0;
  235|      0|        pp->ipv6 = !Curl_is_ipv4addr(tmp);
  236|      0|      }
  237|      0|      else
  238|      0|        pp->ipv6 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  239|      0|    }
  240|     87|    else
  241|     87|      pp->host = pp->host_user;
  242|     87|  }
  243|     87|  return CURLE_OK;
  244|     87|}
peer.c:peer_create:
  105|     87|{
  106|     87|  struct Curl_peer *peer = NULL;
  107|     87|  CURLcode result = CURLE_OK;
  108|     87|  size_t zone_alen = 0, host_alen = 0;
  109|       |
  110|     87|  if(!pp || !pp->scheme)
  ------------------
  |  Branch (110:6): [True: 0, False: 87]
  |  Branch (110:13): [True: 0, False: 87]
  ------------------
  111|      0|    return CURLE_FAILED_INIT;
  112|     87|  if(!pp->host.len && !(pp->scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (112:6): [True: 0, False: 87]
  |  Branch (112:23): [True: 0, False: 0]
  ------------------
  113|      0|    return CURLE_FAILED_INIT;
  114|       |
  115|     87|  if((pp->host.str != pp->host_user.str) ||
  ------------------
  |  Branch (115:6): [True: 0, False: 87]
  ------------------
  116|     87|     (pp->host.len != pp->host_user.len)) {
  ------------------
  |  Branch (116:6): [True: 0, False: 87]
  ------------------
  117|      0|    host_alen = pp->host.len + 1;
  118|      0|  }
  119|     87|  zone_alen = pp->zoneid.len ? (pp->zoneid.len + 1) : 0;
  ------------------
  |  Branch (119:15): [True: 0, False: 87]
  ------------------
  120|       |
  121|       |  /* null-terminator already part of struct */
  122|     87|  peer = curlx_calloc(1, sizeof(*peer) +
  ------------------
  |  | 1500|     87|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  123|     87|                         pp->host_user.len + host_alen + zone_alen);
  124|     87|  if(!peer) {
  ------------------
  |  Branch (124:6): [True: 0, False: 87]
  ------------------
  125|      0|    result = CURLE_OUT_OF_MEMORY;
  126|      0|    goto out;
  127|      0|  }
  128|       |
  129|     87|  Curl_refcount_init(&peer->refcount, 1);
  ------------------
  |  |   53|     87|#define Curl_refcount_init(c, v) atomic_init(c, v)
  ------------------
  130|     87|  peer->scheme = pp->scheme;
  131|     87|  peer->hostname = peer->user_hostname;
  132|     87|  peer->port = pp->port;
  133|     87|  peer->scopeid = pp->scopeid;
  134|     87|  peer->ipv6 = pp->ipv6;
  135|     87|  peer->unix_socket = pp->unix_socket;
  136|     87|  peer->abstract_uds = pp->abstract_uds;
  137|       |
  138|     87|  if(pp->host_user.len)
  ------------------
  |  Branch (138:6): [True: 87, False: 0]
  ------------------
  139|     87|    memcpy(peer->user_hostname, pp->host_user.str, pp->host_user.len);
  140|       |
  141|     87|  if(host_alen) {
  ------------------
  |  Branch (141:6): [True: 0, False: 87]
  ------------------
  142|      0|    peer->hostname = peer->user_hostname + pp->host_user.len + 1;
  143|      0|    memcpy(peer->hostname, pp->host.str, pp->host.len);
  144|      0|  }
  145|       |
  146|     87|  if(zone_alen) {
  ------------------
  |  Branch (146:6): [True: 0, False: 87]
  ------------------
  147|      0|    peer->zoneid = peer->user_hostname + pp->host_user.len + 1 + host_alen;
  148|      0|    memcpy(peer->zoneid, pp->zoneid.str, pp->zoneid.len);
  149|      0|#ifdef USE_IPV6
  150|       |    /* Determine scope_id if not already provided */
  151|      0|    if(!peer->scopeid) {
  ------------------
  |  Branch (151:8): [True: 0, False: 0]
  ------------------
  152|      0|      const char *p = peer->zoneid;
  153|      0|      curl_off_t scope;
  154|      0|      if(!curlx_str_number(&p, &scope, UINT_MAX) && !*p) {
  ------------------
  |  Branch (154:10): [True: 0, False: 0]
  |  Branch (154:53): [True: 0, False: 0]
  ------------------
  155|       |        /* A plain number, use it directly as a scope id. */
  156|      0|        peer->scopeid = (uint32_t)scope;
  157|      0|      }
  158|      0|#ifdef HAVE_IF_NAMETOINDEX
  159|      0|      else {
  160|       |        /* Zone identifier is not fully numeric */
  161|      0|        unsigned int idx = 0;
  162|      0|        idx = if_nametoindex(peer->zoneid);
  163|      0|        if(idx) {
  ------------------
  |  Branch (163:12): [True: 0, False: 0]
  ------------------
  164|      0|          peer->scopeid = (uint32_t)idx;
  165|      0|        }
  166|      0|        else {
  167|       |          /* Do we want to return an error here? */
  168|      0|        }
  169|      0|      }
  170|      0|#endif /* HAVE_IF_NAMETOINDEX */
  171|      0|    }
  172|      0|#endif /* USE_IPV6 */
  173|      0|  }
  174|       |
  175|     87|out:
  176|     87|  if(!result)
  ------------------
  |  Branch (176:6): [True: 87, False: 0]
  ------------------
  177|     87|    *ppeer = peer;
  178|      0|  else
  179|      0|    Curl_peer_unlink(&peer);
  180|     87|  return result;
  181|     87|}
peer.c:peer_parse_clear:
   96|     87|{
   97|     87|  curlx_free(pp->tmp_host_user);
  ------------------
  |  | 1503|     87|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|     87|  curlx_free(pp->tmp_host);
  ------------------
  |  | 1503|     87|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   99|     87|  curlx_free(pp->tmp_zoneid);
  ------------------
  |  | 1503|     87|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  100|     87|  memset(pp, 0, sizeof(*pp));
  101|     87|}

Curl_getn_scheme:
  573|     54|{
  574|     54|  typedef const struct Curl_scheme *(*letterfunc)(const char *ptr);
  575|     54|  static const letterfunc parse[] = {
  576|     54|    two_letter_scheme,
  577|     54|    three_letter_scheme,
  578|     54|    four_letter_scheme,
  579|     54|    five_letter_scheme,
  580|     54|    six_letter_scheme,
  581|     54|    seven_letter_scheme
  582|     54|  };
  583|       |
  584|     54|  if(len < 2 || len > 7)
  ------------------
  |  Branch (584:6): [True: 0, False: 54]
  |  Branch (584:17): [True: 0, False: 54]
  ------------------
  585|      0|    return NULL;
  586|       |
  587|     54|  return parse[len - 2](scheme);
  588|     54|}
Curl_get_scheme:
  592|     54|{
  593|     54|  return Curl_getn_scheme(scheme, strlen(scheme));
  594|     54|}
protocol.c:four_letter_scheme:
  471|     54|{
  472|     54|  uint32_t prot = MKPROT(LWR(scheme[0]), LWR(scheme[1]), LWR(scheme[2]),
  ------------------
  |  |  439|     54|  ((((uint32_t)(a)) << 24) | \
  |  |  440|     54|   (((uint32_t)(b)) << 16) | \
  |  |  441|     54|   (((uint32_t)(c)) <<  8) | \
  |  |  442|     54|    ((uint32_t)(d)))
  ------------------
  473|     54|                         LWR(scheme[3]));
  474|     54|  switch(prot) {
  ------------------
  |  Branch (474:10): [True: 54, False: 0]
  ------------------
  475|     54|  case MKPROT('h', 't', 't', 'p'):
  ------------------
  |  |  439|     54|  ((((uint32_t)(a)) << 24) | \
  |  |  440|     54|   (((uint32_t)(b)) << 16) | \
  |  |  441|     54|   (((uint32_t)(c)) <<  8) | \
  |  |  442|     54|    ((uint32_t)(d)))
  ------------------
  |  Branch (475:3): [True: 54, False: 0]
  ------------------
  476|     54|    return &Curl_scheme_http;
  477|      0|  case MKPROT('i', 'm', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (477:3): [True: 0, False: 54]
  ------------------
  478|      0|    return &Curl_scheme_imap;
  479|      0|  case MKPROT('l', 'd', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (479:3): [True: 0, False: 54]
  ------------------
  480|      0|    return &Curl_scheme_ldap;
  481|      0|  case MKPROT('r', 't', 's', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (481:3): [True: 0, False: 54]
  ------------------
  482|      0|    return &Curl_scheme_rtsp;
  483|      0|  case MKPROT('t', 'f', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (483:3): [True: 0, False: 54]
  ------------------
  484|      0|    return &Curl_scheme_tftp;
  485|      0|  case MKPROT('s', 'f', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (485:3): [True: 0, False: 54]
  ------------------
  486|      0|    return &Curl_scheme_sftp;
  487|      0|  case MKPROT('s', 'm', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (487:3): [True: 0, False: 54]
  ------------------
  488|      0|    return &Curl_scheme_smtp;
  489|      0|  case MKPROT('f', 't', 'p', 's'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (489:3): [True: 0, False: 54]
  ------------------
  490|      0|    return &Curl_scheme_ftps;
  491|      0|  case MKPROT('f', 'i', 'l', 'e'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (491:3): [True: 0, False: 54]
  ------------------
  492|      0|    return &Curl_scheme_file;
  493|      0|  case MKPROT('m', 'q', 't', 't'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (493:3): [True: 0, False: 54]
  ------------------
  494|      0|    return &Curl_scheme_mqtt;
  495|      0|  case MKPROT('p', 'o', 'p', '3'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (495:3): [True: 0, False: 54]
  ------------------
  496|      0|    if(scheme[3] == '3')
  ------------------
  |  Branch (496:8): [True: 0, False: 0]
  ------------------
  497|      0|      return &Curl_scheme_pop3;
  498|      0|    break;
  499|      0|  case MKPROT('d', 'i', 'c', 't'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (499:3): [True: 0, False: 54]
  ------------------
  500|      0|    return &Curl_scheme_dict;
  501|     54|  }
  502|      0|  return NULL;
  503|     54|}

Curl_ptrarray_init:
   31|    202|{
   32|       |  pa->data = NULL;
   33|    202|  pa->n = pa->capacity = 0;
   34|    202|}
ptrarray_clear:
   40|  1.67k|{
   41|       |  curlx_safefree(pa->data);
  ------------------
  |  | 1359|  1.67k|  do {                      \
  |  | 1360|  1.67k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.67k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.67k|    (ptr) = NULL;           \
  |  | 1362|  1.67k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.67k]
  |  |  ------------------
  ------------------
   42|  1.67k|  pa->n = pa->capacity = 0;
   43|  1.67k|}
ptrarray_count:
   49|    453|{
   50|    453|  return pa->n;
   51|    453|}
ptrarray_get:
   56|  1.59k|{
   57|  1.59k|  return (idx < pa->n) ? pa->data[idx] : NULL;
  ------------------
  |  Branch (57:10): [True: 819, False: 780]
  ------------------
   58|  1.59k|}
Curl_ptrarray_add:
   62|  6.08k|{
   63|  6.08k|  if(!ptr)
  ------------------
  |  Branch (63:6): [True: 205, False: 5.88k]
  ------------------
   64|    205|    return CURLE_BAD_FUNCTION_ARGUMENT;
   65|  5.88k|  if(pa->n >= pa->capacity) {
  ------------------
  |  Branch (65:6): [True: 823, False: 5.05k]
  ------------------
   66|    823|    uint32_t growth;
   67|    823|    void **ndata;
   68|       |
   69|    823|    if(pa->capacity == UINT32_MAX)
  ------------------
  |  Branch (69:8): [True: 0, False: 823]
  ------------------
   70|      0|      return CURLE_OUT_OF_MEMORY;
   71|    823|    if(!pa->capacity)
  ------------------
  |  Branch (71:8): [True: 670, False: 153]
  ------------------
   72|    670|      growth = 8;
   73|    153|    else if((UINT32_MAX / 2) > pa->capacity)
  ------------------
  |  Branch (73:13): [True: 153, False: 0]
  ------------------
   74|    153|      growth = CURLMIN(2 * pa->capacity, CURL_PTRARRAY_MAX_GROW);
  ------------------
  |  | 1315|    153|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 153, False: 0]
  |  |  ------------------
  ------------------
   75|      0|    else
   76|      0|      growth = ((UINT32_MAX - pa->capacity) > CURL_PTRARRAY_MAX_GROW) ?
  ------------------
  |  |   28|      0|#define CURL_PTRARRAY_MAX_GROW     (16 * 1024)
  ------------------
  |  Branch (76:16): [True: 0, False: 0]
  ------------------
   77|      0|               CURL_PTRARRAY_MAX_GROW : (UINT32_MAX - pa->capacity);
  ------------------
  |  |   28|      0|#define CURL_PTRARRAY_MAX_GROW     (16 * 1024)
  ------------------
   78|       |
   79|    823|    ndata = curlx_calloc(1, (pa->capacity + growth) * sizeof(void *));
  ------------------
  |  | 1500|    823|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   80|    823|    if(!ndata)
  ------------------
  |  Branch (80:8): [True: 0, False: 823]
  ------------------
   81|      0|      return CURLE_OUT_OF_MEMORY;
   82|    823|    if(pa->n)
  ------------------
  |  Branch (82:8): [True: 153, False: 670]
  ------------------
   83|    153|      memcpy(ndata, pa->data, pa->n * sizeof(void *));
   84|    823|    curlx_free(pa->data);
  ------------------
  |  | 1503|    823|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   85|    823|    pa->data = ndata;
   86|    823|    pa->capacity += growth;
   87|    823|  }
   88|  5.88k|  DEBUGASSERT(pa->n < pa->capacity);
  ------------------
  |  | 1016|  5.88k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (88:3): [True: 0, False: 5.88k]
  |  Branch (88:3): [True: 5.88k, False: 0]
  ------------------
   89|  5.88k|  pa->data[pa->n++] = ptr;
   90|  5.88k|  return CURLE_OK;
   91|  5.88k|}
Curl_ptrarray_remove:
   94|  1.26k|{
   95|  1.26k|  if(idx < pa->n) {
  ------------------
  |  Branch (95:6): [True: 593, False: 668]
  ------------------
   96|    593|    uint32_t rem = pa->n - idx - 1;
   97|    593|    void *ptr = pa->data[idx];
   98|    593|    pa->data[idx] = NULL;
   99|    593|    if(rem)
  ------------------
  |  Branch (99:8): [True: 240, False: 353]
  ------------------
  100|    240|      memmove(pa->data + idx, pa->data + idx + 1, rem * sizeof(void *));
  101|    593|    pa->n--;
  102|    593|    if(!pa->n)
  ------------------
  |  Branch (102:8): [True: 334, False: 259]
  ------------------
  103|    334|      ptrarray_clear(pa);
  104|    593|    return ptr;
  105|    593|  }
  106|    668|  return NULL;
  107|  1.26k|}

Curl_rand_bytes:
  144|      1|{
  145|      1|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
  146|       |#ifndef DEBUGBUILD
  147|       |  const bool env_override = FALSE;
  148|       |#endif
  149|       |
  150|      1|  DEBUGASSERT(num);
  ------------------
  |  | 1016|      1|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 1]
  |  Branch (150:3): [True: 1, False: 0]
  ------------------
  151|       |
  152|      1|#ifdef USE_SSL
  153|       |  /* get all bytes in one call unless they are forced for testing */
  154|      1|  if(!env_override || !getenv("CURL_ENTROPY"))
  ------------------
  |  Branch (154:6): [True: 1, False: 0]
  |  Branch (154:23): [True: 0, False: 0]
  ------------------
  155|      1|    return Curl_ssl_random(data, rnd, num);
  156|      0|#endif
  157|       |
  158|      0|  while(num) {
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|    unsigned int r;
  160|      0|    size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int);
  ------------------
  |  Branch (160:19): [True: 0, False: 0]
  ------------------
  161|       |
  162|      0|    result = randit(data, &r, env_override);
  163|      0|    if(result)
  ------------------
  |  Branch (163:8): [True: 0, False: 0]
  ------------------
  164|      0|      return result;
  165|       |
  166|      0|    while(left) {
  ------------------
  |  Branch (166:11): [True: 0, False: 0]
  ------------------
  167|      0|      *rnd++ = (unsigned char)(r & 0xFF);
  168|      0|      r >>= 8;
  169|      0|      --num;
  170|      0|      --left;
  171|      0|    }
  172|      0|  }
  173|       |
  174|      0|  return result;
  175|      0|}

Curl_req_init:
   38|     54|{
   39|     54|  memset(req, 0, sizeof(*req));
   40|     54|}
Curl_req_free:
  175|     54|{
  176|     54|  curlx_safefree(req->newurl);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  177|     54|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  178|     54|#ifndef CURL_DISABLE_PROXY
  179|     54|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  180|     54|#endif
  181|     54|  if(req->sendbuf_init)
  ------------------
  |  Branch (181:6): [True: 0, False: 54]
  ------------------
  182|      0|    Curl_bufq_free(&req->sendbuf);
  183|     54|  Curl_client_cleanup(data);
  184|     54|}

Curl_client_cleanup:
   66|     54|{
   67|     54|  cl_reset_reader(data);
   68|     54|  cl_reset_writer(data);
   69|       |
   70|     54|  data->req.bytecount = 0;
   71|     54|  data->req.headerline = 0;
   72|     54|}
sendf.c:cl_reset_reader:
   54|     54|{
   55|     54|  struct Curl_creader *reader = data->req.reader.stack;
   56|     54|  data->req.reader_started = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
   57|     54|  while(reader) {
  ------------------
  |  Branch (57:9): [True: 0, False: 54]
  ------------------
   58|      0|    data->req.reader.stack = reader->next;
   59|      0|    reader->crt->do_close(data, reader);
   60|      0|    curlx_free(reader);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   61|      0|    reader = data->req.reader.stack;
   62|      0|  }
   63|     54|}
sendf.c:cl_reset_writer:
   42|     54|{
   43|     54|  struct Curl_cwriter *writer = data->req.writer.stack;
   44|     54|  while(writer) {
  ------------------
  |  Branch (44:9): [True: 0, False: 54]
  ------------------
   45|      0|    data->req.writer.stack = writer->next;
   46|      0|    writer->cwt->do_close(data, writer);
   47|      0|    curlx_free(writer);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   48|      0|    writer = data->req.writer.stack;
   49|      0|  }
   50|       |  data->req.writer.paused = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
   51|     54|}

Curl_setopt_SSLVERSION:
  291|    108|{
  292|       |  /*
  293|       |   * Set explicit SSL version to try to connect with, as some SSL
  294|       |   * implementations are lame.
  295|       |   */
  296|    108|  {
  297|    108|    long version, version_max;
  298|    108|    struct ssl_easy_config *sslc = &data->set.ssl;
  299|    108|#ifndef CURL_DISABLE_PROXY
  300|    108|    if(option != CURLOPT_SSLVERSION)
  ------------------
  |  Branch (300:8): [True: 54, False: 54]
  ------------------
  301|     54|      sslc = &data->set.proxy_ssl;
  302|       |#else
  303|       |    (void)option; /* unused */
  304|       |#endif
  305|    108|    version = C_SSLVERSION_VALUE(arg);
  ------------------
  |  |  170|    108|#define C_SSLVERSION_VALUE(x)     ((x) & 0xffff)
  ------------------
  306|    108|    version_max = (long)C_SSLVERSION_MAX_VALUE(arg);
  ------------------
  |  |  171|    108|#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)(x) & 0xffff0000)
  ------------------
  307|       |
  308|    108|    if(version < CURL_SSLVERSION_DEFAULT ||
  ------------------
  |  | 2394|    216|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (308:8): [True: 0, False: 108]
  ------------------
  309|    108|       version == CURL_SSLVERSION_SSLv2 ||
  ------------------
  |  | 2396|    216|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (309:8): [True: 0, False: 108]
  ------------------
  310|    108|       version == CURL_SSLVERSION_SSLv3 ||
  ------------------
  |  | 2397|    216|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (310:8): [True: 0, False: 108]
  ------------------
  311|    108|       version >= CURL_SSLVERSION_LAST ||
  ------------------
  |  | 2403|    216|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (311:8): [True: 0, False: 108]
  ------------------
  312|    108|       version_max < CURL_SSLVERSION_MAX_NONE ||
  ------------------
  |  | 2405|    216|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (312:8): [True: 0, False: 108]
  ------------------
  313|    108|       version_max >= CURL_SSLVERSION_MAX_LAST)
  ------------------
  |  | 2413|    108|#define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
  |  |  ------------------
  |  |  |  | 2403|    108|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  |  |  ------------------
  ------------------
  |  Branch (313:8): [True: 0, False: 108]
  ------------------
  314|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  315|    108|    if(version == CURL_SSLVERSION_DEFAULT)
  ------------------
  |  | 2394|    108|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (315:8): [True: 108, False: 0]
  ------------------
  316|    108|      version = CURL_SSLVERSION_TLSv1_2;
  ------------------
  |  | 2400|    108|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  317|       |
  318|    108|    sslc->version = (unsigned char)version;
  319|    108|    sslc->version_max = (unsigned int)version_max;
  320|    108|  }
  321|      0|  return CURLE_OK;
  322|    108|}

easy.c:sigpipe_ignore:
   49|     54|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|     54|  ig->no_signal = data->set.no_signal;
   53|     54|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 54, False: 0]
  ------------------
   54|     54|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|     54|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|     54|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|     54|    action.sa_handler = SIG_IGN;
   60|     54|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|     54|    action.sa_flags &= ~SA_SIGINFO;
   63|     54|#endif
   64|     54|    sigaction(SIGPIPE, &action, NULL);
   65|     54|  }
   66|     54|}
easy.c:sigpipe_restore:
   74|     54|{
   75|     54|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 54, False: 0]
  ------------------
   76|       |    /* restore the outside state */
   77|     54|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|     54|}

curl_slist_free_all:
  126|     54|{
  127|     54|  struct curl_slist *next;
  128|     54|  struct curl_slist *item;
  129|       |
  130|     54|  if(!list)
  ------------------
  |  Branch (130:6): [True: 54, False: 0]
  ------------------
  131|     54|    return;
  132|       |
  133|      0|  item = list;
  134|      0|  do {
  135|      0|    next = item->next;
  136|      0|    curlx_safefree(item->data);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  137|      0|    curlx_free(item);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  138|      0|    item = next;
  139|      0|  } while(next);
  ------------------
  |  Branch (139:11): [True: 0, False: 0]
  ------------------
  140|      0|}

Curl_strntolower:
   93|  1.88k|{
   94|  1.88k|  if(n < 1)
  ------------------
  |  Branch (94:6): [True: 0, False: 1.88k]
  ------------------
   95|      0|    return;
   96|       |
   97|  3.21k|  do {
   98|  3.21k|    *dest++ = Curl_raw_tolower(*src);
   99|  3.21k|  } while(*src++ && --n);
  ------------------
  |  Branch (99:11): [True: 2.95k, False: 254]
  |  Branch (99:21): [True: 1.32k, False: 1.63k]
  ------------------
  100|  1.88k|}

strcase.c:Curl_raw_tolower:
   43|  3.21k|{
   44|  3.21k|  return (char)Curl_tolowermap[(unsigned char)in];
   45|  3.21k|}
strequal.c:Curl_raw_toupper:
   38|  12.5k|{
   39|  12.5k|  return (char)Curl_touppermap[(unsigned char)in];
   40|  12.5k|}

curl_strnequal:
   88|  5.67k|{
   89|  5.67k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 5.67k, False: 0]
  |  Branch (89:12): [True: 5.67k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|  5.67k|    return ncasecompare(s1, s2, n);
   92|       |
   93|       |  /* if both pointers are NULL then treat them as equal if max is non-zero */
   94|      0|  return NULL == s1 && NULL == s2 && n;
  ------------------
  |  Branch (94:10): [True: 0, False: 0]
  |  Branch (94:24): [True: 0, False: 0]
  |  Branch (94:38): [True: 0, False: 0]
  ------------------
   95|  5.67k|}
strequal.c:ncasecompare:
   52|  5.67k|{
   53|  8.28k|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 5.93k, False: 2.34k]
  |  Branch (53:19): [True: 5.92k, False: 8]
  ------------------
   54|  5.92k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 3.31k, False: 2.61k]
  ------------------
   55|  3.31k|      return 0;
   56|  2.61k|    max--;
   57|  2.61k|    first++;
   58|  2.61k|    second++;
   59|  2.61k|  }
   60|  2.35k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 2.00k, False: 349]
  ------------------
   61|  2.00k|    return 1; /* they are equal this far */
   62|       |
   63|    349|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|  2.35k|}

Curl_u8_strset_init:
   64|    162|{
   65|       |#if defined(__GNUC__) && __GNUC__ >= 13
   66|       |#pragma GCC diagnostic push
   67|       |#pragma GCC diagnostic ignored "-Warray-bounds"
   68|       |#endif
   69|    162|  memset(set, 0, sizeof(*set));
   70|       |#if defined(__GNUC__) && __GNUC__ >= 13
   71|       |#pragma GCC diagnostic pop
   72|       |#endif
   73|    162|  set->data = set->sdata;
   74|    162|  set->ids = set->sids;
   75|    162|  set->psl = set->spsl;
   76|    162|  set->slotbits = CURL_U8_STRSET_START_BITS;
  ------------------
  |  |   39|    162|#define CURL_U8_STRSET_START_BITS   3
  ------------------
   77|    162|  set->slotmask = CURL_U8_SLOT_MASK(set->slotbits);
  ------------------
  |  |   40|    162|#define CURL_U8_SLOT_MASK(i)             (uint8_t)((1U << (i)) - 1)
  ------------------
   78|    162|  set->count = 0;
   79|    162|#ifdef DEBUGBUILD
   80|    162|  set->init = CURL_U8_STRSET_MAGIC;
  ------------------
  |  |   31|    162|#define CURL_U8_STRSET_MAGIC 0x7117e783
  ------------------
   81|    162|#endif
   82|    162|}
Curl_u8_strset_clear:
   85|     54|{
   86|     54|  uint16_t i;
   87|     54|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 54]
  |  Branch (87:3): [True: 54, False: 0]
  ------------------
   88|    486|  for(i = 0; i < CURL_U8_STRSET_SLOT_CNT(set); ++i)
  ------------------
  |  |   41|    486|#define CURL_U8_STRSET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|    486|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:53): [True: 486, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (88:14): [True: 432, False: 54]
  ------------------
   89|    432|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1359|    486|  do {                      \
  |  | 1360|    432|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    432|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    432|    (ptr) = NULL;           \
  |  | 1362|    432|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 432]
  |  |  ------------------
  ------------------
   90|       |
   91|     54|  if(set->data != set->sdata)
  ------------------
  |  Branch (91:6): [True: 0, False: 54]
  ------------------
   92|       |    curlx_safefree(set->data);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   93|     54|  Curl_u8_strset_init(set);
   94|     54|}
Curl_u8_strset_get:
  199|    108|{
  200|    108|  uint8_t i;
  201|    108|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|    108|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 108]
  |  Branch (201:3): [True: 108, False: 0]
  ------------------
  202|    108|  if(u8_strset_get_index(set, id, &i))
  ------------------
  |  Branch (202:6): [True: 0, False: 108]
  ------------------
  203|      0|    return set->data[i];
  204|    108|  return NULL;
  205|    108|}
Curl_u8_strset_unset0:
  295|    270|{
  296|       |  u8_strset_unset(set, id, TRUE);
  ------------------
  |  |  986|    270|#define TRUE true
  ------------------
  297|    270|}
u8_strset.c:u8_strset_get_index:
  169|    378|{
  170|    378|  uint8_t i = CURL_U8_STRSET_SLOT_IDX(set, id);
  ------------------
  |  |   38|    378|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  171|    378|  uint8_t psl = 0;
  172|    378|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (172:9): [True: 0, False: 378]
  |  Branch (172:25): [True: 0, False: 0]
  ------------------
  173|      0|    if(set->ids[i] == id) {
  ------------------
  |  Branch (173:8): [True: 0, False: 0]
  ------------------
  174|      0|      *pindex = i;
  175|       |#if CURL_U8_STRSET_DEBUG
  176|       |      curl_mfprintf(stderr, "u8_strset_index %d=%s\n", id, set->data[i]);
  177|       |#endif
  178|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  179|      0|    }
  180|      0|    i = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  181|      0|    ++psl;
  182|      0|  }
  183|       |#if CURL_U8_STRSET_DEBUG
  184|       |  curl_mfprintf(stderr, "u8_strset_index %d not found\n", id);
  185|       |#endif
  186|    378|  *pindex = 0;
  187|       |  return FALSE;
  ------------------
  |  |  989|    378|#define FALSE false
  ------------------
  188|    378|}
u8_strset.c:u8_strset_unset:
  264|    270|{
  265|    270|  uint8_t i, j;
  266|       |
  267|    270|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|    270|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:3): [True: 0, False: 270]
  |  Branch (267:3): [True: 270, False: 0]
  ------------------
  268|    270|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (268:6): [True: 0, False: 270]
  ------------------
  269|       |    /* `id` is in set */
  270|      0|    if(zero)
  ------------------
  |  Branch (270:8): [True: 0, False: 0]
  ------------------
  271|      0|      curlx_strzero(set->data[i]);
  272|      0|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  273|      0|    set->ids[i] = set->psl[i] = 0;
  274|      0|    --set->count;
  275|      0|    j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  276|       |    /* shift all entries with positive psl "down" */
  277|      0|    while(set->data[j] && set->psl[j]) {
  ------------------
  |  Branch (277:11): [True: 0, False: 0]
  |  Branch (277:27): [True: 0, False: 0]
  ------------------
  278|      0|      set->data[i] = set->data[j];
  279|      0|      set->ids[i] = set->ids[j];
  280|      0|      set->psl[i] = (uint8_t)(set->psl[j] - 1);
  281|      0|      set->data[j] = NULL;
  282|      0|      set->ids[j] = set->psl[j] = 0;
  283|      0|      i = j;
  284|      0|      j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|      0|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  285|      0|    }
  286|      0|  }
  287|    270|}

Curl_uint32_spbset_init:
   34|  1.04k|{
   35|  1.04k|  memset(bset, 0, sizeof(*bset));
   36|  1.04k|#ifdef DEBUGBUILD
   37|  1.04k|  bset->init = CURL_UINT32_SPBSET_MAGIC;
  ------------------
  |  |   30|  1.04k|#define CURL_UINT32_SPBSET_MAGIC  0x70737362
  ------------------
   38|  1.04k|#endif
   39|  1.04k|}
uint32_spbset_clear:
   47|  1.68k|{
   48|  1.68k|  struct uint32_spbset_chunk *next, *chunk;
   49|       |
   50|  4.01k|  for(chunk = bset->head.next; chunk; chunk = next) {
  ------------------
  |  Branch (50:32): [True: 2.32k, False: 1.68k]
  ------------------
   51|  2.32k|    next = chunk->next;
   52|  2.32k|    curlx_free(chunk);
  ------------------
  |  | 1503|  2.32k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   53|  2.32k|  }
   54|  1.68k|  memset(&bset->head, 0, sizeof(bset->head));
   55|  1.68k|}
Curl_uint32_spbset_destroy:
   58|  1.04k|{
   59|  1.04k|  DEBUGASSERT(bset->init == CURL_UINT32_SPBSET_MAGIC);
  ------------------
  |  | 1016|  1.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 1.04k]
  |  Branch (59:3): [True: 1.04k, False: 0]
  ------------------
   60|  1.04k|  uint32_spbset_clear(bset);
   61|  1.04k|}
Curl_uint32_spbset_count:
   64|    551|{
   65|    551|  struct uint32_spbset_chunk *chunk;
   66|    551|  uint32_t i, n = 0;
   67|       |
   68|  2.12k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (68:28): [True: 1.57k, False: 551]
  ------------------
   69|  7.86k|    for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  7.86k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (69:16): [True: 6.29k, False: 1.57k]
  ------------------
   70|  6.29k|      if(chunk->slots[i])
  ------------------
  |  Branch (70:10): [True: 1.42k, False: 4.86k]
  ------------------
   71|  1.42k|        n += CURL_POPCOUNT64(chunk->slots[i]);
  ------------------
  |  |  347|  1.42k|#      define CURL_POPCOUNT64(x)       __builtin_popcountl(x)
  ------------------
   72|  6.29k|    }
   73|  1.57k|  }
   74|    551|  return n;
   75|    551|}
Curl_uint32_spbset_add:
  182|  14.9k|{
  183|  14.9k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, TRUE);
  ------------------
  |  |  986|  14.9k|#define TRUE true
  ------------------
  184|  14.9k|  if(!chunk)
  ------------------
  |  Branch (184:6): [True: 0, False: 14.9k]
  ------------------
  185|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  186|       |
  187|  14.9k|  DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|  14.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (187:3): [True: 0, False: 14.9k]
  |  Branch (187:3): [True: 14.9k, False: 0]
  ------------------
  188|  14.9k|  i -= chunk->offset;
  189|  14.9k|  DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|  14.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (189:3): [True: 0, False: 14.9k]
  |  Branch (189:3): [True: 14.9k, False: 0]
  ------------------
  190|  14.9k|  chunk->slots[(i / 64)] |= ((uint64_t)1 << (i % 64));
  191|       |  return TRUE;
  ------------------
  |  |  986|  14.9k|#define TRUE true
  ------------------
  192|  14.9k|}
Curl_uint32_spbset_remove:
  195|  2.02k|{
  196|  2.02k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, FALSE);
  ------------------
  |  |  989|  2.02k|#define FALSE false
  ------------------
  197|  2.02k|  if(chunk) {
  ------------------
  |  Branch (197:6): [True: 791, False: 1.23k]
  ------------------
  198|    791|    DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|    791|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (198:5): [True: 0, False: 791]
  |  Branch (198:5): [True: 791, False: 0]
  ------------------
  199|    791|    i -= chunk->offset;
  200|    791|    DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|    791|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (200:5): [True: 0, False: 791]
  |  Branch (200:5): [True: 791, False: 0]
  ------------------
  201|    791|    chunk->slots[(i / 64)] &= ~((uint64_t)1 << (i % 64));
  202|    791|  }
  203|  2.02k|}
Curl_uint32_spbset_contains:
  206|  1.72k|{
  207|  1.72k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, FALSE);
  ------------------
  |  |  989|  1.72k|#define FALSE false
  ------------------
  208|  1.72k|  if(chunk) {
  ------------------
  |  Branch (208:6): [True: 298, False: 1.42k]
  ------------------
  209|    298|    DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|    298|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:5): [True: 0, False: 298]
  |  Branch (209:5): [True: 298, False: 0]
  ------------------
  210|    298|    i -= chunk->offset;
  211|    298|    DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|    298|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (211:5): [True: 0, False: 298]
  |  Branch (211:5): [True: 298, False: 0]
  ------------------
  212|    298|    return (chunk->slots[i / 64] & ((uint64_t)1 << (i % 64))) != 0;
  213|    298|  }
  214|  1.42k|  return FALSE;
  ------------------
  |  |  989|  1.42k|#define FALSE false
  ------------------
  215|  1.72k|}
Curl_uint32_spbset_first:
  218|    744|{
  219|    744|  struct uint32_spbset_chunk *chunk;
  220|    744|  uint32_t i;
  221|       |
  222|  1.30k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (222:28): [True: 960, False: 345]
  ------------------
  223|  3.75k|    for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  3.75k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (223:16): [True: 3.19k, False: 561]
  ------------------
  224|  3.19k|      if(chunk->slots[i]) {
  ------------------
  |  Branch (224:10): [True: 399, False: 2.79k]
  ------------------
  225|    399|        *pfirst = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i]));
  ------------------
  |  |  348|    399|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  226|    399|        return TRUE;
  ------------------
  |  |  986|    399|#define TRUE true
  ------------------
  227|    399|      }
  228|  3.19k|    }
  229|    960|  }
  230|    345|  *pfirst = 0; /* give it a defined value even if it should not be used */
  231|       |  return FALSE;
  ------------------
  |  |  989|    345|#define FALSE false
  ------------------
  232|    744|}
Curl_uint32_spbset_next:
  277|  2.85k|{
  278|  2.85k|  struct uint32_spbset_chunk *chunk;
  279|  2.85k|  uint32_t last_offset;
  280|       |
  281|  2.85k|  ++last; /* look for the next higher number */
  282|  2.85k|  last_offset = (last & ~CURL_UINT32_SPBSET_CH_MASK);
  ------------------
  |  |   38|  2.85k|#define CURL_UINT32_SPBSET_CH_MASK   ((CURL_UINT32_SPBSET_CH_SLOTS * 64) - 1)
  |  |  ------------------
  |  |  |  |   37|  2.85k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  |  |  ------------------
  ------------------
  283|       |
  284|  4.83k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (284:28): [True: 4.09k, False: 738]
  ------------------
  285|  4.09k|    if(chunk->offset >= last_offset) {
  ------------------
  |  Branch (285:8): [True: 2.11k, False: 1.98k]
  ------------------
  286|  2.11k|      break;
  287|  2.11k|    }
  288|  4.09k|  }
  289|       |
  290|  2.85k|  if(chunk && (chunk->offset == last_offset)) {
  ------------------
  |  Branch (290:6): [True: 2.11k, False: 738]
  |  Branch (290:15): [True: 1.01k, False: 1.09k]
  ------------------
  291|       |    /* is there a number higher than last in this chunk? */
  292|  1.01k|    if(uint32_spbset_chunk_next(chunk, last, pnext))
  ------------------
  |  Branch (292:8): [True: 732, False: 286]
  ------------------
  293|    732|      return TRUE;
  ------------------
  |  |  986|    732|#define TRUE true
  ------------------
  294|       |    /* not in this chunk */
  295|    286|    chunk = chunk->next;
  296|    286|  }
  297|       |  /* look for the first in the "higher" chunks, if there are any. */
  298|  2.56k|  while(chunk) {
  ------------------
  |  Branch (298:9): [True: 1.34k, False: 1.22k]
  ------------------
  299|  1.34k|    if(uint32_spbset_chunk_first(chunk, pnext))
  ------------------
  |  Branch (299:8): [True: 892, False: 449]
  ------------------
  300|    892|      return TRUE;
  ------------------
  |  |  986|    892|#define TRUE true
  ------------------
  301|    449|    chunk = chunk->next;
  302|    449|  }
  303|  1.22k|  *pnext = UINT32_MAX;
  304|       |  return FALSE;
  ------------------
  |  |  989|  1.22k|#define FALSE false
  ------------------
  305|  2.12k|}
uint-spbset.c:uint32_spbset_get_chunk:
  146|  18.7k|{
  147|  18.7k|  struct uint32_spbset_chunk *chunk;
  148|  18.7k|  uint32_t i_offset = (i & ~CURL_UINT32_SPBSET_CH_MASK);
  ------------------
  |  |   38|  18.7k|#define CURL_UINT32_SPBSET_CH_MASK   ((CURL_UINT32_SPBSET_CH_SLOTS * 64) - 1)
  |  |  ------------------
  |  |  |  |   37|  18.7k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  |  |  ------------------
  ------------------
  149|       |
  150|  18.7k|  if(!bset)
  ------------------
  |  Branch (150:6): [True: 0, False: 18.7k]
  ------------------
  151|      0|    return NULL;
  152|       |
  153|  46.2k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (153:28): [True: 42.7k, False: 3.44k]
  ------------------
  154|  42.7k|    if(chunk->offset == i_offset)
  ------------------
  |  Branch (154:8): [True: 12.3k, False: 30.3k]
  ------------------
  155|  12.3k|      return chunk;
  156|  30.3k|    else if(chunk->offset > i_offset)
  ------------------
  |  Branch (156:13): [True: 2.87k, False: 27.5k]
  ------------------
  157|  2.87k|      break; /* need new chunk here */
  158|  42.7k|  }
  159|  6.32k|  if(!grow) /* just a check if the chunk exists */
  ------------------
  |  Branch (159:6): [True: 2.65k, False: 3.66k]
  ------------------
  160|  2.65k|    return NULL;
  161|       |
  162|       |  /* Is there an empty chunk to reuse? */
  163|  3.66k|  chunk = uint32_spbset_unlink_empty(bset, i_offset);
  164|  3.66k|  if(chunk) {
  ------------------
  |  Branch (164:6): [True: 1.33k, False: 2.32k]
  ------------------
  165|  1.33k|    chunk->offset = i_offset;
  166|  1.33k|    if(chunk == &bset->head) /* head chunk is empty, stayed linked */
  ------------------
  |  Branch (166:8): [True: 1.20k, False: 137]
  ------------------
  167|  1.20k|      return &bset->head;
  168|       |    /* was really unlinked, need to insert below */
  169|  1.33k|  }
  170|  2.32k|  else {
  171|       |    /* need a new one */
  172|  2.32k|    chunk = curlx_calloc(1, sizeof(*chunk));
  ------------------
  |  | 1500|  2.32k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  173|  2.32k|    if(!chunk)
  ------------------
  |  Branch (173:8): [True: 0, False: 2.32k]
  ------------------
  174|      0|      return NULL;
  175|  2.32k|    chunk->offset = i_offset;
  176|  2.32k|  }
  177|       |
  178|  2.46k|  return uint32_spbset_insert_chunk(bset, chunk);
  179|  3.66k|}
uint-spbset.c:uint32_spbset_unlink_empty:
   89|  3.66k|{
   90|  3.66k|  struct uint32_spbset_chunk *chunk, **panchor = NULL;
   91|  44.1k|  for(chunk = &bset->head; chunk;
  ------------------
  |  Branch (91:28): [True: 41.8k, False: 2.32k]
  ------------------
   92|  41.8k|      panchor = &chunk->next, chunk = chunk->next) {
   93|  41.8k|    if(uint32_spbset_empty_chunk(chunk))
  ------------------
  |  Branch (93:8): [True: 1.33k, False: 40.5k]
  ------------------
   94|  1.33k|      break;
   95|  41.8k|  }
   96|  3.66k|  if(chunk) {
  ------------------
  |  Branch (96:6): [True: 1.33k, False: 2.32k]
  ------------------
   97|  1.33k|    if(chunk == &bset->head) { /* head chunk is empty */
  ------------------
  |  Branch (97:8): [True: 1.27k, False: 68]
  ------------------
   98|  1.27k|      if(!bset->head.next || (for_offset < bset->head.next->offset)) {
  ------------------
  |  Branch (98:10): [True: 1.08k, False: 187]
  |  Branch (98:30): [True: 118, False: 69]
  ------------------
   99|  1.20k|        return &bset->head;
  100|  1.20k|      }
  101|       |      /* swap head and next, unlink */
  102|     69|      chunk = bset->head.next;
  103|     69|      memcpy(&bset->head, chunk, sizeof(bset->head));
  104|     69|      memset(chunk, 0, sizeof(*chunk));
  105|     69|    }
  106|     68|    else {
  107|     68|      *panchor = chunk->next; /* unlink */
  108|     68|      memset(chunk, 0, sizeof(*chunk));
  109|     68|    }
  110|  1.33k|  }
  111|  2.46k|  return chunk;
  112|  3.66k|}
uint-spbset.c:uint32_spbset_empty_chunk:
   78|  41.8k|{
   79|  41.8k|  uint32_t i;
   80|  70.1k|  for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  70.1k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (80:14): [True: 68.8k, False: 1.33k]
  ------------------
   81|  68.8k|    if(chunk->slots[i])
  ------------------
  |  Branch (81:8): [True: 40.5k, False: 28.3k]
  ------------------
   82|  40.5k|      return FALSE;
  ------------------
  |  |  989|  40.5k|#define FALSE false
  ------------------
   83|  68.8k|  }
   84|  1.33k|  return TRUE;
  ------------------
  |  |  986|  1.33k|#define TRUE true
  ------------------
   85|  41.8k|}
uint-spbset.c:uint32_spbset_insert_chunk:
  116|  2.46k|{
  117|  2.46k|  struct uint32_spbset_chunk *chunk, **panchor;
  118|       |
  119|       |  /* insert nchunk into set's ordered chunk list */
  120|  2.46k|  if(nchunk->offset < bset->head.offset) {
  ------------------
  |  Branch (120:6): [True: 631, False: 1.83k]
  ------------------
  121|       |    /* swap chunk and head */
  122|    631|    uint32_t offset = nchunk->offset;
  123|    631|    memcpy(nchunk, &bset->head, sizeof(*nchunk));
  124|    631|    memset(&bset->head, 0, sizeof(bset->head));
  125|    631|    bset->head.next = nchunk;
  126|    631|    bset->head.offset = offset;
  127|    631|    return &bset->head;
  128|    631|  }
  129|  1.83k|  DEBUGASSERT(nchunk->offset > bset->head.offset);
  ------------------
  |  | 1016|  1.83k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 0, False: 1.83k]
  |  Branch (129:3): [True: 1.83k, False: 0]
  ------------------
  130|  1.83k|  panchor = &bset->head.next;
  131|  20.5k|  for(chunk = *panchor; chunk;
  ------------------
  |  Branch (131:25): [True: 19.8k, False: 679]
  ------------------
  132|  19.8k|      panchor = &chunk->next, chunk = chunk->next) {
  133|  19.8k|    if(chunk->offset > nchunk->offset) { /* insert before this chunk */
  ------------------
  |  Branch (133:8): [True: 1.15k, False: 18.6k]
  ------------------
  134|  1.15k|      nchunk->next = chunk;
  135|  1.15k|      *panchor = nchunk;
  136|  1.15k|      return nchunk;
  137|  1.15k|    }
  138|  19.8k|  }
  139|       |  /* no chunk with larger offset, append */
  140|    679|  *panchor = nchunk;
  141|    679|  return nchunk;
  142|  1.83k|}
uint-spbset.c:uint32_spbset_chunk_next:
  251|  1.01k|{
  252|  1.01k|  if(chunk->offset <= last) {
  ------------------
  |  Branch (252:6): [True: 1.01k, False: 0]
  ------------------
  253|  1.01k|    uint64_t x;
  254|  1.01k|    uint32_t i = ((last - chunk->offset) / 64);
  255|  1.01k|    if(i < CURL_UINT32_SPBSET_CH_SLOTS) {
  ------------------
  |  |   37|  1.01k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (255:8): [True: 1.01k, False: 0]
  ------------------
  256|  1.01k|      x = (chunk->slots[i] >> (last % 64));
  257|  1.01k|      if(x) {
  ------------------
  |  Branch (257:10): [True: 535, False: 483]
  ------------------
  258|       |        /* more bits set, next is `last` + trailing 0s of the shifted slot */
  259|    535|        *pnext = last + CURL_CTZ64(x);
  ------------------
  |  |  348|    535|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  260|    535|        return TRUE;
  ------------------
  |  |  986|    535|#define TRUE true
  ------------------
  261|    535|      }
  262|       |      /* no more bits set in the last slot, scan forward */
  263|  1.35k|      for(i = i + 1; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  1.35k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (263:22): [True: 1.06k, False: 286]
  ------------------
  264|  1.06k|        if(chunk->slots[i]) {
  ------------------
  |  Branch (264:12): [True: 197, False: 870]
  ------------------
  265|    197|          *pnext = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i]));
  ------------------
  |  |  348|    197|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  266|    197|          return TRUE;
  ------------------
  |  |  986|    197|#define TRUE true
  ------------------
  267|    197|        }
  268|  1.06k|      }
  269|    483|    }
  270|  1.01k|  }
  271|    286|  *pnext = UINT32_MAX;
  272|       |  return FALSE;
  ------------------
  |  |  989|    286|#define FALSE false
  ------------------
  273|  1.01k|}
uint-spbset.c:uint32_spbset_chunk_first:
  236|  1.34k|{
  237|  1.34k|  uint32_t i;
  238|  4.17k|  for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  4.17k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (238:14): [True: 3.72k, False: 449]
  ------------------
  239|  3.72k|    if(chunk->slots[i]) {
  ------------------
  |  Branch (239:8): [True: 892, False: 2.83k]
  ------------------
  240|    892|      *pfirst = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i]));
  ------------------
  |  |  348|    892|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  241|    892|      return TRUE;
  ------------------
  |  |  986|    892|#define TRUE true
  ------------------
  242|    892|    }
  243|  3.72k|  }
  244|    449|  *pfirst = UINT32_MAX; /* a value we cannot store */
  245|       |  return FALSE;
  ------------------
  |  |  989|    449|#define FALSE false
  ------------------
  246|  1.34k|}

Curl_freeset:
  148|     54|{
  149|       |  /* Free all dynamic strings stored in the data->set substructure. */
  150|     54|  enum dupblob j;
  151|       |
  152|     54|  CURL_EASY_STR_CLEAR0(data, STRING_PASSWORD);
  ------------------
  |  | 1214|     54|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  153|     54|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD);
  ------------------
  |  | 1214|     54|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  154|     54|  CURL_EASY_STR_CLEAR0(data, STRING_BEARER);
  ------------------
  |  | 1214|     54|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  155|     54|#ifndef CURL_DISABLE_PROXY
  156|     54|  CURL_EASY_STR_CLEAR0(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1214|     54|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  157|     54|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD_PROXY);
  ------------------
  |  | 1214|     54|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  158|     54|#endif
  159|     54|  Curl_u8_strset_clear(&data->set.strings);
  160|     54|  curlx_safefree(data->set.a.str_copypostfields);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  161|       |
  162|    486|  for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
  ------------------
  |  Branch (162:28): [True: 432, False: 54]
  ------------------
  163|    432|    curlx_safefree(data->set.a.blobs[j]);
  ------------------
  |  | 1359|    432|  do {                      \
  |  | 1360|    432|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    432|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    432|    (ptr) = NULL;           \
  |  | 1362|    432|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 432]
  |  |  ------------------
  ------------------
  164|    432|  }
  165|       |
  166|     54|  Curl_frzn_strs_safefree(&data->set.a.resolve);
  167|     54|  Curl_frzn_strs_safefree(&data->set.a.connect_to);
  168|     54|#ifndef CURL_DISABLE_HSTS
  169|     54|  Curl_frzn_strs_safefree(&data->set.a.hsts_files);
  170|     54|#endif
  171|     54|#ifndef CURL_DISABLE_TELNET
  172|     54|  Curl_frzn_strs_safefree(&data->set.a.telnet_options);
  173|     54|#endif
  174|     54|#ifndef CURL_DISABLE_HTTP
  175|     54|  Curl_frzn_strs_safefree(&data->set.a.http200aliases);
  176|     54|#endif
  177|     54|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
  178|     54|  Curl_frzn_strs_safefree(&data->set.a.quote);
  179|     54|  Curl_frzn_strs_safefree(&data->set.a.postquote);
  180|     54|  Curl_frzn_strs_safefree(&data->set.a.prequote);
  181|     54|#endif
  182|     54|#ifndef CURL_DISABLE_SMTP
  183|     54|  Curl_frzn_strs_safefree(&data->set.a.mail_rcpt);
  184|     54|#endif
  185|       |
  186|     54|  Curl_bufref_free(&data->state.referer);
  187|     54|  Curl_bufref_free(&data->state.url);
  188|       |
  189|     54|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
  190|     54|  Curl_mime_cleanpart(data->set.a.mimepostp);
  191|     54|  curlx_safefree(data->set.a.mimepostp);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  192|     54|#endif
  193|       |
  194|     54|#ifndef CURL_DISABLE_COOKIES
  195|     54|  curl_slist_free_all(data->state.cookielist);
  196|       |  data->state.cookielist = NULL;
  197|     54|#endif
  198|     54|}
Curl_close:
  218|     54|{
  219|     54|  struct Curl_easy *data;
  220|       |
  221|     54|  if(!datap || !*datap)
  ------------------
  |  Branch (221:6): [True: 0, False: 54]
  |  Branch (221:16): [True: 0, False: 54]
  ------------------
  222|      0|    return CURLE_OK;
  223|       |
  224|     54|  data = *datap;
  225|     54|  *datap = NULL;
  226|       |
  227|     54|  if(!data->state.internal && data->multi) {
  ------------------
  |  Branch (227:6): [True: 54, False: 0]
  |  Branch (227:31): [True: 0, False: 54]
  ------------------
  228|       |    /* This handle is still part of a multi handle, take care of this first
  229|       |       and detach this handle from there.
  230|       |       This detaches the connection. */
  231|      0|    Curl_multi_remove_handle(data->multi, data);
  232|      0|  }
  233|     54|  else {
  234|       |    /* Detach connection if any is left. This should not be normal, but can be
  235|       |       the case for example with CONNECT_ONLY + recv/send (test 556) */
  236|     54|    Curl_detach_connection(data);
  237|     54|    if(!data->state.internal && data->multi_easy) {
  ------------------
  |  Branch (237:8): [True: 54, False: 0]
  |  Branch (237:33): [True: 0, False: 54]
  ------------------
  238|       |      /* when curl_easy_perform() is used, it creates its own multi handle to
  239|       |         use and this is the one */
  240|      0|      curl_multi_cleanup(data->multi_easy);
  241|      0|      data->multi_easy = NULL;
  242|      0|    }
  243|     54|  }
  244|     54|  DEBUGASSERT(!data->conn || data->state.internal);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (244:3): [True: 54, False: 0]
  |  Branch (244:3): [True: 0, False: 0]
  |  Branch (244:3): [True: 54, False: 0]
  |  Branch (244:3): [True: 0, False: 0]
  ------------------
  245|       |
  246|     54|  Curl_expire_clear_all(data); /* shut off any timers left */
  247|       |
  248|     54|  if(data->state.rangestringalloc)
  ------------------
  |  Branch (248:6): [True: 0, False: 54]
  ------------------
  249|      0|    curlx_free(data->state.range);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  250|       |
  251|       |  /* release any resolve information this transfer kept */
  252|     54|  Curl_resolv_destroy_all(data);
  253|       |
  254|     54|  data->set.verbose = FALSE; /* no more calls to DEBUGFUNCTION */
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  255|     54|  data->magic = 0; /* force a clear AFTER the possibly enforced removal from
  256|       |                    * the multi handle and async dns shutdown. The multi
  257|       |                    * handle might check the magic and so might any
  258|       |                    * DEBUGFUNCTION invoked for tracing */
  259|       |
  260|       |  /* freed here in case DONE was not called */
  261|     54|  Curl_req_free(&data->req, data);
  262|       |
  263|       |  /* Close down all open SSL info and sessions */
  264|     54|  Curl_ssl_close_all(data);
  265|     54|  Curl_peer_unlink(&data->state.origin);
  266|     54|  Curl_peer_unlink(&data->state.initial_origin);
  267|     54|#ifndef CURL_DISABLE_RTSP
  268|     54|  Curl_peer_unlink(&data->state.rtsp_session_origin);
  269|     54|#endif
  270|     54|  Curl_ssl_free_certinfo(data);
  271|       |
  272|     54|  Curl_bufref_free(&data->state.referer);
  273|       |
  274|     54|  up_free(data);
  275|     54|  curlx_dyn_free(&data->state.headerb);
  276|     54|  Curl_flush_cookies(data, TRUE);
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  277|     54|#ifndef CURL_DISABLE_ALTSVC
  278|     54|  Curl_altsvc_save(data, data->asi, CURL_EASY_STR(data, STRING_ALTSVC));
  ------------------
  |  | 1206|     54|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  279|     54|  Curl_altsvc_cleanup(&data->asi);
  280|     54|#endif
  281|     54|#ifndef CURL_DISABLE_HSTS
  282|     54|  Curl_hsts_save(data, data->hsts, CURL_EASY_STR(data, STRING_HSTS));
  ------------------
  |  | 1206|     54|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  283|     54|  if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (283:6): [True: 54, False: 0]
  |  Branch (283:22): [True: 0, False: 0]
  ------------------
  284|     54|    Curl_hsts_cleanup(&data->hsts);
  285|     54|#endif
  286|     54|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
  287|     54|  Curl_http_auth_cleanup_digest(data);
  288|     54|#endif
  289|     54|  curlx_safefree(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  290|     54|  curlx_safefree(data->info.contenttype);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  291|     54|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  292|     54|  curlx_safefree(data->info.effective_url);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  293|       |
  294|       |  /* No longer a dirty share, if it exists */
  295|     54|  if(Curl_share_easy_unlink(data))
  ------------------
  |  Branch (295:6): [True: 0, False: 54]
  ------------------
  296|     54|    DEBUGASSERT(0);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (296:5): [Folded, False: 0]
  |  Branch (296:5): [Folded, False: 0]
  ------------------
  297|       |
  298|     54|  Curl_hash_destroy(&data->meta_hash);
  299|     54|  Curl_creds_unlink(&data->state.creds);
  300|     54|#ifndef CURL_DISABLE_HTTP
  301|     54|  curlx_safefree(data->state.rangeline);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  302|     54|  curlx_safefree(data->state.http_host);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  303|     54|#endif
  304|     54|#ifndef CURL_DISABLE_RTSP
  305|     54|  curlx_safefree(data->state.session_id);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  306|     54|#endif
  307|     54|#ifndef CURL_DISABLE_COOKIES
  308|     54|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  309|     54|#endif
  310|       |
  311|     54|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
  312|     54|  Curl_mime_cleanpart(data->state.formp);
  313|     54|  curlx_safefree(data->state.formp);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  314|     54|#endif
  315|       |
  316|       |  /* destruct wildcard structures if it is needed */
  317|     54|  Curl_wildcard_dtor(&data->wildcard);
  318|     54|  Curl_freeset(data);
  319|     54|  Curl_headers_cleanup(data);
  320|     54|  Curl_netrc_cleanup(&data->state.netrc);
  321|     54|#ifndef CURL_DISABLE_DIGEST_AUTH
  322|     54|  curlx_free(data->state.envproxy);
  ------------------
  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  323|     54|#endif
  324|     54|  curlx_memzero(data, sizeof(*data));
  325|     54|  curlx_free(data);
  ------------------
  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  326|     54|  return CURLE_OK;
  327|     54|}
Curl_init_userdefined:
  334|     54|{
  335|     54|  struct UserDefined *set = &data->set;
  336|       |
  337|     54|  set->out = stdout;  /* default output to stdout */
  338|     54|  set->in_set = stdin;  /* default input from stdin */
  339|     54|  set->err = stderr;  /* default stderr to stderr */
  340|       |
  341|     54|  Curl_u8_strset_init(&data->set.strings);
  342|       |
  343|     54|#if defined(__clang__) && __clang_major__ >= 16
  344|     54|#pragma clang diagnostic push
  345|     54|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  346|     54|#endif
  347|       |  /* use fwrite as default function to store output */
  348|     54|  set->fwrite_func = (curl_write_callback)fwrite;
  349|       |
  350|       |  /* use fread as default function to read input */
  351|     54|  set->fread_func_set = (curl_read_callback)fread;
  352|     54|#if defined(__clang__) && __clang_major__ >= 16
  353|     54|#pragma clang diagnostic pop
  354|     54|#endif
  355|     54|  set->is_fread_set = 0;
  356|       |
  357|     54|  set->seek_client = ZERO_NULL;
  ------------------
  |  | 1174|     54|#define ZERO_NULL 0
  ------------------
  358|       |
  359|     54|  set->filesize = -1;        /* we do not know the size */
  360|     54|  set->postfieldsize = -1;   /* unknown size */
  361|     54|  set->maxredirs = 30;       /* sensible default */
  362|       |
  363|     54|  set->method = HTTPREQ_GET; /* Default HTTP request */
  364|     54|#ifndef CURL_DISABLE_RTSP
  365|     54|  set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */
  ------------------
  |  |   34|     54|#define RTSPREQ_OPTIONS CURL_RTSPREQ_OPTIONS
  |  |  ------------------
  |  |  |  | 2367|     54|#define CURL_RTSPREQ_OPTIONS       1L
  |  |  ------------------
  ------------------
  366|     54|#endif
  367|     54|#ifndef CURL_DISABLE_FTP
  368|     54|  set->ftp_use_epsv = TRUE;   /* FTP defaults to EPSV operations */
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  369|     54|  set->ftp_use_eprt = TRUE;   /* FTP defaults to EPRT operations */
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  370|     54|  set->ftp_use_pret = FALSE;  /* mainly useful for drftpd servers */
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  371|     54|  set->ftp_filemethod = FTPFILE_MULTICWD;
  372|     54|  set->ftp_skip_ip = TRUE;    /* skip PASV IP by default */
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  373|     54|#endif
  374|     54|  set->dns_cache_timeout_ms = 60000; /* Timeout every 60 seconds by default */
  375|       |
  376|       |  /* Timeout every 24 hours by default */
  377|     54|  set->ssl_ca_cache_timeout = 24 * 60 * 60;
  378|       |
  379|     54|  set->httpauth = CURLAUTH_BASIC;  /* defaults to basic */
  ------------------
  |  |  833|     54|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  380|       |
  381|     54|  Curl_ssl_config_init(&data->set.ssl);
  382|     54|#ifndef CURL_DISABLE_PROXY
  383|     54|  Curl_ssl_config_init(&data->set.proxy_ssl);
  384|     54|  set->proxyport = 0;
  385|     54|  set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
  ------------------
  |  |  792|     54|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  386|     54|  set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
  ------------------
  |  |  833|     54|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  387|       |  /* SOCKS5 proxy auth defaults to username/password + GSS-API */
  388|     54|  set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  833|     54|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  839|     54|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|     54|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  389|     54|#endif
  390|       |
  391|     54|#ifndef CURL_DISABLE_DOH
  392|     54|  set->doh_verifyhost = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  393|     54|  set->doh_verifypeer = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  394|     54|#endif
  395|       |#ifdef USE_SSH
  396|       |  /* defaults to any auth type */
  397|       |  set->ssh_auth_types = CURLSSH_AUTH_DEFAULT;
  398|       |  set->new_directory_perms = 0755; /* Default permissions */
  399|       |#endif
  400|       |
  401|     54|  set->new_file_perms = 0644;    /* Default permissions */
  402|     54|  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   67|     54|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
  403|     54|  set->redir_protocols = CURLPROTO_REDIR;
  ------------------
  |  |   70|     54|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1088|     54|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1089|     54|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1090|     54|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   71|     54|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|     54|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  404|       |
  405|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  406|       |  /*
  407|       |   * disallow unprotected protection negotiation NEC reference implementation
  408|       |   * seem not to follow rfc1961 section 4.3/4.4
  409|       |   */
  410|       |  set->socks5_gssapi_nec = FALSE;
  411|       |#endif
  412|       |
  413|       |  /* set default minimum TLS version */
  414|     54|#ifdef USE_SSL
  415|     54|  Curl_setopt_SSLVERSION(data, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|     54|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  416|     54|#ifndef CURL_DISABLE_PROXY
  417|     54|  Curl_setopt_SSLVERSION(data, CURLOPT_PROXY_SSLVERSION,
  418|     54|                         CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|     54|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  419|     54|#endif
  420|     54|#endif
  421|     54|#ifndef CURL_DISABLE_FTP
  422|     54|  set->wildcard_enabled = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  423|     54|  set->chunk_bgn = ZERO_NULL;
  ------------------
  |  | 1174|     54|#define ZERO_NULL 0
  ------------------
  424|     54|  set->chunk_end = ZERO_NULL;
  ------------------
  |  | 1174|     54|#define ZERO_NULL 0
  ------------------
  425|     54|  set->fnmatch = ZERO_NULL;
  ------------------
  |  | 1174|     54|#define ZERO_NULL 0
  ------------------
  426|     54|#endif
  427|     54|  set->tcp_keepalive = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  428|     54|  set->tcp_keepintvl = 60;
  429|     54|  set->tcp_keepidle = 60;
  430|     54|  set->tcp_keepcnt = 9;
  431|     54|  set->tcp_fastopen = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  432|     54|  set->tcp_nodelay = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  433|     54|  set->ssl_enable_alpn = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  434|     54|  set->expect_100_timeout = 1000L; /* Wait for a second by default. */
  435|     54|  set->sep_headers = TRUE; /* separated header lists by default */
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  436|     54|  set->buffer_size = READBUFFER_SIZE;
  ------------------
  |  |  120|     54|#define READBUFFER_SIZE CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|     54|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
  437|     54|  set->upload_buffer_size = UPLOADBUFFER_DEFAULT;
  ------------------
  |  |  132|     54|#define UPLOADBUFFER_DEFAULT 65536
  ------------------
  438|     54|  set->upload_flags = CURLULFLAG_SEEN;
  ------------------
  |  | 1054|     54|#define CURLULFLAG_SEEN     (1L << 4)
  ------------------
  439|     54|  set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
  ------------------
  |  |  979|     54|#define CURL_HET_DEFAULT 200L
  ------------------
  440|     54|  set->upkeep_interval_ms = CURL_UPKEEP_INTERVAL_DEFAULT;
  ------------------
  |  |  982|     54|#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  ------------------
  441|     54|  set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
  ------------------
  |  |   38|     54|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  442|     54|  set->conn_max_idle_ms = 118 * 1000;
  443|     54|  set->conn_max_age_ms = 24 * 3600 * 1000;
  444|     54|  set->http09_allowed = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  445|     54|  set->httpwant = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2338|     54|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  446|     54|#if defined(USE_HTTP2) || defined(USE_HTTP3)
  447|     54|  set->weight = 0;
  448|     54|#endif
  449|     54|  set->quick_exit = 0L;
  450|     54|#ifndef CURL_DISABLE_WEBSOCKETS
  451|     54|  set->ws_raw_mode = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  452|       |  set->ws_no_auto_pong = FALSE;
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  453|     54|#endif
  454|     54|}
Curl_open:
  475|     54|{
  476|     54|  struct Curl_easy *data;
  477|       |
  478|       |  /* simple start-up: alloc the struct, init it with zeroes and return */
  479|     54|  data = curlx_calloc(1, sizeof(struct Curl_easy));
  ------------------
  |  | 1500|     54|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  480|     54|  if(!data) {
  ------------------
  |  Branch (480:6): [True: 0, False: 54]
  ------------------
  481|       |    /* this is a serious error */
  482|      0|    DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  483|      0|    return CURLE_OUT_OF_MEMORY;
  484|      0|  }
  485|       |
  486|     54|  data->magic = CURLEASY_MAGIC_NUMBER;
  ------------------
  |  |   28|     54|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  ------------------
  487|       |  /* most recent connection is not yet defined */
  488|     54|  data->state.last_conn_id = -1;
  489|     54|  data->state.last_cpid = UINT32_MAX;
  490|       |  /* and not assigned an id yet */
  491|     54|  data->id = -1;
  492|     54|  data->mid = UINT32_MAX;
  493|     54|  data->master_mid = UINT32_MAX;
  494|     54|  data->progress.hide = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  495|       |
  496|     54|  Curl_hash_init(&data->meta_hash, 23, CURL_HASH_TYPE_BYTES,
  497|     54|                 easy_meta_freeentry);
  498|     54|  DEBUGASSERT(STRING_LAST <= UINT8_MAX);
  ------------------
  |  | 1016|     54|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (498:3): [True: 0, Folded]
  |  Branch (498:3): [True: 54, Folded]
  ------------------
  499|     54|  Curl_u8_strset_init(&data->set.strings);
  500|     54|  curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|     54|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  501|     54|  Curl_bufref_init(&data->state.url);
  502|     54|  Curl_bufref_init(&data->state.referer);
  503|     54|  Curl_req_init(&data->req);
  504|     54|  Curl_initinfo(data);
  505|     54|#ifndef CURL_DISABLE_HTTP
  506|     54|  Curl_llist_init(&data->state.httphdrs, NULL);
  507|     54|#endif
  508|     54|  Curl_netrc_init(&data->state.netrc);
  509|     54|  Curl_init_userdefined(data);
  510|       |
  511|     54|  *curl = data;
  512|     54|  return CURLE_OK;
  513|     54|}
url.c:up_free:
  202|     54|{
  203|     54|  struct urlpieces *up = &data->state.up;
  204|     54|  curlx_safefree(up->options);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  205|     54|  curlx_safefree(up->path);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  206|     54|  curlx_safefree(up->query);
  ------------------
  |  | 1359|     54|  do {                      \
  |  | 1360|     54|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     54|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     54|    (ptr) = NULL;           \
  |  | 1362|     54|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 54]
  |  |  ------------------
  ------------------
  207|     54|  curl_url_cleanup(data->state.uh);
  208|       |  data->state.uh = NULL;
  209|     54|}

curl_url_cleanup:
 1559|     54|{
 1560|     54|  if(u) {
  ------------------
  |  Branch (1560:6): [True: 0, False: 54]
  ------------------
 1561|      0|    free_urlhandle(u);
 1562|      0|    curlx_free(u);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1563|      0|  }
 1564|     54|}

Curl_auth_digest_cleanup:
 1138|    108|{
 1139|    108|  Curl_peer_unlink(&digest->origin);
 1140|    108|  Curl_creds_unlink(&digest->creds);
 1141|    108|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1142|    108|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1143|    108|  curlx_safefree(digest->realm);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1144|    108|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1145|    108|  curlx_safefree(digest->qop);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1146|    108|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1359|    108|  do {                      \
  |  | 1360|    108|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    108|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    108|    (ptr) = NULL;           \
  |  | 1362|    108|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 108]
  |  |  ------------------
  ------------------
 1147|       |
 1148|    108|  digest->nc = 0;
 1149|    108|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   47|    108|#define ALGO_MD5 0
  ------------------
 1150|    108|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  |  989|    108|#define FALSE false
  ------------------
 1151|       |  digest->userhash = FALSE;
  ------------------
  |  |  989|    108|#define FALSE false
  ------------------
 1152|    108|}

Curl_async_global_init:
   81|      1|{
   82|       |#if defined(USE_ARES) && defined(CARES_HAVE_ARES_LIBRARY_INIT)
   83|       |  if(ares_library_init(ARES_LIB_INIT_ALL)) {
   84|       |    return CURLE_FAILED_INIT;
   85|       |  }
   86|       |#endif
   87|      1|  return CURLE_OK;
   88|      1|}
Curl_async_global_cleanup:
   96|      1|{
   97|       |#if defined(USE_ARES) && defined(CARES_HAVE_ARES_LIBRARY_INIT)
   98|       |  ares_library_cleanup();
   99|       |#endif
  100|      1|}

Curl_host_is_ipnum:
  321|  2.98k|{
  322|  2.98k|  struct in_addr in;
  323|  2.98k|#ifdef USE_IPV6
  324|  2.98k|  struct in6_addr in6;
  325|  2.98k|#endif
  326|  2.98k|  if(!hostname || !*hostname)
  ------------------
  |  Branch (326:6): [True: 0, False: 2.98k]
  |  Branch (326:19): [True: 93, False: 2.89k]
  ------------------
  327|     93|    return FALSE;
  ------------------
  |  |  989|     93|#define FALSE false
  ------------------
  328|  2.89k|  if(curlx_inet_pton(AF_INET, hostname, &in) > 0
  ------------------
  |  Branch (328:6): [True: 88, False: 2.80k]
  ------------------
  329|  2.80k|#ifdef USE_IPV6
  330|  2.80k|     || curlx_inet_pton(AF_INET6, hostname, &in6) > 0
  ------------------
  |  Branch (330:9): [True: 234, False: 2.57k]
  ------------------
  331|  2.89k|#endif
  332|  2.89k|    )
  333|    322|    return TRUE;
  ------------------
  |  |  986|    322|#define TRUE true
  ------------------
  334|  2.57k|  return FALSE;
  ------------------
  |  |  989|  2.57k|#define FALSE false
  ------------------
  335|  2.89k|}
Curl_resolv_destroy_all:
 1177|     54|{
 1178|     54|  while(data->state.async) {
  ------------------
  |  Branch (1178:9): [True: 0, False: 54]
  ------------------
 1179|      0|    struct Curl_resolv_async *async = data->state.async;
 1180|      0|    data->state.async = async->next;
 1181|      0|    Curl_async_destroy(data, async);
 1182|      0|  }
 1183|     54|}

Curl_cert_hostcheck:
  126|  3.73k|{
  127|  3.73k|  if(matchlen > 0 && hostlen > 0)
  ------------------
  |  Branch (127:6): [True: 3.40k, False: 326]
  |  Branch (127:22): [True: 3.25k, False: 156]
  ------------------
  128|  3.25k|    return hostmatch(hostname, hostlen, match, matchlen);
  129|    482|  return FALSE;
  ------------------
  |  |  989|    482|#define FALSE false
  ------------------
  130|  3.73k|}
hostcheck.c:hostmatch:
   81|  3.25k|{
   82|  3.25k|  const char *pattern_label_end;
   83|       |
   84|  3.25k|  DEBUGASSERT(pattern);
  ------------------
  |  | 1016|  3.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (84:3): [True: 0, False: 3.25k]
  |  Branch (84:3): [True: 3.25k, False: 0]
  ------------------
   85|  3.25k|  DEBUGASSERT(patternlen);
  ------------------
  |  | 1016|  3.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 3.25k]
  |  Branch (85:3): [True: 3.25k, False: 0]
  ------------------
   86|  3.25k|  DEBUGASSERT(hostname);
  ------------------
  |  | 1016|  3.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (86:3): [True: 0, False: 3.25k]
  |  Branch (86:3): [True: 3.25k, False: 0]
  ------------------
   87|  3.25k|  DEBUGASSERT(hostlen);
  ------------------
  |  | 1016|  3.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 3.25k]
  |  Branch (87:3): [True: 3.25k, False: 0]
  ------------------
   88|       |
   89|       |  /* normalize the hostname by stripping off a trailing dot. The pattern is
   90|       |     the name from the certificate and is used as is: a trailing dot there
   91|       |     would escape the issuers' name constraints (which the TLS library checked
   92|       |     against the encoded name) while still matching the normalized host */
   93|  3.25k|  if(hostlen > 0 && hostname[hostlen - 1] == '.')
  ------------------
  |  Branch (93:6): [True: 3.25k, False: 0]
  |  Branch (93:21): [True: 767, False: 2.48k]
  ------------------
   94|    767|    hostlen--;
   95|       |
   96|  3.25k|  if(patternlen > 2 && strncmp(pattern, "*.", 2))
  ------------------
  |  Branch (96:6): [True: 361, False: 2.89k]
  |  Branch (96:24): [True: 264, False: 97]
  ------------------
   97|    264|    return pmatch(hostname, hostlen, pattern, patternlen);
   98|       |
   99|       |  /* detect host as IP address or starting with a dot and fail if so */
  100|  2.98k|  else if(Curl_host_is_ipnum(hostname) || (hostlen > 0 && hostname[0] == '.'))
  ------------------
  |  Branch (100:11): [True: 322, False: 2.66k]
  |  Branch (100:44): [True: 2.55k, False: 110]
  |  Branch (100:59): [True: 73, False: 2.48k]
  ------------------
  101|    395|    return FALSE;
  ------------------
  |  |  989|    395|#define FALSE false
  ------------------
  102|       |
  103|       |  /* We require at least 2 dots in the pattern to avoid too wide wildcard
  104|       |     match. */
  105|  2.59k|  pattern_label_end = memchr(pattern, '.', patternlen);
  106|  2.59k|  if(!pattern_label_end ||
  ------------------
  |  Branch (106:6): [True: 2.04k, False: 547]
  ------------------
  107|    547|     (memrchr(pattern, '.', patternlen) == pattern_label_end))
  ------------------
  |  Branch (107:6): [True: 261, False: 286]
  ------------------
  108|  2.30k|    return pmatch(hostname, hostlen, pattern, patternlen);
  109|    286|  else {
  110|    286|    const char *hostname_label_end = memchr(hostname, '.', hostlen);
  111|    286|    if(hostname_label_end) {
  ------------------
  |  Branch (111:8): [True: 206, False: 80]
  ------------------
  112|    206|      size_t skiphost = hostname_label_end - hostname;
  113|    206|      size_t skiplen = pattern_label_end - pattern;
  114|    206|      return pmatch(hostname_label_end, hostlen - skiphost,
  115|    206|                    pattern_label_end, patternlen - skiplen);
  116|    206|    }
  117|    286|  }
  118|     80|  return FALSE;
  ------------------
  |  |  989|     80|#define FALSE false
  ------------------
  119|  2.59k|}
hostcheck.c:pmatch:
   44|  2.77k|{
   45|  2.77k|  if(hostlen != patternlen)
  ------------------
  |  Branch (45:6): [True: 2.07k, False: 702]
  ------------------
   46|  2.07k|    return FALSE;
  ------------------
  |  |  989|  2.07k|#define FALSE false
  ------------------
   47|    702|  return curl_strnequal(hostname, pattern, hostlen);
   48|  2.77k|}

Curl_tls_keylog_open:
   39|      1|{
   40|      1|  if(!keylog_file_fp) {
  ------------------
  |  Branch (40:6): [True: 1, False: 0]
  ------------------
   41|      1|    keylog_file_name = getenv("SSLKEYLOGFILE");
   42|      1|    if(keylog_file_name) {
  ------------------
  |  Branch (42:8): [True: 0, False: 1]
  ------------------
   43|      0|      keylog_file_fp = curlx_fopen(keylog_file_name, FOPEN_APPENDTEXT);
  ------------------
  |  |   83|      0|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
   44|      0|      if(keylog_file_fp) {
  ------------------
  |  Branch (44:10): [True: 0, False: 0]
  ------------------
   45|       |#ifdef _WIN32
   46|       |        if(setvbuf(keylog_file_fp, NULL, _IONBF, 0))
   47|       |#else
   48|      0|        if(setvbuf(keylog_file_fp, NULL, _IOLBF, 4096))
  ------------------
  |  Branch (48:12): [True: 0, False: 0]
  ------------------
   49|      0|#endif
   50|      0|        {
   51|      0|          curlx_fclose(keylog_file_fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
   52|       |          keylog_file_fp = NULL;
   53|      0|        }
   54|      0|      }
   55|      0|    }
   56|      1|  }
   57|      1|}
Curl_tls_keylog_close:
   60|      1|{
   61|      1|  if(keylog_file_fp) {
  ------------------
  |  Branch (61:6): [True: 0, False: 1]
  ------------------
   62|      0|    curlx_fclose(keylog_file_fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
   63|       |    keylog_file_fp = NULL;
   64|      0|  }
   65|      1|}

openssl.c:rand_enough:
  804|      1|{
  805|      1|  return RAND_status() != 0;
  806|      1|}
openssl.c:ossl_init:
 1628|      1|{
 1629|      1|  const uint64_t flags =
 1630|      1|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1631|       |    /* not present in BoringSSL */
 1632|      1|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1633|      1|#endif
 1634|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1635|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1636|       |#else
 1637|      1|    OPENSSL_INIT_LOAD_CONFIG |
 1638|      1|#endif
 1639|      1|    0;
 1640|      1|  OPENSSL_init_ssl(flags, NULL);
 1641|       |
 1642|      1|#ifndef HAVE_KEYLOG_UPSTREAM
 1643|      1|  Curl_tls_keylog_open();
 1644|      1|#endif
 1645|       |
 1646|      1|  return 1;
 1647|      1|}
openssl.c:ossl_cleanup:
 1651|      1|{
 1652|      1|#ifndef HAVE_KEYLOG_UPSTREAM
 1653|      1|  Curl_tls_keylog_close();
 1654|      1|#endif
 1655|      1|}
openssl.c:ossl_random:
 5508|      1|{
 5509|      1|  int rc;
 5510|      1|  if(data) {
  ------------------
  |  Branch (5510:6): [True: 0, False: 1]
  ------------------
 5511|      0|    if(ossl_seed(data)) /* Initiate the seed if not already done */
  ------------------
  |  Branch (5511:8): [True: 0, False: 0]
  ------------------
 5512|      0|      return CURLE_FAILED_INIT; /* could not seed for some reason */
 5513|      0|  }
 5514|      1|  else {
 5515|      1|    if(!rand_enough())
  ------------------
  |  Branch (5515:8): [True: 0, False: 1]
  ------------------
 5516|      0|      return CURLE_FAILED_INIT;
 5517|      1|  }
 5518|       |  /* RAND_bytes() returns 1 on success, 0 otherwise. */
 5519|      1|  rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
 5520|      1|  return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
  ------------------
  |  Branch (5520:10): [True: 1, False: 0]
  ------------------
 5521|      1|}
openssl.c:ossl_close_all:
 2039|     54|{
 2040|     54|  (void)data;
 2041|     54|}

Curl_ssl_init:
  152|      1|{
  153|       |  /* make sure this is only done once */
  154|      1|  if(init_ssl)
  ------------------
  |  Branch (154:6): [True: 0, False: 1]
  ------------------
  155|      0|    return 1;
  156|      1|  init_ssl = TRUE; /* never again */
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  157|       |
  158|      1|  if(Curl_ssl->init)
  ------------------
  |  Branch (158:6): [True: 1, False: 0]
  ------------------
  159|      1|    return Curl_ssl->init();
  160|      0|  return 1;
  161|      1|}
Curl_ssl_close_all:
  228|     54|{
  229|     54|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (229:6): [True: 54, False: 0]
  ------------------
  230|     54|    Curl_ssl->close_all(data);
  231|     54|}
Curl_ssl_free_certinfo:
  279|    108|{
  280|    108|  struct curl_certinfo *ci = &data->info.certs;
  281|       |
  282|    108|  if(ci->num_of_certs) {
  ------------------
  |  Branch (282:6): [True: 0, False: 108]
  ------------------
  283|       |    /* free all individual lists used */
  284|      0|    int i;
  285|      0|    for(i = 0; i < ci->num_of_certs; i++) {
  ------------------
  |  Branch (285:16): [True: 0, False: 0]
  ------------------
  286|      0|      curl_slist_free_all(ci->certinfo[i]);
  287|      0|      ci->certinfo[i] = NULL;
  288|      0|    }
  289|       |
  290|       |    curlx_safefree(ci->certinfo); /* free the actual array too */
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  291|      0|    ci->num_of_certs = 0;
  292|      0|  }
  293|    108|}
Curl_ssl_random:
  351|      1|{
  352|      1|  if(Curl_ssl->random)
  ------------------
  |  Branch (352:6): [True: 1, False: 0]
  ------------------
  353|      1|    return Curl_ssl->random(data, buffer, length);
  354|      0|  else
  355|      0|    return CURLE_NOT_BUILT_IN;
  356|      1|}
Curl_ssl_cleanup:
  700|      1|{
  701|      1|  if(init_ssl) {
  ------------------
  |  Branch (701:6): [True: 1, False: 0]
  ------------------
  702|       |    /* only cleanup if we did a previous init */
  703|      1|    if(Curl_ssl->cleanup)
  ------------------
  |  Branch (703:8): [True: 1, False: 0]
  ------------------
  704|      1|      Curl_ssl->cleanup();
  705|       |#ifdef CURL_WITH_MULTI_SSL
  706|       |    Curl_ssl = &Curl_ssl_multi;
  707|       |#endif
  708|       |    init_ssl = FALSE;
  ------------------
  |  |  989|      1|#define FALSE false
  ------------------
  709|      1|  }
  710|      1|}

Curl_ssl_config_init:
  101|    108|{
  102|       |  /*
  103|       |   * libcurl 7.10 introduced SSL verification *by default*! This needs to be
  104|       |   * switched off unless wanted.
  105|       |   */
  106|    108|  sslc->verifypeer = TRUE;
  ------------------
  |  |  986|    108|#define TRUE true
  ------------------
  107|    108|  sslc->verifyhost = TRUE;
  ------------------
  |  |  986|    108|#define TRUE true
  ------------------
  108|       |  sslc->cache_session = TRUE; /* caching by default */
  ------------------
  |  |  986|    108|#define TRUE true
  ------------------
  109|    108|}

_ZN14private_fuzzer12TestOneInputEPKhm:
  510|  2.77k|int TestOneInput(const std::uint8_t *data, std::size_t size) {
  511|  2.77k|  if (!data || !size)
  ------------------
  |  Branch (511:7): [True: 0, False: 2.77k]
  |  Branch (511:16): [True: 0, False: 2.77k]
  ------------------
  512|      0|    return 0;
  513|       |
  514|  2.77k|  InputCursor input(data + 1, size - 1);
  515|  2.77k|  switch (data[0]) {
  516|    202|    case 'P':
  ------------------
  |  Branch (516:5): [True: 202, False: 2.57k]
  ------------------
  517|    202|      FuzzPointerArray(input);
  518|    202|      break;
  519|    701|    case 'D':
  ------------------
  |  Branch (519:5): [True: 701, False: 2.07k]
  ------------------
  520|    701|      FuzzDynamicHeaders(input);
  521|    701|      break;
  522|  1.04k|    case 'U':
  ------------------
  |  Branch (522:5): [True: 1.04k, False: 1.72k]
  ------------------
  523|  1.04k|      FuzzSparseBitset(input);
  524|  1.04k|      break;
  525|    134|    case 'M':
  ------------------
  |  Branch (525:5): [True: 134, False: 2.63k]
  ------------------
  526|    134|      FuzzMemoryDebug(input);
  527|    134|      break;
  528|     54|    case 'H':
  ------------------
  |  Branch (528:5): [True: 54, False: 2.71k]
  ------------------
  529|     54|      FuzzHappyEyeballs(input);
  530|     54|      break;
  531|      0|#if defined(USE_OPENSSL) || defined(USE_SCHANNEL)
  532|    636|    case 'C':
  ------------------
  |  Branch (532:5): [True: 636, False: 2.13k]
  ------------------
  533|    636|      FuzzHostcheck(input);
  534|    636|      break;
  535|      0|#endif
  536|      1|    default:
  ------------------
  |  Branch (536:5): [True: 1, False: 2.77k]
  ------------------
  537|      1|      break;
  538|  2.77k|  }
  539|  2.77k|  return 0;
  540|  2.77k|}
LLVMFuzzerTestOneInput:
  545|  2.77k|                                      std::size_t size) {
  546|  2.77k|  return private_fuzzer::TestOneInput(data, size);
  547|  2.77k|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111InputCursorC2EPKhm:
   80|  2.77k|      : data_(data), size_(size), offset_(0) {}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_116FuzzPointerArrayENS0_11InputCursorE:
  109|    202|void FuzzPointerArray(InputCursor input) {
  110|    202|  struct ptrarray pointers;
  111|    202|  std::array<std::uint8_t, kMaxPointers> tokens = {};
  112|    202|  std::vector<void *> expected;
  113|    202|  Curl_ptrarray_init(&pointers);
  114|       |
  115|    202|  for (std::size_t operation = 0;
  116|  12.0k|       operation < kMaxOperations && !input.empty(); ++operation) {
  ------------------
  |  Branch (116:8): [True: 12.0k, False: 15]
  |  Branch (116:38): [True: 11.8k, False: 187]
  ------------------
  117|  11.8k|    switch (input.TakeByte()) {
  118|  5.88k|      case '+': {
  ------------------
  |  Branch (118:7): [True: 5.88k, False: 5.94k]
  ------------------
  119|  5.88k|        const std::size_t token = input.TakeByte();
  120|  5.88k|        if (expected.size() < kMaxPointers &&
  ------------------
  |  Branch (120:13): [True: 5.88k, False: 0]
  ------------------
  121|  5.88k|            Curl_ptrarray_add(&pointers, &tokens[token]) == CURLE_OK)
  ------------------
  |  Branch (121:13): [True: 5.88k, False: 0]
  ------------------
  122|  5.88k|          expected.push_back(&tokens[token]);
  123|  5.88k|        break;
  124|      0|      }
  125|    205|      case '0': {
  ------------------
  |  Branch (125:7): [True: 205, False: 11.6k]
  ------------------
  126|    205|        const CURLcode result = Curl_ptrarray_add(&pointers, nullptr);
  127|    205|        assert(result == CURLE_BAD_FUNCTION_ARGUMENT);
  ------------------
  |  Branch (127:9): [True: 205, False: 0]
  ------------------
  128|    205|        break;
  129|    205|      }
  130|  1.59k|      case '?': {
  ------------------
  |  Branch (130:7): [True: 1.59k, False: 10.2k]
  ------------------
  131|  1.59k|        const std::size_t span = expected.size() + 2;
  132|  1.59k|        const std::size_t index = input.TakeByte() % span;
  133|  1.59k|        void *want = index < expected.size() ? expected[index] : nullptr;
  ------------------
  |  Branch (133:22): [True: 819, False: 780]
  ------------------
  134|  1.59k|        void *actual =
  135|  1.59k|            ptrarray_get(&pointers, static_cast<uint32_t>(index));
  136|  1.59k|        assert(actual == want);
  ------------------
  |  Branch (136:9): [True: 1.59k, False: 0]
  ------------------
  137|  1.59k|        break;
  138|  1.59k|      }
  139|  1.59k|      case '#': {
  ------------------
  |  Branch (139:7): [True: 453, False: 11.3k]
  ------------------
  140|    453|        const uint32_t count = ptrarray_count(&pointers);
  141|    453|        assert(count == expected.size());
  ------------------
  |  Branch (141:9): [True: 453, False: 0]
  ------------------
  142|    453|        break;
  143|    453|      }
  144|  1.26k|      case '-': {
  ------------------
  |  Branch (144:7): [True: 1.26k, False: 10.5k]
  ------------------
  145|  1.26k|        const std::size_t span = expected.size() + 2;
  146|  1.26k|        const std::size_t index = input.TakeByte() % span;
  147|  1.26k|        void *want = index < expected.size() ? expected[index] : nullptr;
  ------------------
  |  Branch (147:22): [True: 593, False: 668]
  ------------------
  148|  1.26k|        void *actual = Curl_ptrarray_remove(
  149|  1.26k|            &pointers, static_cast<uint32_t>(index));
  150|  1.26k|        assert(actual == want);
  ------------------
  |  Branch (150:9): [True: 1.26k, False: 0]
  ------------------
  151|  1.26k|        if (index < expected.size())
  ------------------
  |  Branch (151:13): [True: 593, False: 668]
  ------------------
  152|    593|          expected.erase(expected.begin() + static_cast<std::ptrdiff_t>(index));
  153|  1.26k|        break;
  154|  1.26k|      }
  155|  1.13k|      case 'C':
  ------------------
  |  Branch (155:7): [True: 1.13k, False: 10.6k]
  ------------------
  156|  1.13k|        ptrarray_clear(&pointers);
  157|  1.13k|        expected.clear();
  158|  1.13k|        break;
  159|  1.28k|      default:
  ------------------
  |  Branch (159:7): [True: 1.28k, False: 10.5k]
  ------------------
  160|  1.28k|        break;
  161|  11.8k|    }
  162|  11.8k|    assert(CURL_PTRARRAY_COUNT(&pointers) == expected.size());
  ------------------
  |  Branch (162:5): [True: 11.8k, False: 0]
  ------------------
  163|  11.8k|  }
  164|       |
  165|    202|  ptrarray_clear(&pointers);
  166|    202|}
fuzz_private.cc:_ZNK14private_fuzzer12_GLOBAL__N_111InputCursor5emptyEv:
   82|   270k|  bool empty() const { return offset_ >= size_; }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111InputCursor8TakeByteEv:
   85|   202k|  std::uint8_t TakeByte() {
   86|   202k|    return empty() ? 0 : data_[offset_++];
  ------------------
  |  Branch (86:12): [True: 2.40k, False: 200k]
  ------------------
   87|   202k|  }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_118FuzzDynamicHeadersENS0_11InputCursorE:
  168|    701|void FuzzDynamicHeaders(InputCursor input) {
  169|    701|  const std::uint8_t config = input.TakeByte();
  170|    701|  const std::size_t max_entries = 1 + (config & 31U);
  171|    701|  const std::size_t max_string_bytes = 16 + input.TakeByte();
  172|    701|  struct dynhds headers;
  173|    701|  Curl_dynhds_init(&headers, max_entries, max_string_bytes);
  174|    701|  if (config & 0x20U)
  ------------------
  |  Branch (174:7): [True: 297, False: 404]
  ------------------
  175|    297|    Curl_dynhds_set_opts(&headers, DYNHDS_OPT_LOWERCASE);
  ------------------
  |  |   54|    297|#define DYNHDS_OPT_LOWERCASE     (1U << 0)
  ------------------
  176|       |
  177|    701|  for (std::size_t operation = 0;
  178|  17.8k|       operation < kMaxOperations && !input.empty(); ++operation) {
  ------------------
  |  Branch (178:8): [True: 17.8k, False: 5]
  |  Branch (178:38): [True: 17.2k, False: 624]
  ------------------
  179|  17.2k|    const char opcode = static_cast<char>(input.TakeByte());
  180|  17.2k|    if (input.remaining() < 2)
  ------------------
  |  Branch (180:9): [True: 37, False: 17.1k]
  ------------------
  181|     37|      break;
  182|  17.1k|    const std::size_t name_length =
  183|  17.1k|        input.TakeByte() & kMaxHeaderFieldLength;
  184|  17.1k|    const std::size_t value_length =
  185|  17.1k|        input.TakeByte() & kMaxHeaderFieldLength;
  186|  17.1k|    if (input.remaining() < name_length + value_length)
  ------------------
  |  Branch (186:9): [True: 35, False: 17.1k]
  ------------------
  187|     35|      break;
  188|  17.1k|    const std::string name = input.TakeBytes(name_length);
  189|  17.1k|    const std::string value = input.TakeBytes(value_length);
  190|  17.1k|    const bool valid_name = !name.empty() && name.front() != '\0';
  ------------------
  |  Branch (190:29): [True: 9.33k, False: 7.80k]
  |  Branch (190:46): [True: 8.56k, False: 763]
  ------------------
  191|       |
  192|  17.1k|    switch (opcode) {
  193|  2.39k|      case 'A':
  ------------------
  |  Branch (193:7): [True: 2.39k, False: 14.7k]
  ------------------
  194|  2.39k|        if (valid_name)
  ------------------
  |  Branch (194:13): [True: 1.93k, False: 457]
  ------------------
  195|  1.93k|          (void)Curl_dynhds_add(&headers, name.data(), name.size(),
  196|  1.93k|                                value.data(), value.size());
  197|  2.39k|        break;
  198|  2.80k|      case 'a':
  ------------------
  |  Branch (198:7): [True: 2.80k, False: 14.3k]
  ------------------
  199|  2.80k|        if (valid_name)
  ------------------
  |  Branch (199:13): [True: 2.26k, False: 542]
  ------------------
  200|  2.26k|          (void)Curl_dynhds_cadd(&headers, name.c_str(), value.c_str());
  201|  2.80k|        break;
  202|  1.03k|      case '?':
  ------------------
  |  Branch (202:7): [True: 1.03k, False: 16.1k]
  ------------------
  203|  1.03k|        (void)dynhds_contains(&headers, name.data(), name.size());
  204|  1.03k|        break;
  205|  1.07k|      case 'C':
  ------------------
  |  Branch (205:7): [True: 1.07k, False: 16.0k]
  ------------------
  206|  1.07k|        (void)dynhds_ccontains(&headers, name.c_str());
  207|  1.07k|        break;
  208|  1.03k|      case 'N':
  ------------------
  |  Branch (208:7): [True: 1.03k, False: 16.1k]
  ------------------
  209|  1.03k|        (void)dynhds_count_name(&headers, name.data(), name.size());
  210|  1.03k|        break;
  211|    981|      case 'n':
  ------------------
  |  Branch (211:7): [True: 981, False: 16.1k]
  ------------------
  212|    981|        (void)dynhds_ccount_name(&headers, name.c_str());
  213|    981|        break;
  214|  1.56k|      case 'S':
  ------------------
  |  Branch (214:7): [True: 1.56k, False: 15.5k]
  ------------------
  215|  1.56k|        if (valid_name)
  ------------------
  |  Branch (215:13): [True: 1.36k, False: 200]
  ------------------
  216|  1.36k|          (void)dynhds_set(&headers, name.data(), name.size(), value.data(),
  217|  1.36k|                           value.size());
  218|  1.56k|        break;
  219|    467|      case 'R':
  ------------------
  |  Branch (219:7): [True: 467, False: 16.6k]
  ------------------
  220|    467|        (void)dynhds_remove(&headers, name.data(), name.size());
  221|    467|        break;
  222|    672|      case 'r':
  ------------------
  |  Branch (222:7): [True: 672, False: 16.4k]
  ------------------
  223|    672|        (void)dynhds_cremove(&headers, name.c_str());
  224|    672|        break;
  225|    535|      case 'X':
  ------------------
  |  Branch (225:7): [True: 535, False: 16.6k]
  ------------------
  226|    535|        Curl_dynhds_reset(&headers);
  227|    535|        break;
  228|  4.58k|      default:
  ------------------
  |  Branch (228:7): [True: 4.58k, False: 12.5k]
  ------------------
  229|  4.58k|        break;
  230|  17.1k|    }
  231|  17.1k|    assert(Curl_dynhds_count(&headers) <= max_entries);
  ------------------
  |  Branch (231:5): [True: 17.1k, False: 0]
  ------------------
  232|  17.1k|  }
  233|       |
  234|    701|  Curl_dynhds_cleanup(&headers);
  235|    701|}
fuzz_private.cc:_ZNK14private_fuzzer12_GLOBAL__N_111InputCursor9remainingEv:
   83|  71.7k|  std::size_t remaining() const { return size_ - offset_; }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111InputCursor9TakeBytesEm:
   96|  34.9k|  std::string TakeBytes(std::size_t length) {
   97|  34.9k|    length = length < remaining() ? length : remaining();
  ------------------
  |  Branch (97:14): [True: 33.1k, False: 1.78k]
  ------------------
   98|  34.9k|    const char *begin = reinterpret_cast<const char *>(data_ + offset_);
   99|  34.9k|    offset_ += length;
  100|  34.9k|    return std::string(begin, length);
  101|  34.9k|  }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_116FuzzSparseBitsetENS0_11InputCursorE:
  237|  1.04k|void FuzzSparseBitset(InputCursor input) {
  238|  1.04k|  struct uint32_spbset values;
  239|  1.04k|  Curl_uint32_spbset_init(&values);
  240|       |
  241|  1.04k|  for (std::size_t operation = 0;
  242|  28.1k|       operation < kMaxOperations && !input.empty(); ++operation) {
  ------------------
  |  Branch (242:8): [True: 28.1k, False: 7]
  |  Branch (242:38): [True: 27.0k, False: 1.03k]
  ------------------
  243|  27.0k|    const char opcode = static_cast<char>(input.TakeByte());
  244|  27.0k|    switch (opcode) {
  245|  14.9k|      case '+':
  ------------------
  |  Branch (245:7): [True: 14.9k, False: 12.1k]
  ------------------
  246|  14.9k|        (void)Curl_uint32_spbset_add(&values, input.TakeU32());
  247|  14.9k|        break;
  248|  2.02k|      case '-':
  ------------------
  |  Branch (248:7): [True: 2.02k, False: 25.0k]
  ------------------
  249|  2.02k|        Curl_uint32_spbset_remove(&values, input.TakeU32());
  250|  2.02k|        break;
  251|  1.72k|      case '?':
  ------------------
  |  Branch (251:7): [True: 1.72k, False: 25.3k]
  ------------------
  252|  1.72k|        (void)Curl_uint32_spbset_contains(&values, input.TakeU32());
  253|  1.72k|        break;
  254|    551|      case '#':
  ------------------
  |  Branch (254:7): [True: 551, False: 26.5k]
  ------------------
  255|    551|        (void)Curl_uint32_spbset_count(&values);
  256|    551|        break;
  257|    744|      case 'F': {
  ------------------
  |  Branch (257:7): [True: 744, False: 26.3k]
  ------------------
  258|    744|        uint32_t first = 0;
  259|    744|        (void)Curl_uint32_spbset_first(&values, &first);
  260|    744|        break;
  261|      0|      }
  262|  2.85k|      case 'N': {
  ------------------
  |  Branch (262:7): [True: 2.85k, False: 24.2k]
  ------------------
  263|  2.85k|        uint32_t next = 0;
  264|  2.85k|        (void)Curl_uint32_spbset_next(&values, input.TakeU32(), &next);
  265|  2.85k|        break;
  266|      0|      }
  267|    640|      case 'C':
  ------------------
  |  Branch (267:7): [True: 640, False: 26.4k]
  ------------------
  268|    640|        uint32_spbset_clear(&values);
  269|    640|        break;
  270|  3.59k|      default:
  ------------------
  |  Branch (270:7): [True: 3.59k, False: 23.4k]
  ------------------
  271|  3.59k|        break;
  272|  27.0k|    }
  273|  27.0k|  }
  274|       |
  275|  1.04k|  Curl_uint32_spbset_destroy(&values);
  276|  1.04k|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111InputCursor7TakeU32Ev:
   89|  21.5k|  std::uint32_t TakeU32() {
   90|  21.5k|    std::uint32_t value = 0;
   91|   107k|    for (int index = 0; index < 4; ++index)
  ------------------
  |  Branch (91:25): [True: 86.2k, False: 21.5k]
  ------------------
   92|  86.2k|      value = (value << 8) | TakeByte();
   93|  21.5k|    return value;
   94|  21.5k|  }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_115FuzzMemoryDebugENS0_11InputCursorE:
  346|    134|void FuzzMemoryDebug(InputCursor input) {
  347|    134|#ifdef CURL_MEMDEBUG
  348|    134|  curl_socket_t sockets[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD};
  ------------------
  |  |  147|    134|#define CURL_SOCKET_BAD (-1)
  ------------------
                curl_socket_t sockets[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD};
  ------------------
  |  |  147|    134|#define CURL_SOCKET_BAD (-1)
  ------------------
  349|       |
  350|    134|  for (std::size_t operation = 0;
  351|  6.36k|       operation < kMaxOperations && !input.empty(); ++operation) {
  ------------------
  |  Branch (351:8): [True: 6.35k, False: 7]
  |  Branch (351:38): [True: 6.23k, False: 127]
  ------------------
  352|  6.23k|    const char opcode = static_cast<char>(input.TakeByte());
  353|  6.23k|    const std::uint8_t flags = input.TakeByte();
  354|  6.23k|    const char *source = DebugSource(flags);
  355|  6.23k|    switch (opcode) {
  356|  1.09k|      case 'S':
  ------------------
  |  Branch (356:7): [True: 1.09k, False: 5.14k]
  ------------------
  357|  1.09k|#ifdef HAVE_SOCKETPAIR
  358|  1.09k|        CloseSocket(&sockets[0]);
  359|  1.09k|        CloseSocket(&sockets[1]);
  360|  1.09k|        (void)curl_dbg_socketpair(AF_UNIX,
  361|  1.09k|                                  (flags & 1U) ? SOCK_DGRAM : SOCK_STREAM, 0,
  ------------------
  |  Branch (361:35): [True: 988, False: 103]
  ------------------
  362|  1.09k|                                  sockets, flags, source);
  363|  1.09k|#endif
  364|  1.09k|        break;
  365|  1.43k|      case 'A': {
  ------------------
  |  Branch (365:7): [True: 1.43k, False: 4.79k]
  ------------------
  366|  1.43k|        struct sockaddr_storage address = {};
  367|  1.43k|        curl_socklen_t address_length = sizeof(address);
  368|  1.43k|        const curl_socket_t socket =
  369|  1.43k|            sockets[0] != CURL_SOCKET_BAD && !(flags & 1U)
  ------------------
  |  |  147|  2.87k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (369:13): [True: 668, False: 770]
  |  Branch (369:46): [True: 246, False: 422]
  ------------------
  370|  1.43k|                ? sockets[0]
  371|  1.43k|                : CURL_SOCKET_BAD;
  ------------------
  |  |  147|  1.19k|#define CURL_SOCKET_BAD (-1)
  ------------------
  372|  1.43k|        curl_socket_t accepted =
  373|  1.43k|            curl_dbg_accept(socket, (flags & 2U) ? &address : nullptr,
  ------------------
  |  Branch (373:37): [True: 471, False: 967]
  ------------------
  374|  1.43k|                            (flags & 2U) ? &address_length : nullptr, flags,
  ------------------
  |  Branch (374:29): [True: 471, False: 967]
  ------------------
  375|  1.43k|                            source);
  376|  1.43k|        CloseSocket(&accepted);
  377|  1.43k|        break;
  378|      0|      }
  379|    548|      case 'D': {
  ------------------
  |  Branch (379:7): [True: 548, False: 5.68k]
  ------------------
  380|    548|        const int descriptor = OpenNullDevice();
  381|    548|        FILE *stream =
  382|    548|            curl_dbg_fdopen(descriptor, FileMode(flags), flags, source);
  383|    548|        if (stream)
  ------------------
  |  Branch (383:13): [True: 548, False: 0]
  ------------------
  384|    548|          (void)curl_dbg_fclose(stream, flags, source);
  385|      0|        else if (descriptor >= 0)
  ------------------
  |  Branch (385:18): [True: 0, False: 0]
  ------------------
  386|      0|          CloseDescriptor(descriptor);
  387|    548|        break;
  388|      0|      }
  389|    649|      case 'R': {
  ------------------
  |  Branch (389:7): [True: 649, False: 5.58k]
  ------------------
  390|    649|        FILE *stream = curl_dbg_fopen(kNullDevice, "r+", flags, source);
  391|    649|        if (stream) {
  ------------------
  |  Branch (391:13): [True: 649, False: 0]
  ------------------
  392|    649|          stream = curl_dbg_freopen(kNullDevice, FileMode(flags), stream,
  393|    649|                                    flags, source);
  394|    649|          if (stream)
  ------------------
  |  Branch (394:15): [True: 649, False: 0]
  ------------------
  395|    649|            (void)curl_dbg_fclose(stream, flags, source);
  396|    649|        }
  397|    649|        break;
  398|      0|      }
  399|  2.50k|      default:
  ------------------
  |  Branch (399:7): [True: 2.50k, False: 3.72k]
  ------------------
  400|  2.50k|        break;
  401|  6.23k|    }
  402|  6.23k|  }
  403|       |
  404|    134|  CloseSocket(&sockets[0]);
  405|    134|  CloseSocket(&sockets[1]);
  406|       |#else
  407|       |  (void)input;
  408|       |#endif
  409|    134|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111DebugSourceEh:
  335|  6.23k|const char *DebugSource(std::uint8_t flags) {
  336|  6.23k|  return flags & 0x80U ? "fuzz_private.cc" : nullptr;
  ------------------
  |  Branch (336:10): [True: 1.79k, False: 4.43k]
  ------------------
  337|  6.23k|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111CloseSocketEPi:
  339|  3.88k|void CloseSocket(curl_socket_t *socket) {
  340|  3.88k|  if (*socket != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.88k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (340:7): [True: 2.18k, False: 1.70k]
  ------------------
  341|  2.18k|    (void)curl_dbg_sclose(*socket, 0, nullptr);
  342|  2.18k|    *socket = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  2.18k|#define CURL_SOCKET_BAD (-1)
  ------------------
  343|  2.18k|  }
  344|  3.88k|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_114OpenNullDeviceEv:
  326|    548|int OpenNullDevice() { return open(kNullDevice, O_RDWR); }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_18FileModeEh:
  330|  1.19k|const char *FileMode(std::uint8_t selector) {
  331|  1.19k|  static const char *const modes[] = {"r", "r+", "w", "a"};
  332|  1.19k|  return modes[selector & 3U];
  333|  1.19k|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_117FuzzHappyEyeballsENS0_11InputCursorE:
  430|     54|void FuzzHappyEyeballs(InputCursor input) {
  431|     54|  if (!CurlRuntimeReady())
  ------------------
  |  Branch (431:7): [True: 0, False: 54]
  ------------------
  432|      0|    return;
  433|       |
  434|     54|  CURL *easy = curl_easy_init();
  435|     54|  if (!easy)
  ------------------
  |  Branch (435:7): [True: 0, False: 54]
  ------------------
  436|      0|    return;
  437|     54|  struct Curl_easy *data = reinterpret_cast<struct Curl_easy *>(easy);
  438|     54|  struct Curl_peer *origin = nullptr;
  439|     54|  struct Curl_peer *alternative = nullptr;
  440|     54|  struct Curl_peer *tunnel = nullptr;
  441|     54|  struct connectdata connection = {};
  442|     54|  struct Curl_cfchain chain = {};
  443|     54|  struct Curl_cfilter anchor = {};
  444|     54|  const struct Curl_scheme *scheme = Curl_get_scheme("http");
  445|     54|  const std::uint8_t flags = input.TakeByte() & 7U;
  446|     54|  const std::uint16_t port = static_cast<std::uint16_t>(1U + flags);
  447|       |
  448|     54|  CURLcode result = scheme
  ------------------
  |  Branch (448:21): [True: 54, False: 0]
  ------------------
  449|     54|                        ? Curl_peer_create(data, scheme, "origin.test", port,
  450|     54|                                           &origin)
  451|     54|                        : CURLE_FAILED_INIT;
  452|     54|  if (!result && (flags & 2U))
  ------------------
  |  Branch (452:7): [True: 54, False: 0]
  |  Branch (452:18): [True: 18, False: 36]
  ------------------
  453|     18|    result = Curl_peer_create(data, scheme, "peer.test", port + 1,
  454|     18|                              &alternative);
  455|     54|  if (!result && (flags & 4U))
  ------------------
  |  Branch (455:7): [True: 54, False: 0]
  |  Branch (455:18): [True: 15, False: 39]
  ------------------
  456|     15|    result =
  457|     15|        Curl_peer_create(data, scheme, "tunnel.test", port + 2, &tunnel);
  458|       |
  459|     54|  const std::uint8_t transport =
  460|     54|      (flags & 1U) && !tunnel ? TRNSPRT_UDP : TRNSPRT_TCP;
  ------------------
  |  |  226|     15|#define TRNSPRT_UDP  4
  ------------------
                    (flags & 1U) && !tunnel ? TRNSPRT_UDP : TRNSPRT_TCP;
  ------------------
  |  |  225|     93|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (460:7): [True: 23, False: 31]
  |  Branch (460:23): [True: 15, False: 8]
  ------------------
  461|     54|  if (!result) {
  ------------------
  |  Branch (461:7): [True: 54, False: 0]
  ------------------
  462|     54|    Curl_cfchain_init(&chain, &connection, true);
  463|     54|    anchor.chain = &chain;
  464|     54|    result = Curl_cf_ip_happy_insert_after(
  465|     54|        &anchor, data, origin, alternative ? alternative : origin, transport,
  ------------------
  |  Branch (465:32): [True: 18, False: 36]
  ------------------
  466|     54|        tunnel, TRNSPRT_TCP);
  ------------------
  |  |  225|     54|#define TRNSPRT_TCP  3
  ------------------
  467|     54|  }
  468|       |
  469|     54|  if (!result) {
  ------------------
  |  Branch (469:7): [True: 54, False: 0]
  ------------------
  470|     54|    struct Curl_cfilter *happy = anchor.next;
  471|     54|    for (std::size_t operation = 0;
  472|  3.42k|         operation < kMaxOperations && !input.empty(); ++operation) {
  ------------------
  |  Branch (472:10): [True: 3.41k, False: 4]
  |  Branch (472:40): [True: 3.36k, False: 50]
  ------------------
  473|  3.36k|      switch (input.TakeByte()) {
  474|    209|        case 'P': {
  ------------------
  |  Branch (474:9): [True: 209, False: 3.15k]
  ------------------
  475|    209|          const bool pending = happy->cft->has_data_pending(happy, data);
  476|    209|          assert(!pending);
  ------------------
  |  Branch (476:11): [True: 209, False: 0]
  ------------------
  477|    209|          break;
  478|    209|        }
  479|    229|        case 'Q': {
  ------------------
  |  Branch (479:9): [True: 229, False: 3.13k]
  ------------------
  480|    229|          int reply_ms = -2;
  481|    229|          const CURLcode query_result = happy->cft->query(
  482|    229|              happy, data, CF_QUERY_CONNECT_REPLY_MS, &reply_ms, nullptr);
  ------------------
  |  |  168|    229|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  483|    229|          assert(query_result == CURLE_OK);
  ------------------
  |  Branch (483:11): [True: 229, False: 0]
  ------------------
  484|    229|          assert(reply_ms == -1);
  ------------------
  |  Branch (484:11): [True: 229, False: 0]
  ------------------
  485|    229|          break;
  486|    229|        }
  487|    751|        case 'S': {
  ------------------
  |  Branch (487:9): [True: 751, False: 2.61k]
  ------------------
  488|    751|          bool done = false;
  489|    751|          const CURLcode shutdown_result =
  490|    751|              happy->cft->do_shutdown(happy, data, &done);
  491|    751|          assert(shutdown_result == CURLE_OK);
  ------------------
  |  Branch (491:11): [True: 751, False: 0]
  ------------------
  492|    751|          assert(done);
  ------------------
  |  Branch (492:11): [True: 751, False: 0]
  ------------------
  493|    751|          break;
  494|    751|        }
  495|  2.17k|        default:
  ------------------
  |  Branch (495:9): [True: 2.17k, False: 1.18k]
  ------------------
  496|  2.17k|          break;
  497|  3.36k|      }
  498|  3.36k|    }
  499|     54|    Curl_conn_cf_discard_chain(&anchor.next, data);
  500|     54|  }
  501|       |
  502|     54|  Curl_peer_unlink(&tunnel);
  503|     54|  Curl_peer_unlink(&alternative);
  504|     54|  Curl_peer_unlink(&origin);
  505|     54|  curl_easy_cleanup(easy);
  506|     54|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_116CurlRuntimeReadyEv:
  425|     54|bool CurlRuntimeReady() {
  426|     54|  static const CurlRuntime runtime;
  427|     54|  return runtime.initialized();
  428|     54|}
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111CurlRuntimeC2Ev:
  413|      1|  CurlRuntime() : initialized_(curl_global_init(CURL_GLOBAL_ALL) == CURLE_OK) {}
  ------------------
  |  | 3047|      1|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3044|      1|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  ------------------
  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3045|      1|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  ------------------
  ------------------
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_111CurlRuntimeD2Ev:
  414|      1|  ~CurlRuntime() {
  415|      1|    if (initialized_)
  ------------------
  |  Branch (415:9): [True: 1, False: 0]
  ------------------
  416|      1|      curl_global_cleanup();
  417|      1|  }
fuzz_private.cc:_ZNK14private_fuzzer12_GLOBAL__N_111CurlRuntime11initializedEv:
  419|     54|  bool initialized() const { return initialized_; }
fuzz_private.cc:_ZN14private_fuzzer12_GLOBAL__N_113FuzzHostcheckENS0_11InputCursorE:
  283|    636|void FuzzHostcheck(InputCursor input) {
  284|    636|  const std::string records =
  285|    636|      input.TakeBytes(std::min(input.remaining(), kMaxHostcheckInputBytes));
  286|    636|  std::size_t record_start = 0;
  287|    636|  for (std::size_t operation = 0;
  288|  4.39k|       operation < kMaxHostcheckRecords && record_start <= records.size();
  ------------------
  |  Branch (288:8): [True: 4.38k, False: 12]
  |  Branch (288:44): [True: 4.38k, False: 0]
  ------------------
  289|  4.38k|       ++operation) {
  290|  4.38k|    const std::size_t record_end = records.find('\n', record_start);
  291|  4.38k|    const std::size_t bounded_end =
  292|  4.38k|        record_end == std::string::npos ? records.size() : record_end;
  ------------------
  |  Branch (292:9): [True: 624, False: 3.76k]
  ------------------
  293|  4.38k|    const std::size_t separator = records.find('|', record_start);
  294|  4.38k|    if (separator < bounded_end) {
  ------------------
  |  Branch (294:9): [True: 3.73k, False: 653]
  ------------------
  295|  3.73k|      const std::size_t pattern_length =
  296|  3.73k|          std::min(separator - record_start, kMaxHostcheckNameLength);
  297|  3.73k|      const std::size_t hostname_start = separator + 1;
  298|  3.73k|      const std::size_t hostname_length =
  299|  3.73k|          std::min(bounded_end - hostname_start, kMaxHostcheckNameLength);
  300|  3.73k|      std::unique_ptr<char[]> pattern;
  301|  3.73k|      if (pattern_length != 0) {
  ------------------
  |  Branch (301:11): [True: 3.40k, False: 326]
  ------------------
  302|  3.40k|        pattern = std::make_unique<char[]>(pattern_length);
  303|  3.40k|        std::copy_n(records.data() + record_start, pattern_length,
  304|  3.40k|                    pattern.get());
  305|  3.40k|      }
  306|  3.73k|      const std::string hostname =
  307|  3.73k|          records.substr(hostname_start, hostname_length);
  308|  3.73k|      (void)Curl_cert_hostcheck(pattern.get(), pattern_length, hostname.c_str(),
  309|  3.73k|                                hostname.size());
  310|  3.73k|    }
  311|  4.38k|    if (record_end == std::string::npos)
  ------------------
  |  Branch (311:9): [True: 624, False: 3.76k]
  ------------------
  312|    624|      break;
  313|  3.76k|    record_start = record_end + 1;
  314|  3.76k|  }
  315|    636|}

